Flux Coordinates and the Safety Factor
Straight-field-line flux coordinates turn the tangled 3D field into simple geometry, and the safety factor q(psi) they yield is the master stability parameter for the breeder.
Flux-surface labeling
Once psi is known, nested flux surfaces are its level sets. Physics is naturally expressed in coordinates that follow these surfaces: a radial label (psi or a normalized rho), a poloidal angle, and the toroidal angle. Straight-field-line coordinates choose the poloidal angle so field lines are straight in the angle plane, which simplifies transport, turbulence, and stability analysis used throughout the twin.
Safety factor (field-line pitch):
q(psi) = (1 / 2pi) * Integral_0^2pi ( B . grad phi ) / ( B . grad theta ) d theta
= (1 / 2pi) * Contour_int ( F / R^2 ) * ( dl_p / |grad psi| )
q = number of toroidal transits per single poloidal transit
q measures magnetic shear: s = (rho/q) dq/drho
Why q governs stability
Rational surfaces where q = m/n (m, n integers) are where resonant MHD modes and magnetic islands can grow. The q profile - its edge value q_a, its minimum q_min, and its shear s = (r/q) dq/dr - sets which instabilities are accessible. For the breeder at 9.66 MA the current and q profiles are engineered to keep dangerous rational surfaces out of high-pressure-gradient regions.
# safety factor on a flux surface from a traced contour
def q_of_psi(contour, F, psi):
dl = arc_lengths(contour) # poloidal arc segments
gradpsi = grad_psi_on(contour)
integrand = (F / contour.R**2) / abs(gradpsi)
return (1/(2*pi)) * sum(integrand * dl) # single-surface q
Coordinates as the AI substrate
Flux coordinates are also the spatial normalization the data fabric applies before any learning: mapping raw sensor positions onto a common rho grid lets GNNs and PINNs generalize across shots and shapes. A signal at 'rho = 0.8' means the same physical location regardless of how the boundary moved, which is essential for transfer between the breeder's varying equilibria.
- q_a (edge q): sets gross kink stability and disruption proximity.
- q_min: if it drops through low rationals, tearing and NTMs threaten.
- shear s: stabilizes ballooning at high s; low/negative shear enables other modes.
The mapping from lab coordinates to flux coordinates is recomputed every reconstruction cycle, so the twin and its learned modules always operate in a geometry consistent with the current equilibrium.