vmec_jax.vmec_residueΒΆ
VMEC residue/getfsq-style scalar residuals for parity work.
VMEC2000 reports scalar force residual measures:
fsqr: R-equation residual norm
fsqz: Z-equation residual norm
fsql: lambda-equation residual norm
Internally these are computed from Fourier-space force arrays produced by
tomnsps and normalized by the force norms fnorm and fnormL
computed in bcovar.
This module implements the scalar pieces needed for output-parity tests
against bundled VMEC2000 wout files.
Functions
|
Apply VMEC's converged-iteration m=1 polar constraints to Fourier forces. |
|
Apply VMEC's post-tomnsps scalxc scaling to force coefficient blocks. |
|
Compute (fnorm, fnormL) using VMEC's bcovar normalization formulas. |
|
Compute (fnorm, fnormL) using VMEC's bcovar normalization formulas without wout. |
|
Compute (fsqr,fsqz,fsql) from VMEC-style tomnsps outputs. |
|
Compute (fsqr,fsqz,fsql) as JAX scalars from VMEC-style tomnsps outputs. |
|
Return the sum-of-squares components used in vmec_fsq_from_tomnsps. |
|
Return VMEC-style (gcr2, gcz2, gcl2) sum-of-squares as JAX scalars. |
|
NumPy-only version of vmec_gcx2_from_tomnsps. |
|
Return VMEC's pwint weights as a (ns,ntheta3,nzeta) array. |
|
Return (rcc, rss, zsc, zcs) in signed (m,n>=0) storage. |
|
Compute rzNorm from Fourier coefficients (n>=0 storage convention). |
|
Reproduce VMEC's scalxc(js,m) factors used to scale forces before residue. |
|
Return VMEC's angular integration weights as a (ntheta3,nzeta) array. |
|
Zero the m=1 Z-force blocks used by the axis constraint. |
Classes
|
VMEC normalization constants used by getfsq and residue. |
|
|
|
JAX-traceable scalar residuals (fsqr, fsqz, fsql). |
|
Unnormalized sum-of-squares pieces used by getfsq-style scalars. |