The Linear MHD Stability Eigenproblem
Linearizing ideal MHD about an equilibrium gives a self-adjoint force operator whose eigenvalues are growth rates; the AI learns its unstable manifold.
The linearized force operator
Perturbing the ideal-MHD equations about a static equilibrium and assuming time dependence exp(gamma t) yields a generalized eigenvalue problem for the displacement xi. The force operator F is self-adjoint, which guarantees real gamma^2 - motions are either purely growing or purely oscillating, never overstable in ideal MHD. This structure is exploited by every stability code that seeds the breeder's training data.
Linearized ideal MHD eigenproblem:
F(xi) = -rho * gamma^2 * xi
F(xi) = grad( gamma_ad p div xi + xi.grad p )
+ (1/mu0) (curl B) x Q + (1/mu0)(curl Q) x B
Q = curl(xi x B)
Self-adjoint: <eta, F(xi)> = <xi, F(eta)> -> gamma^2 real
Discrete generalized eigenproblem
Discretizing xi on a flux-coordinate grid turns the operator equation into a matrix generalized eigenproblem. The most-unstable eigenpair is what matters, so iterative methods (shift-invert Arnoldi/Lanczos) target the extreme eigenvalues rather than the full spectrum.
# most-unstable ideal-MHD mode via shift-invert
# A xi = gamma^2 B_mass xi (A from force operator)
from scipy.sparse.linalg import eigsh
vals, vecs = eigsh(A, k=4, M=B_mass, sigma=sigma0,
which='LM') # near shift sigma0
gamma2 = vals.max()
unstable = gamma2 > 0 # positive -> growing mode
mode = vecs[:, vals.argmax()] # eigenvector = mode structure
Toroidal mode-number decomposition
Axisymmetry lets perturbations separate by toroidal mode number n: exp(i n phi). Each n is an independent eigenproblem. Low n (1, 2) are global kink/ballooning modes; the n = 0 problem is vertical stability. The breeder scans n to find the most-dangerous mode at each operating point.
- n = 0: vertical instability (axisymmetric), needs active feedback.
- n = 1: external kink and resistive-wall modes.
- intermediate n: ballooning modes, pressure-gradient driven.
- high n: local ballooning, treated by the s-alpha equation.
Because a full eigen-solve is far too slow for real time, the stack trains classifiers and regressors on offline eigenvalue databases to predict growth rates from equilibrium descriptors, giving the twin a continuous stability margin field it updates every cycle.