Weak Form and Finite-Element Discretization of Grad-Shafranov
Casting Grad-Shafranov in its weak form yields the finite-element system that offline solvers use to generate the equilibrium libraries PINNs and surrogates are trained on.
From strong to weak form
The Grad-Shafranov operator is elliptic and self-adjoint with respect to the weight 1/R. Multiplying by a test function v, integrating over the poloidal plane, and integrating by parts moves one derivative onto v. This weak form is the basis of the finite-element solvers whose high-fidelity equilibria seed the L0 training libraries.
Weak form: find psi in H^1 such that for all test v
Integral_Omega (1/R) grad(psi) . grad(v) dR dZ
= Integral_Omega [ mu0 R p'(psi) + F F'(psi)/R ] v dR dZ
+ boundary terms
Note the 1/R weight makes the operator symmetric:
a(psi,v) = a(v,psi) under this inner product.
Galerkin discretization
Expanding psi in finite-element basis functions phi_j and testing against the same basis (Galerkin) gives a nonlinear algebraic system, because the source depends on psi. It is solved by Picard or Newton iteration; Newton needs the derivative of the source with respect to the nodal unknowns.
Discrete system: K(psi) . psi = b(psi)
K_ij = Integral (1/R) grad(phi_i).grad(phi_j) dR dZ (stiffness)
b_i = Integral [ mu0 R p'(psi_h) + F F'(psi_h)/R ] phi_i dR dZ
Newton step: ( K - dS/dpsi ) delta_psi = -( K psi - b )
where dS/dpsi = Jacobian of the nonlinear source term
Why FEM here, PINN in the loop
FEM gives controlled, convergent, mesh-refinable equilibria with rigorous error estimates - ideal offline where accuracy and provenance matter. But a fresh FEM solve per real-time step is too slow for the 1-100 ms L3 regime. So the stack uses FEM offline to produce ground truth, then distills PINN and neural-operator surrogates that reproduce the FEM solution manifold at inference speed.
- FEM strengths: convergence guarantees, adaptive refinement near X-points, provenance for validation.
- FEM cost: assembly and factorization per nonlinear iteration, per equilibrium.
- Role in stack: offline ground truth and benchmark for PINN/surrogate accuracy.
Every learned equilibrium tool is benchmarked against FEM before it is trusted; the PINN-vs-FEM error is a tracked fidelity metric for the twin.