vmec_jax.integrals¶
Angle and radial integrals.
This module computes simple derived quantities from geometric outputs, notably
the volume profile from the Jacobian sqrtg.
Conventions¶
The geometry kernel in vmec_jax.geom computes sqrtg as the Jacobian
for coordinates (s, theta, phi_phys), where phi_phys is the physical
toroidal angle.
Most of vmec_jax works on one field period using the VMEC internal coordinate
zeta in [0, 2π), related by:
phi_phys = zeta / NFP
Therefore, when integrating over the stored zeta grid, include the factor
dphi = dzeta / NFP.
VMEC wout convention note¶
VMEC stores several 3D fields in wout_*.nc on the radial half mesh and with angles (theta, zeta) over one field period. In VMEC’s internal bookkeeping, many 1D radial integrals are computed using a simple rectangle rule:
V = Σ_{js=2..ns} (dV/ds)(js) * hs
This differs from a trapezoidal rule and matters at low radial resolution. For regression tests against wout, use the helpers in this module that implement the same conventions.
Functions
|
Cumulative rectangle-rule integral for half-mesh data. |
|
Cumulative trapezoidal integral in s with V(0)=0. |
|
Compute dV/ds from |
|
Compute dV/ds by integrating over (theta, zeta). |
|
Convenience wrapper: compute (dvds, V) from sqrtg. |
|
Compute (dvds, V) using VMEC-like (wout) conventions. |