Linear Model And Derivations

This page records the linear model that GKX benchmarks. The nonlinear solver adds the \(E\times B\) and flutter brackets to the same operator.

Scope

The linear benchmark rows of the evidence ledger (tools/evidence_ledger.toml) cover:

  • KAW: slab kinetic Alfven wave against the analytic dispersion relation

  • ETG: kinetic electrons with Boltzmann ions, electrostatic

  • W7-X and HSX: ITG on VMEC-derived stellarator geometry

  • Cyclone base case (adiabatic electrons), in s-alpha and in Miller geometry

  • KBM: kinetic ions and electrons, \(A_\parallel\) on and \(B_\parallel\) off

Each row is scanned in \(k_y\). Its status (passing or provisional), measured mismatch, reference and velocity-space regularization are listed in Validation, which is generated from the ledger.

Normalized equation

For species \(s\), we evolve Laguerre-Hermite moments \(G^{(s)}_{\ell m}(k_x, k_y, z, t)\) in a flux tube:

\[\partial_t G_{\ell m} + \mathcal{S}_{\ell m}[H] + \mathcal{M}_{\ell m}[H] + \mathcal{C}_{\ell m}[H] + \mathcal{G}_{\ell m}[H] = \mathcal{D}_{\ell m}[\phi] + \mathcal{K}_{\ell m}[G],\]

where:

  • \(\mathcal{S}\) is parallel streaming (Hermite ladder)

  • \(\mathcal{M}\) is mirror coupling (\(b'(z)\) geometry factor)

  • \(\mathcal{C}\) and \(\mathcal{G}\) are curvature and grad-\(B\) drifts

  • \(\mathcal{D}\) is diamagnetic drive from \(a/L_n, a/L_T\)

  • \(\mathcal{K}\) contains collisions/hypercollisions/end damping

The field-coupled variable is

\[H_{\ell m} = G_{\ell m} + \frac{Z_s}{T_s} J_\ell \phi\,\delta_{m0} - \frac{Z_s v_{th,s}}{T_s} J_\ell A_\parallel\,\delta_{m1} + J_\ell^B B_\parallel\,\delta_{m0},\]

with \(J_\ell^B = J_\ell + J_{\ell-1}\).

Hermite-Laguerre projection

The reduced distribution is expanded as

\[g_s = \sum_{\ell=0}^{N_\ell-1}\sum_{m=0}^{N_m-1} G^{(s)}_{\ell m}\, \mathcal{L}_\ell(\mu)\,\mathcal{H}_m(v_\parallel),\]

with orthogonality

\[\langle \mathcal{H}_m \mathcal{H}_n \rangle = \delta_{mn}, \qquad \langle \mathcal{L}_\ell \mathcal{L}_j \rangle = \delta_{\ell j}.\]

This gives sparse couplings:

  • streaming: \(m \leftrightarrow m\pm1\)

  • curvature: \(m \leftrightarrow m, m\pm2\)

  • grad-\(B\): \(\ell \leftrightarrow \ell, \ell\pm1\)

  • mirror: mixed \((\ell\pm1, m\pm1)\) stencil

These sparsity patterns are implemented as fused tensor kernels in the RHS.

Gyroaverage and \(k_\perp\)

GKX uses the Laguerre gyroaverage

\[J_\ell(b) = \frac{1}{\ell!}\left(-\frac{b}{2}\right)^\ell e^{-b/2}, \qquad b = k_\perp^2 \rho_s^2.\]

For s-alpha geometry, the metric coefficients \(gds2, gds21, gds22\) define

\[k_\perp^2 = \left[ k_y^2 gds2 + 2 k_x k_y \hat{s}^{-1} gds21 + (k_x \hat{s}^{-1})^2 gds22 \right] B^{-2}(z),\]

including linked/NTFT corrections when enabled.

Field equations

Electrostatic limit:

\[\mathcal{Q}\,\phi = \sum_s Z_s n_s \sum_\ell J_\ell G_{\ell 0}^{(s)}.\]

Electromagnetic linear closure:

  • coupled solve for \((\phi, B_\parallel)\) from quasineutrality and perpendicular Ampere

  • \(A_\parallel\) from parallel Ampere

The KBM benchmark runs with \(A_\parallel\) on and \(B_\parallel\) off, because its reference omits \(\delta B_\parallel\).

Growth-rate/frequency extraction

Time-integrated runs extract the growth rate and frequency two ways:

  1. Log-linear fit on complex mode signal \(s(t)\):

    \[s(t) \approx s_0 e^{(\gamma - i\omega)t} \Rightarrow \log |s| = \gamma t + c,\quad \arg s = -\omega t + c_\phi.\]
  2. Instantaneous ratio diagnostic (for consistency checks):

    \[r_n = \frac{s_{n+1}}{s_n}, \quad \gamma_n = \frac{\log |r_n|}{\Delta t}, \quad \omega_n = -\frac{\arg(r_n)}{\Delta t}.\]

Windows are selected from intervals with sustained log-linear behavior and finite amplitude support (gkx.diagnostics.growth_rates.fit_growth_rate_auto()). The eigensolver path returns the eigenvalue directly and certifies it by its residual; see Methods and Decisions.

Numerical realization

  • perpendicular Fourier representation in \((k_x, k_y)\)

  • field-aligned \(z\) grid with linked boundary support

  • JAX-fused RHS with cache-backed geometry/gyroaverage tensors

  • explicit rk2/rk4 time stepping, at a fixed step or under the CFL controller (gkx.config.TimeConfig)

  • the matrix-free adaptive Krylov eigensolver, the gkx.solvers_linear_krylov.KrylovConfig default, with shift-invert selectable

Benchmark contract

For all linear benchmark plots/tables:

  • report \(\gamma,\omega\) with explicit normalization

  • publish mismatch tables by scan coordinate (\(k_y\) or \(\beta_{ref}\))

  • include per-case parameter tables (geometry, gradients, species, toggles, grid, resolution)

  • give every published number a ledger row, so it appears in Validation