Physics Implementation
This page maps the implemented coordinate physics to the formulas used by
pyCOCOS.
Per-Surface Inputs
Each flux surface is represented by a geometric context containing:
\(R(\theta)\) major radius
\(B(\theta)\) magnetic field magnitude
\(B_{pol}(\theta)\) poloidal field magnitude
\(dl_p(\theta)\) poloidal arc-length increments
scalar profiles \(I(\psi)\), \(F(\psi)\), \(q(\psi)\)
The context is assembled in pycocos.coordinates.compute_coordinates and
passed to the Jacobian builder layer.
Jacobian Family
The implemented Jacobian family is:
for coordinate-specific integer exponents \((i,j,k)\).
Axisymmetric identity used in the implementation:
Coordinate-Specific Branches
Boozer
This branch is implemented directly and validated with the diagnostic residual:
PEST
Uses the \(R^2\) family branch:
followed by per-surface normalization.
Equal-Arc
Uses:
which gives \(J \propto R/|\nabla\psi|\), then per-surface normalization.
Hamada
Uses:
which yields a theta-independent Jacobian after normalization on each surface.
Per-Surface Normalization
For non-Boozer branches, pyCOCOS applies a surface normalization so the
constructed poloidal angle spans \(2\pi\), following the Eq. 8.99/8.100
style logic:
The raw span is integrated over the surface and used to scale \(J\).
Code Mapping
Context assembly:
pycocos.coordinates.compute_coordinatesPhysics branches + normalization orchestration:
pycocos.coordinates.jacobian_buildersHeavy numerical kernels:
pycocos.coordinates.jacobian_numba_kernels