1. Introduction
Turbulent transport has long been known to degrade the energy confinement of magnetic-confinement fusion devices. In both tokamaks and neoclassically optimised stellarators, turbulent transport is the dominant energy loss mechanism, and sets a lower limit on the magnetic field strength and/or physical size of the fusion device. The turbulence depends on the magnetic field and on plasma parameters (e.g. magnetic shear, the shape of the flux surface, and the gradients of density and temperature), which raises the possibility that the magnetic field geometry could be shaped to minimise the impact of turbulent transport on plasma energy confinement. Finding such an optimal design point requires intimate knowledge of the turbulence and its dependence on such parameters.
Understanding and assessing this dependence is, in general, a difficult problem, as the nonlinear chaotic nature of the turbulence obfuscates a straightforward analysis. However, different modelling methods have made great progress, such as (quasi-)linear modelling (Stephens et al. Reference Stephens, Garbet, Citrin, Bourdelle, van de Plassche and Jenko2021; Staebler, Belli & Candy Reference Staebler, Belli and Candy2023), nonlinear mode coupling (Pueschel et al. Reference Pueschel, Faber, Citrin, Hegna, Terry and Hatch2016; Hegna, Terry & Faber Reference Hegna, Terry and Faber2018), advances in direct computation of turbulence (Barnes et al. Reference Barnes, Parra and Landreman2019; Di Siena et al. Reference Di2022; Hoffmann, Frei & Ricci Reference Hoffmann, Frei and Ricci2023; Mandell et al. Reference Mandell, Dorland, Abel, Gaur, Kim, Martin and Qian2024; Rodriguez-Fernandez et al. Reference Rodriguez-Fernandez, Howard, Saltzman, Kantamneni, Candy, Holland, Balandat, Ament and White2024) and the use of machine learning to model turbulence (van de Plassche et al. Reference van de Plassche2020; Honda et al. Reference Honda, Narita, Maeyama and Watanabe2023). All these models are valuable, but trade off generality, interpretability and computational costs. A computationally cheap model of broad generality based on simple physical considerations (at the cost of, for example, accuracy) could be a valuable addition in this marketplace of models, as it provides a tool to efficiently scan over a wide region of parameter space to identify possible attractive designs.
Thermodynamic methods can be used to devise such models, where the dynamics of individual particles are neglected in favour of global properties such as energy and entropy. For instance, by exploiting properties of the Helmholtz free energy, one can derive general bounds on the nonlinear growth rates of the free energy (Helander & Plunk Reference Helander and Plunk2022; Plunk & Helander Reference Mackenbach, Proll and Helander2022, Reference Mandell, Dorland, Abel, Gaur, Kim, Martin and Qian2023; Costello & Plunk Reference Costello and Plunk2025a ). Furthermore, entropy-maximising arguments have pointed to a degree of universality in the tails of the energy distribution of so-called Lynden-Bell equilibria, which exhibit power-law behaviour (Lynden-Bell Reference Lynden-Bell1967; Ewart et al. Reference Ewart, Brown, Adkins and Schekochihin2022, Reference Ewart, Nastac and Schekochihin2023; Banik, Bhattacharjee & Sengupta Reference Banik, Bhattacharjee and Sengupta2024). Finally, by exploiting conservation laws, one can derive upper bounds on the amount of thermal energy that can be converted into other forms of energy and drive turbulence in various systems (Lorenz Reference Lorenz1955; Gardner Reference Gardner1963; Kolmes & Fisch Reference Kolmes and Fisch2020). This quantity is called the ‘available energy’ and is the main focus of this paper.
The available energy can be calculated by determining the ground state distribution function
$F$
of whatever particle species is being considered, which is defined as the distribution function that minimises the total thermal energy
subject to appropriate constraints. Here,
$E_T$
is the total thermal energy,
$\epsilon =mv^2/2$
is the kinetic particle energy and
$\boldsymbol{x}=(\boldsymbol{r},\boldsymbol{v})$
denotes phase-space coordinates with the volume element
$\mathrm{d} \boldsymbol{r}\, \mathrm{d} \boldsymbol{v} = \sqrt {g} \, \mathrm{d} \boldsymbol{x}$
. More specifically, if the distribution function evolves according to the Vlasov equation, it has an uncountably infinite number of invariants as it satisfies
for any smooth functional
$\mathcal{C}[f]$
for which the integral exists. These so-called Casimir invariants are a consequence of incompressibility of the flow in phase-space (i.e. Liouville’s theorem
$\mathrm{d}\!f/\mathrm{d} t = 0$
) and severely limit the amount by which
$E_T[f]$
can decrease. The distribution function that minimises the energy
$E[F]$
subject to the constraint that all Casimir invariants of
$F$
equal those associated with some ‘initial’ distribution function
$f_i$
is referred to as the Gardner re-stacking of
$f_i$
(see Kolmes, Helander & Fisch (Reference Kolmes, Helander and Fisch2020) for a discretised interpretation of such an operation, and see figure 3 of Kolmes & Fisch (Reference Kolmes and Fisch2020) for a one-dimensional example of a Gardner re-stacking). The available energy
$A$
is defined as the difference in thermal energy between the initial state,
$f_i$
, and the ground state,
$A=E_T[f_i]-E_T[F]\geqslant 0$
.

Figure 3. Plot of the available energy integrand as a function of
$\hat {v}_\perp$
and
$v_\|$
, for
$\eta \gt 2/3$
. Four different combinations of drifts are included, where the top have ‘bad’ curvature and the bottom two have ‘good’ curvature.
By accounting for additional (adiabatic) invariants, such as the magnetic moment
$\mu$
relevant in magnetised plasmas, one can further restrict the available energy (Helander Reference Helander2017). Importantly, when enough constraints are imposed on the system, the available energy depends critically on the relative sign of the magnetic field gradient and the gradients in e.g. temperature or density, and the notion of ‘good’ or ‘bad’ curvature becomes important (Helander & Mackenbach Reference Helander and Mackenbach2024). This dependence on the geometry of the magnetic field was first observed in the available energy of trapped electrons where invariance of the magnetic moment and the parallel invariant is imposed (Helander Reference Helander2017, Reference Helander2020), and it was later shown that this available energy can be used to estimate the nonlinear energy flux in trapped-electron-mode dominated turbulence (Mackenbach, Proll & Helander Reference Mackenbach, Proll and Helander2022, Reference Mackenbach, Proll, Snoep and Helander2023a
,
Reference Mackenbach, Proll, Wakelkamp and Helanderb
).
This raises the question whether available energy can be used to model other types of instabilities relevant for magnetic-confinement fusion plasmas. One particularly critical instability to consider is the ion-temperature-gradient (ITG) mode, which is understood to be responsible for much of the ion-heat turbulent transport in tokamaks and stellarators. For instance, in the Wendelstein 7-X stellarator, it is believed to cause ‘clamping’ of the ion temperature (which stays clamped to a certain value in electron-heated plasmas beyond some input power; Beurskens et al. Reference Beurskens2021). In the Tokamak à Configuration Variable (TCV), negative triangularity is often observed to improve confinement, and simulations point to a decrease in turbulent energy flux resulting from ITG instabilities (Balestri et al. Reference Balestri, Ball, Coda, Cruz-Zabala, Garcia-Munoz and Viezzer2024), although it may be the trapped-electron-mode that determines the turbulence (Marinoni et al. Reference Marinoni, Brunner, Camenen, Coda, Graves, Lapillonne, Pochelon, Sauter and Villard2009; Merlo et al. Reference Merlo, Fontana, Coda, Hatch, Janhunen, Porte and Jenko2019). In both these devices, there is considerable freedom to vary the geometry of the magnetic field, and it is thus of interest to assess how the turbulence and the available energy then changes, and whether they change in the same way.
The available energy depends on the chosen invariants (also observed by Kolmes, Ochs & Fisch (Reference Kolmes, Ochs and Fisch2024) in an investigation concerning mirror machines), and modelling for example the ITG instability requires one to choose the ‘correct’ constraints. In this paper, we turn our attention to the relation between available energy and the curvature-driven ItiTG mode (also known as the toroidal branch of the ITG instability). Analyses of this instability typically assume adiabatic electrons, implying that the electron density fluctuations,
$\delta n_e$
, are in phase with fluctuations of the electrostatic potential,
$\delta \varPhi$
. As a consequence, the
$\boldsymbol{E} \times \boldsymbol{B}$
drift is out of phase with the density fluctuations, implying that there is no radial electron particle flux and the density profile is fixed. We recall that Helander (Reference Helander2020) found that, if the phase-space coordinates
$\boldsymbol{x}$
are divided into invariants
$\boldsymbol{y}$
, which stay constant during the collisionless motion of each particle, and the remaining coordinates
$\boldsymbol{z}$
, the ground state with a fixed density profile
$F=F[\epsilon (\boldsymbol{x})+\kappa (\boldsymbol{r}),\boldsymbol{y}]$
is a function of
$\epsilon +\kappa$
and the invariants
$\boldsymbol{y}$
alone, and furthermore satisfies
$\partial F / \partial (\epsilon + \kappa ) \leqslant 0$
. The Lagrange multiplier
$\kappa (\boldsymbol{r})$
, which depends on the real-space coordinate
$\boldsymbol{r}$
, ensures that the density of the ground state is the same as the initial density,Footnote
1
Here,
$n_i(\psi )$
is the density of the initial distribution function (which shall be taken to be Maxwellian later) and
$\psi$
labels the different magnetic surfaces across which the density varies. The ground state is governed by the following integro-differential equation (which may be derived by equating the Casimirs of the initial distribution function and the ground state):
where the phase-space coordinates
$\boldsymbol{x}$
can be parametrised via
$\boldsymbol{x} = (\boldsymbol{y},\boldsymbol{z})$
, the Dirac delta function is given as
$\delta (x)$
, and
$w$
distinguishes different level sets of
$F$
and
$\epsilon + \kappa$
. As shown in § 2, the calculation of the available energy for ions involved in the curvature-driven ITG instability is similar to that of trapped electrons (Mackenbach et al. Reference Mackenbach, Proll and Helander2022, Reference Mackenbach, Proll, Wakelkamp and Helander2023b
), which we shall refer to as TÆ.
2. Calculation and behaviour of the available energy
2.1. Shape of the domain and choice of the invariants
We choose the domain of the calculation to be a flux tube, a slender tube around a magnetic field line that is everywhere parallel to the magnetic field. The slenderness of the domain allows us to replace relevant functions by their linear expansions in the coordinates perpendicular to the magnetic field, which can be expressed as
where
$\psi$
is the toroidal flux enclosed by a magnetic surface divided by
$2 \pi$
, and
$\alpha = \theta - \iota \varphi$
is the Clebsch angular coordinate labelling the different field lines on such surfaces with
$\theta$
being a straight-field-line poloidal angle and
$\iota$
being the rotational transform (related to the safety factor as
$q = 1/\iota$
). This representation suggests that
$\psi$
and
$\alpha$
be used to parametrise the directions perpendicular to the central magnetic field line
$\boldsymbol{B}_0$
, and one can furthermore employ the arc length along this field line,
$\ell$
, as a third coordinate. Away from the central field line of the flux tube, this coordinate is taken to be constant on planes perpendicular to
$\boldsymbol{B}_0$
, i.e.
$\boldsymbol{B}_0 \times \boldsymbol{\nabla }\ell =\boldsymbol{0}$
. All metric components associated with the coordinates are then defined and depend, to leading order in the width of the flux tube, only on the coordinate
$\ell$
. Other functions may readily be expressed by their linear expansions in the perpendicular coordinates
$\psi$
and
$\alpha$
, where the expansion coefficients only depend on the parallel coordinate
$\ell$
, and we have thus parametrised
$\boldsymbol{r}=(\psi ,\alpha ,\ell )$
.
There are two main branches of the ITG instability: the slab mode and the curvature-driven one. In the following analysis, the available energy of the ions is calculated using an ordering that singles out the latter instability branch by taking the parallel ion dynamics to be slower than the perpendicular dynamics, i.e.
$k_\| v_T \ll \boldsymbol{k}_\perp \boldsymbol{\cdot }\boldsymbol{v}_D$
. Here,
$k_\|$
denotes the parallel wave number,
$v_T$
the thermal ion speed,
$\boldsymbol{k}_\perp$
the wave number perpendicular to the magnetic field and
$\boldsymbol{v}_D$
the magnetic drift velocity (Biglari, Diamond & Rosenbluth Reference Biglari, Diamond and Rosenbluth1989; Plunk et al. Reference Plunk, Helander, Xanthopoulos and Connor2014). As such, we take the parallel velocity
$v_\|$
of each ion to be invariant, as the perpendicular drifts dominate the dynamics. Furthermore, we assume that the ion magnetic moment
$\mu = m v_\perp ^2/2B$
is invariant, where
$m$
is the ion mass,
$v_\perp$
is the perpendicular velocity and
$B$
is the magnetic field strength. Finally, we take the parallel coordinate
$\ell$
as being invariant as well, implying that parallel movement of the ions is much slower than typical turbulent time scales. In other words, Gardner re-stacking is only allowed on planes perpendicular to
$\boldsymbol{B}_0$
,Footnote
2
since the parallel ion motion is unimportant. It is worthwhile to briefly consider when such an ordering is valid. Define the ‘transit frequency’ of a particle travelling at thermal speed
$v_{T}$
to be
$\omega _{\textrm {tran}} \sim v_{T}/\textit{qR}$
, i.e. how often it traverses a ‘connection length’
$\textit{qR}$
per unit time, where
$R$
is the major radius of the toroidal device. Further taking the characteristic frequency of the turbulence to be
$\omega _{\text{turb}} \sim v_T/L_T$
, where
$L_T \sim T/|\boldsymbol{\nabla }T|$
, requiring
$\omega _{\text{tran}} \ll \omega _{\text{turb}}$
necessitates
In other words, if the gradients in temperature are sufficiently large, the parallel dynamics may safely be neglected.
We recall that the cross-section of the domain at constant
$\ell$
cannot be chosen freely if it is assumed that both the initial distribution function and the ground state can be replaced by their linear expansions, where the full argument is given by Mackenbach et al. (Reference Mackenbach, Proll, Wakelkamp and Helander2023b
), of which we give a brief overview. Since the phase-space Jacobian is
the following quantity is constant in time
$t$
as a consequence of the Casimir invariants (since
$\mu$
,
$v_\|$
and
$\ell$
are invariant):
where
$\varTheta [x]$
is the Heaviside function,
$f$
the plasma distribution function,
$\phi$
any real scalar constant and
$\mathcal{D}$
denotes the integration domain. If we furthermore assume that any distribution function may be written as
$f \approx f_0 + f_\psi (\psi -\psi _0) + f_\alpha (\alpha -\alpha _0)$
(where subscripts to
$f$
denote partial derivatives, i.e.
$\partial _x f \equiv f_x$
, while
$\psi _0$
and
$\alpha _0$
denote corresponding values at the centre of the domain), the condition
$\partial _t \mathcal{A}(t,\phi ,\mu ,v_{\|},\ell ) = 0$
cannot be satisfied in all domain shapes
$\mathcal{D}$
, where a subscript zero refers to the fact that the function is evaluated at the centre of the domain. A geometric argument can be used to show that the only sufficiently smooth domain
$\mathcal{D}$
that conserves
$\mathcal{A}$
is elliptical in the
$(\psi ,\alpha )$
-plane. In terms of the rescaled coordinates
$x = (\psi - \psi _0) / \Delta \psi$
and
$y = (\alpha - \alpha _0)/\Delta \alpha$
, the domain satisfies the equation
\begin{equation} \mathcal{D} = \left \{ (x,y) \colon \left ( \frac {x'}{a} \right )^2 + \left ( \frac {y'}{b} \right )^2 \leqslant 1 \right \}, \end{equation}
where
$x' = x \cos \vartheta - y \sin \vartheta$
and
$y' = x \sin \vartheta + y \cos \vartheta$
for some rotation-angle
$\vartheta$
(which is different from the poloidal angle
$\theta$
). If one violates this condition by choosing e.g. a square cross-section, still approximating the ground state with its linear expansion, unphysical results arise such as negative available energies under certain conditions. We highlight that
$\Delta \psi$
,
$\Delta \alpha$
and the angle
$\vartheta$
can, in general, depend on the invariants.
This domain shape corresponds to the most general case and the available energy may be calculated in this tilted ellipse. However, for simplicity, we specialise to the case of a circular domain in
$(x,y)$
-space, thus taking
$a=b=1$
.Footnote
3
For any function
$h(x,y)$
that can be approximated by a linear expansion,
$h \approx h_x x + h_y y$
on the domain
$\mathcal{D}$
, we note the following integral required for (1.4):
\begin{equation} \begin{aligned} \int _{\mathcal{D}} \mathrm{d} x \,\mathrm{d} y \; \delta \left [ h(x,y) \right ] = \frac {2}{\sqrt {h_x^2 + h_y^2}}. \end{aligned} \end{equation}
2.2. Available energy
With the domain shape
$\mathcal{D}$
given in (2.5) and setting
$a=b=1$
, we now turn to the calculation of the available energy associated with an initially Maxwellian distribution function in local thermodynamic equilibrium (where we assume the temperature and density are flux functions, i.e.
$n = n(\psi )$
and
$T=T(\psi )$
),
It is straightforward to evaluate the perpendicular derivatives of this plasma distribution function. For economy of notation, we write
where the particle energy is
$\epsilon = \mu B + m v_{\|}^2/2$
, quantities with a subscript zero are evaluated at the centre of the elliptical domain
$(\psi _0,\alpha _0)$
and understand that the derivatives are evaluated at the centre of the flux tube too. We note that the perpendicular derivatives of the magnetic field are related to the particle drifts at the centre of the flux tube, as may be seen by expressing the quantity
$\boldsymbol{v}_{\boldsymbol{\nabla }}= \boldsymbol{b} \times \boldsymbol{\nabla }\ln B$
in
$(\psi ,\alpha ,\ell )$
coordinates,
where we have employed
$\boldsymbol{B} \times \boldsymbol{\nabla }\ell = \boldsymbol{0}$
. Taking inner products with
$\boldsymbol{\nabla }\psi$
and
$\boldsymbol{\nabla }\alpha$
, one finds the relations
Now, to solve the ground-state equation, we require perpendicular derivatives of both the particle energy and the initial distribution function, and definitions of (2.10) allow us to succinctly express them as
where
$\partial _\psi \kappa |_{\alpha ,\ell } = \kappa _\alpha$
and
$\partial _\alpha \kappa |_{\psi ,\ell } = \kappa _\psi$
are, for the moment, unknown. Without loss of generality, we set
$\psi _0 = \alpha _0 = 0$
henceforth, for ease of notation. To calculate the numerator in the ground state (1.4) (derived by equating the Casimirs), we need the following integral as a function of the particle energy
$w$
:
where we have employed (2.6), and
$w - \epsilon (\psi _0,\alpha _0) - \kappa (\psi _0,\alpha _0)$
vanishes since the ground state and initial distribution function are identical to leading order in slenderness of the flux tube. We also require the denominator, i.e. the ‘waterbag distribution’ (Ewart, Nastac & Schekochihin Reference Ewart, Nastac and Schekochihin2023),
where, to leading-order,
$f_{M,0}=F$
. Substituting these results in (1.4), we find that the ground state becomes
where a prime denotes differentiation with respect to the first argument, and
$G$
is defined by
\begin{equation} G[\kappa _\psi (\ell ),\kappa _\alpha (\ell )] \equiv \sqrt {\frac {(\Delta \psi )^2 (\omega _\alpha - \omega _*^T )^2 +(\Delta \alpha )^2 (\omega _\psi )^2}{ (\Delta \psi )^2 (\omega _\alpha + \kappa _\alpha )^2 +(\Delta \alpha )^2 (\omega _\psi - \kappa _\psi )^2}}. \end{equation}
The functions
$\kappa _\psi$
and
$\kappa _\alpha$
are determined by the condition that the density remains fixed,
and we wish to manipulate this equation to find explicit expressions for these functions. Taking partial derivatives of (2.16) with respect to
$\psi$
and
$\alpha$
, and invoking (2.11) and (2.14), gives two coupled nonlinear algebraic equations for
$\kappa _\alpha$
and
$\kappa _\psi$
,
and we prove uniqueness of the solution pair
$(\kappa _\psi ,\kappa _\alpha )$
in Appendix A.
With the ground-state given in (2.14), we can now evaluate the available energy,
where
$\mathcal{V}: \: (\mu \geqslant 0,\, v_\| \in \mathbb{R},\, \ell \in \mathbb{R})$
. As in the case of the TÆ, we note that
$\int (f_M-F)$
$\mathrm{d}\psi \,\mathrm{d}\alpha = 0$
, because the number of particles with given values of
$(\mu ,v_{\|},\ell )$
is conserved. The integral can thus be evaluated to leading order as
\begin{equation} \begin{aligned} A =& \frac {\pi }{m}\int _{\mathcal{D} \times \mathcal{V}} \mathrm{d} \psi\, \mathrm{d} \alpha \,\mathrm{d} \ell \,\mathrm{d} \mu\, \mathrm{d} v_{\|} \; \left [ \frac {\partial (\epsilon +\kappa )}{\partial \psi } \frac {\partial \left ( f_M - F \right )}{\partial \psi } \psi ^2 + \frac {\partial (\epsilon +\kappa )}{\partial \alpha } \frac {\partial \left ( f_M - F \right )}{\partial \alpha } \alpha ^2 \right ] \\ &- \frac {\pi }{m}\int _{\mathcal{D} \times \mathcal{V}} \mathrm{d} \psi\, \mathrm{d} \alpha\, \mathrm{d} \ell\, \mathrm{d} \mu\, \mathrm{d} v_{\|} \; \left [ \frac {\partial \kappa }{\partial \psi } \frac {\partial \left ( f_M - F \right )}{\partial \psi } \psi ^2 + \frac {\partial \kappa }{\partial \alpha } \frac {\partial \left ( f_M - F \right )}{\partial \alpha } \alpha ^2 \right ], \end{aligned} \end{equation}
having simply added and subtracted the same term, and understanding that the partial derivatives are performed in
$(\psi ,\alpha ,\ell ,\mu ,v_\|)$
-coordinates with remaining coordinates held fixed. The second term on the right-hand side of the equation vanishes as a consequence of (2.16), and writing out the derivatives in full, we find
\begin{equation} \begin{aligned} A =-&\frac {\pi }{m} \int _{\mathcal{D} \times \mathcal{V}} \mathrm{d} \psi \,\mathrm{d} \alpha\, \mathrm{d} \ell \,\mathrm{d} \mu \,\mathrm{d} v_{\|} \; \frac {f_{M,0}}{T_0} \left [(\omega _\alpha + \kappa _\alpha ) (\omega _\alpha - \omega _*^T) \psi ^2 + (\omega _\psi - \kappa _\psi ) \omega _\psi \alpha ^2 \right ] \\ & +\frac {\pi }{m} \int _{\mathcal{D} \times \mathcal{V}} \mathrm{d} \psi\, \mathrm{d} \alpha \,\mathrm{d} \ell\, \mathrm{d} \mu\, \mathrm{d} v_{\|} \; \frac {f_{M,0}}{T_0} G \left [ \left (\omega _\alpha + \kappa _\alpha \right )^2 \psi ^2 + (\omega _\psi - \kappa _\psi )^2 \alpha ^2 \right ] . \end{aligned} \end{equation}
The integrals over the elliptical cross-section in the
$(\psi ,\alpha )$
-plane can readily be evaluated,
$\int _{\mathcal{D}} \psi ^2 \: \mathrm{d} \psi\, \mathrm{d} \alpha = \pi (\Delta \psi )^3 (\Delta \alpha )/4$
and
$\int _{\mathcal{D}} \alpha ^2 \: \mathrm{d} \psi\, \mathrm{d} \alpha = \pi (\Delta \psi ) (\Delta \alpha )^3/4$
, so that the available energy becomes (using (2.14))
\begin{equation} \begin{aligned} A = & \frac {\pi ^2 \Delta \psi \Delta \alpha }{4m} \int \mathrm{d} \ell\, \mathrm{d} \mu\, \mathrm{d} v_{\|} \;\frac {f_{M,0}}{T_0} \\ &\times\Bigg [ \sqrt {(\Delta \psi )^2 (\omega _\alpha + \kappa _\alpha )^2 +(\Delta \alpha )^2 (\omega _\psi - \kappa _\psi )^2} \sqrt {(\Delta \psi )^2 (\omega _\alpha - \omega _*^T )^2 +(\Delta \alpha )^2 (\omega _\psi )^2} \\ &-(\Delta \psi )^2(\omega _\alpha + \kappa _\alpha ) (\omega _\alpha - \omega _*^T) - (\Delta \alpha )^2 (\omega _\psi - \kappa _\psi ) \omega _\psi \Bigg ],\\[-18pt] \end{aligned} \end{equation}
dropping the domain of integration
$\mathcal{V}$
from here on. As expected, the expression for the available energy is always positive definite, as may be verified by the following argument. Note that the function in square brackets in (2.21) is of the form
where
$a = \Delta \psi (\omega _\alpha + \kappa _\alpha )$
,
$b= \Delta \alpha (\omega _\psi - \kappa _\psi )$
,
$c =\Delta \psi (\omega _\alpha - \omega _*^T)$
and
$d= \Delta \alpha (\omega _\psi )$
. To prove positive definiteness, we must show
$\sqrt {(a^2 + b^2)(c^2 + d^2)} \geqslant ac + bd$
, which follows readily as squaring both sides results in
$(ad)^2 + (bc)^2 \geqslant 2 (ad) (bc)$
, simplifying to
$(ad - bc)^2 \geqslant 0$
, as required. We have now fully specified the available energy: solving the nonlinear algebraic (2.17) for each
$\ell$
gives the functions
$\kappa _\alpha (\ell )$
and
$\kappa _\psi (\ell )$
, which are required to calculate the available energy given in (2.21).
2.3. Conditions for stability
It is worthwhile to consider under what conditions the available energy vanishes (apart from the trivial case of vanishing gradients of density and temperature, or
$\boldsymbol{v}_{\boldsymbol{\nabla }}\boldsymbol{\cdot }\boldsymbol{\nabla }\psi = \boldsymbol{v}_{\boldsymbol{\nabla }}\boldsymbol{\cdot }\boldsymbol{\nabla }\alpha = 0$
), and we shall refer to this as stability. In the notation of (2.22), this occurs if and only if
$ad = bc$
, and hence,
Taking the derivative of (2.23) with respect to
$v_\|$
at fixed
$(\mu ,\ell )$
gives
(having divided out
$\partial \epsilon /\partial v_\|$
), which can only be satisfied under two conditions.
-
(i) If the temperature gradient vanishes,
$ \partial _\epsilon \omega _*^T = \mathrm{d} \ln T / \mathrm{d} \psi = 0$
according to (2.8). Note that there may still be a non-zero density gradient. -
(ii) If the magnetic field is isodynamic (see Helander Reference Helander2014) so that
$\omega _{\psi } = 0$
everywhere and consequently
$\kappa _\psi = 0$
, consistently with (2.17b
).
Let us now investigate the first condition.
2.3.1. Pure density gradient
Under the assumption of no temperature gradient, the derivative of (2.23) with respect to
$(\mu ,\ell )$
simplifies to
giving a direct relation between
$\kappa _\psi$
and
$\kappa _\alpha$
. Substituting this back into (2.23), we find
Assuming the drifts do not vanish, we thus have
It remains to be checked if the derived conditions are compatible with the constraint on the density. Substituting (2.28) into (2.15), we find that
$G=1$
, and (2.17) is indeed satisfied. Hence, if there is no ITG present, the available energy always vanishes, as may be verified by filling in the results of (2.27) into (2.21). This is in line with Helander (Reference Helander2020), who found that the available energy always vanishes in a Maxwellian plasma with no temperature gradient and a fixed, slightly varying density profile (with no invariants aside from the Casimirs). Further constraining the ground state by means of additional invariants can only lower the available energy, which then must remain zero. As we shall see in the case of an isodynamic field, simply satisfying (2.23) is not sufficient for having zero available energy, and more care is required.
2.3.2. Isodynamic magnetic field
In the case where
$\omega _\psi$
and
$\kappa _\psi$
both vanish, the available energy given in (2.21) becomes
where the ramp function is defined as
$\mathcal{R}(x) = (x + |x|)/2$
. For stability, we thus require that
$\kappa _\alpha + \omega _\alpha$
and
$\omega _*^T-\omega _\alpha$
have opposite signs for all
$(\ell ,\mu ,v_\|)$
, where it is important to remember that
$\kappa _\psi$
and
$\kappa _\alpha$
only depend on
$\ell$
while
$\omega _\alpha$
is independent of
$v_\|$
. We note that
\begin{equation} \omega _*^T - \omega _\alpha = T_0\frac {\mathrm{d} \ln n}{\mathrm{d} \psi } \left [ 1 -\frac {3}{2}\eta + \frac {m v_\|^2}{2 T_0} \eta + \frac {\mu B_0}{T_0} \left ( \eta - \eta _B \right ) \right ], \end{equation}
where we have defined
$\eta = \mathrm{d} \ln T/\mathrm{d} \ln n$
and
$\eta _B= (\partial \ln B / \partial \psi )_{\alpha ,\ell }/(\mathrm{d} \ln n / \mathrm{d} \psi )$
. If
$\eta \gt 2/3$
, the constant term in the square brackets of (2.29) is negative and we must require
$mv_\|^2\eta /2T_0\lt 0$
to keep the sign fixed (at fixed
$\mu$
and
$\ell$
), resulting in incompatible conditions. In contrast, if however
$\eta \leqslant 2/3$
, we need
$mv_\|^2\eta /2T_0 \geqslant 0$
, giving one condition for stability:
This is sufficient to maintain the same sign of (2.29) for
$\mu = 0$
and any
$v_\|$
, and we now seek conditions that ensure the sign stays fixed for all
$\mu$
. Suppose momentarily that
$\omega _*^T - \omega _\alpha$
changes sign for some
$\mu$
(so that
$\mu B_0 (\eta - \eta _B)/T_0\lt 0$
). To keep the product
$(\kappa _\alpha +\omega _\alpha )(\omega _\alpha - \omega _*^T)$
of the same sign,
$\kappa _\alpha + \omega _\alpha$
must change sign too, implying that both factors must share the same zero-line in phase space. The zero-line of the first factor is given by
$\mu B_0/T_0 = - \kappa _\alpha / T_0 \partial _\psi \ln B$
, whereas the second factor gives
Equating the two, we must have that
and we arrive at a contradiction since
$\kappa _\alpha$
is a function of the arc-length alone. Thus, if
$\mu B_0 (\eta - \eta _B)/T_0 \lt 0$
, there is non-zero available energy present.
Assuming now instead
$\mu B(\eta - \eta _B)/T_0 \geqslant 0$
, so that maintaining the sign of (2.29) requires
Since
$\eta _B = \eta _B(\ell )$
, ensuring the highest value of
$\eta _B(\ell )$
satisfies this equality is necessary for stability,
where
$\max [h(x)]$
returns the highest value the function
$h(x)$
takes over the domain. Let us investigate what this inequality implies in typical conditions, relating it to the particle drifts via (2.10). For standard density and temperature profiles that decrease as functions of minor radius, i.e.
$\partial _\psi \ln T \lt 0$
and
$\partial _\psi \ln n \lt 0$
, the inequality simplifies to
Equation (2.35) has a surprising corollary: if it is not satisfied, one can increase the magnitude of the ITG to satisfy it, and, if one is stable under the conditions derived, this would imply decreasing the available energy. This condition for stability is furthermore automatically met for a magnetic field with good curvature only, which we define as
$\partial _\psi B |_{\alpha ,\ell } = \boldsymbol{v}_{\boldsymbol{\nabla }}\boldsymbol{\cdot }\boldsymbol{\nabla }\alpha \gt 0$
everywhere.
We have now derived conditions that keep the sign of (2.29) fixed and we must now verify whether the sign of
$\kappa _\alpha + \omega _\alpha$
is always opposite to that of
$\omega _*^T - \omega _\alpha$
, so that the ramp function in (2.28) is always greater than or equal to zero. To this end, we investigate the equation for
$\kappa _\alpha$
, (2.17a
), which in the isodynamic limit reduces to
where
$\sigma (x) = x/|x|$
returns the sign of
$x$
. Under the necessary conditions for stability derived so far, we may set
where
$\sigma (\omega _*^T - \omega _\alpha )$
is a constant. Consequently, (2.36) becomes
and we have that
as required for stability.

Figure 1. Stability diagram in an isodynamic field where we have assumed
$\partial _\psi \ln B \lt 0$
(typically the case locally on the outboard mid-plane of an up-down symmetric tokamak, i.e. the bad-curvature side). The dashed line denotes a pure density gradient, which is always stable. The region between the dashed, dotted and full line satisfies
$0 \leqslant \eta \leqslant 2/3$
, but not
$\eta \geqslant \eta _B$
, and thus has non-zero available energy.
Summarising, given an isodynamic magnetic field, we have found that necessary and sufficient conditions for stability are
$0 \leqslant \eta \leqslant 2/3$
, and furthermore
$\eta \geqslant \eta _B$
.Footnote
4
A clarifying plot may be found in figure 1, where the stability boundaries are plotted as a function of the gradient for
$\partial _\psi \ln B \gt 0$
. We note close correspondence to results found by Costello & Plunk (Reference Costello and Plunk2025b
) (see also Plunk Reference Plunk2015), where one important difference pertains to the curvature drift. This is taken into account in the calculation by Costello & Plunk (Reference Costello and Plunk2025b
), but does not enter in the available energy. This is a simple consequence of the fact that all variation in
$\epsilon = \mu B + mv_\|^2/2$
at fixed
$\mu$
and
$v_\|$
is due to
$B$
, manifesting as gradient drifts.
2.3.3. Effect of the constraint on density
It is helpful to investigate what effect the assumed constancy of the density gradient has on the stability criteria found. This can be easily investigated, as setting
$\kappa _\alpha = \kappa _\psi = 0$
is equivalent to the unconstrained case, where the density profile is such that it minimises the thermal energy of the initial Maxwellian distribution function. Equation (2.23) becomes
which can only be be satisfied in isodynamic fields, disregarding the trivial case of having no gradients in density and temperature. In isodynamic fields, the available energy can be found by setting
$\kappa _\alpha = 0$
in (2.28), resulting in
To have zero available energy, the argument of the ramp function must be negative everywhere, and we thus require
\begin{equation} \frac {\omega _*^T}{\omega _\alpha } - 1 = \frac {T_0}{\eta _B \mu B_0} \left [ 1 -\frac {3}{2}\eta + \frac {m v_\|^2}{2 T_0} \eta + \frac {\mu B_0}{T_0} \left ( \eta - \eta _B \right ) \right ] \leqslant 0. \end{equation}
As already derived, for the factor in brackets to have the same sign (namely positive) everywhere, we require
$0 \leqslant \eta \leqslant 2/3$
and
$\eta _B \leqslant \eta$
. However, to ensure the argument is negative, we require
$\eta _B \leqslant 0$
, which is a more stringent condition. In terms of a device with radially decreasing density profile, for stability, we thus require an isodynamic field with
everywhere to have vanishing available energy; hence, the device has good curvature everywhere. Conversely, the bad-curvature region of an isodynamic magnetic field will always have energy available for non-zero gradients, if the density is unconstrained. Physically, this may be understood by considering a particle that is moved radially to flatten the density gradient. When the density gradient is parallel to the magnetic field strength gradient, flattening the density gradient is accomplished by moving particles from regions of high to low field strength. The kinetic energy released by moving a particle from high to low field strength at constant
$\mu$
and
$v_\|$
,
is positive, implying that this process feeds the instability. Such a process is not allowed if the density gradient is kept fixed, resulting in broader regions of stability.
2.4. Limit of steep density and temperature gradients
Having derived conditions for zero available energy, we now focus on the limiting case where the gradients in density and temperature are very large. We thus set
$\omega _*^T \rightarrow \omega _*^T/\varepsilon$
, and expand the relevant equations under the assumption that the positive expansion parameter
$\varepsilon \ll 1$
. However, it is not clear a priori what scaling
$\kappa _\alpha$
and
$\kappa _\psi$
should follow. As such, let us expand these scalars generally as
and we now solve equations with different assumptions on the expansions of
$\kappa _\psi$
and
$\kappa _\alpha$
.
2.4.1. Weak
$\kappa$
-scaling
Let us first assume a weak scaling of both
$\kappa _\psi$
and
$\kappa _\alpha$
with
$\varepsilon$
, where we set
$\kappa _{\alpha ,-1}=\kappa _{\psi ,-1}=0$
so that (2.17) is, to leading order, given as
\begin{align} \int \mathrm{d} \mu\, \mathrm{d} v_\| \; \frac {f_{M,0}}{T_0 \varepsilon } \left [ \omega _*^T + \frac {|\omega _*^T| (\Delta \psi ) (\kappa _{\alpha ,0} + \omega _{\alpha }) }{\sqrt {(\Delta \psi )^2 (\kappa _{\alpha ,0} + \omega _\alpha )^2 + (\Delta \alpha )^2 (\omega _\psi - \kappa _{\psi ,0})^2}} \right ] &\approx 0,\end{align}
\begin{align} \int \mathrm{d} \mu\, \mathrm{d} v_\| \; \frac {f_{M,0}}{T_0 \varepsilon } \frac {|\omega _*^T| (\Delta \alpha ) \left (\omega _\psi - \kappa _{\psi ,0} \right )}{\sqrt {(\Delta \psi )^2 (\kappa _{\alpha ,0} + \omega _\alpha )^2 + (\Delta \alpha )^2 (\omega _\psi - \kappa _{\psi ,0})^2}} &\approx 0.\end{align}
Similarly expanding the available energy from (2.21) gives
\begin{equation} \begin{aligned} A \approx \frac {\pi ^2 \Delta \psi \Delta \alpha }{4m \varepsilon } \int \mathrm{d} \ell\, \mathrm{d} \mu\, \mathrm{d} v_{\|} \; & \frac {f_{M,0}}{T_0} \Big [ (\Delta \psi )^2 \omega _*^T\left ( \omega _\alpha + \kappa _{\alpha ,0} \right ) \\ & +\Delta \psi |\omega _*^T| \sqrt {(\Delta \psi )^2 (\omega _\alpha + \kappa _{\alpha ,0})^2 + (\Delta \alpha )^2 (\omega _\psi - \kappa _{\psi ,0})^2} \Big ] .\\[-12pt]& \end{aligned} \end{equation}
Equations (2.46) and (2.47) can be solved in general numerically. However, we note that the current scaling is unable to describe the solution if
$0 \leqslant \eta \leqslant 2/3$
, and a stronger scaling of
$\kappa$
with
$\varepsilon$
gives the correct solution, which may be seen as follows. When
$0 \leqslant \eta \leqslant 2/3$
, the quantity
$\omega _*^T$
is of the same sign everywhere and one may set
$\omega _*^T = \sigma (\omega _*^T) |\omega _*^T|$
with
$\sigma (\omega _*^T) = \pm 1$
being constant, and (2.46a
) is given by
\begin{align} & \int \mathrm{d} \mu\, \mathrm{d} v_\| \; \frac {f_{M,0}}{T_0} \frac {|\omega _*^T| \Delta \psi (\kappa _{\alpha ,0}+ \omega _\alpha )}{\sqrt {(\Delta \psi )^2 (\kappa _{\alpha ,0}+ \omega _\alpha )^2 + (\Delta \alpha )^2 (\omega _\psi - \kappa _{\psi ,0})^2}}\nonumber \\ &\quad = -\sigma (\omega _*^T) \int \mathrm{d} \mu \,\mathrm{d} v_\|\; \frac {f_{M,0}}{T_0}|\omega _*^T| \end{align}
We see that the fraction on the left-hand side is bounded in magnitude from above by
To solve (2.48), the fraction must approach
$\pm 1$
, for which we require
$\kappa _{\alpha ,0} \rightarrow \pm \infty$
. This invalidates the weak ordering presented, and one requires a stronger scaling of
$\kappa _{\alpha }$
with
$\varepsilon$
.
2.4.2. Strong
$\kappa$
-scaling
Let us therefore take
$\kappa _{\psi ,-1} \neq 0$
and
$\kappa _{\alpha ,-1} \neq 0$
, so that both variables have leading-order dependence that scales as
$1/\varepsilon$
. Expanding (2.17b
) gives rise to
\begin{equation} \frac {\kappa _{\psi ,-1}}{\varepsilon } \int \mathrm{d} \mu\, \mathrm{d} v_{\|} \; \frac {f_{M,0}}{T_0} \frac {\Delta \psi |\omega _*^T|}{\sqrt {(\Delta \psi )^2\kappa _{\alpha ,-1}^2 + (\Delta \alpha )^2\kappa _{\psi ,-1}^2}} \approx 0, \end{equation}
and we see that the integrand is always positive definite. As such, the only way to satisfy (2.50) is by setting
$\kappa _{\psi ,-1} = 0$
, assuming that
$\kappa _{\alpha ,-1} \neq 0$
. Turning our attention to (2.17a
), its leading-order expansion is given as
which can only be satisfied if
$\omega _*^T$
is of the same sign everywhere, necessitating that the ratio of gradients obeys
$0\leqslant \eta \leqslant 2/3$
, in line with what was found in the weak
$\kappa$
-scaling.
Expanding the available energy accordingly gives
\begin{equation} \begin{aligned} A = \frac {\pi ^2 \Delta \psi \Delta \alpha }{2 m \varepsilon ^2} & \int \mathrm{d} \ell\, \mathrm{d} \mu\, \mathrm{d} v_{\|} \; \frac {f_{M,0}}{T_0} (\Delta \psi )^2 \Bigg \{ \mathcal{R} \left ( \kappa _{\alpha ,-1}\omega _*^T \right ) + \\ &\frac { \left [ \omega _*^T (\kappa _{\alpha ,0} + \omega _\alpha ) - \kappa _{\alpha ,-1} \omega _\alpha \right ] \left [ 1 + \sigma (\kappa _{\alpha ,-1} \omega _*^T) \right ]}{2 } \varepsilon + \mathcal{O}(\varepsilon ^2) \Bigg \} , \end{aligned} \end{equation}
where we note that, since
$\omega _*^T$
is of the same sign everywhere when
$0\leqslant \eta \leqslant 2/3$
,
$\kappa _{\alpha ,-1}$
must have the opposite sign, as in (2.51). The first two terms in the curly brackets of (2.52) thus vanish, and the available energy becomes of order
$\mathcal{O}(1)$
. We thus conclude that
$0 \leqslant \eta \leqslant 2/3$
makes the available energy approach a constant value in the limit of large gradients in density and temperature, and this result holds for any magnetic geometry. It is worthwhile to note that, for linear stability of the curvature-driven ITG mode, it is sufficient to have
$0 \leqslant \eta \leqslant 2/3$
(Biglari et al. Reference Biglari, Diamond and Rosenbluth1989), and this criterion thus has nonlinear significance too.
2.5. Perpendicular and parallel length scales
Having reached an understanding of the behaviour of the available energy in various limiting conditions, we proceed to discuss its possible relation to gyrokinetic turbulence, which requires one to specify the perpendicular length scales of the flux tube,
$\Delta \psi$
and
$\Delta \alpha$
(Mackenbach et al. Reference Mackenbach, Proll and Helander2022). The choice strongly affects the available energy, as the substitution
$(\Delta \psi ,\Delta \alpha ) \rightarrow C (\Delta \psi ,\Delta \alpha )$
changes the available energy as
$A \rightarrow C^4 A$
(see 2.21). As in TÆ, we take this length scale to be the correlation length, the length scale over which gradients in density and temperature are flattened (in turn liberating thermal energy). In situations where micro-turbulence is dominant, the correlation length is of the order of the gyroradius
$\rho _{\text{gyro}} = m v_T / |q|B_{0}$
, where
$q$
is the charge of the particle,
$v_T = \sqrt {2T_0/m}$
is the thermal velocity and
$B_0$
is a reference magnetic field strength, typically taken to be
$B_0 = 2\psi _a/a_{\text{minor}}^2$
with
$\psi _a$
being the toroidal flux over
$2\pi$
at the last-closed flux surface, and
$a_{\text{minor}}$
being the minor radius of the device. As in TÆ, we estimate these length scales by defining
where
$\rho$
is the typical normalised radial coordinate and
$s$
is a newly introduced binormal coordinate (reminding ourselves of the fact that
$\alpha = \theta - \iota \varphi$
). Consequently, setting
$\Delta \rho = \Delta s = \rho _{\text{gyro}}/a_{\text{minor}} = \rho _*$
implies that the correlation length is a (normalised) gyroradius, which may be related to
$\Delta \psi$
and
$\Delta \alpha$
in (2.21).
The available energy depends on a parallel length scale too, in non-isodynamic magnetic fields that have non-zero magnetic shear. This can readily be seen by investigating the gradient of
$\alpha$
,
where we have defined
$\iota _0 = \iota (\psi _0)$
and
$\iota _0'= \iota '(\psi _0)$
. Hence,
$\omega _\alpha$
(related to the gradient drift
$\boldsymbol{v}_{\boldsymbol{\nabla }}\boldsymbol{\cdot }\boldsymbol{\nabla }\alpha$
via 2.10) grows without bound as
$\varphi \to \pm \infty$
if
$\iota _0' \neq 0$
and
$\boldsymbol{v}_{\boldsymbol{\nabla }}\boldsymbol{\cdot }\boldsymbol{\nabla }\psi \neq 0$
. Consequently, the available energy given in (2.21) will depend on the considered range of
$\ell$
, which we denote as
$\Delta \ell$
, and one needs to choose an appropriate range a priori.Footnote
5
If the device is a tokamak, a natural parallel length scale is the connection length, i.e. the total length required to make one full poloidal turn,
In a stellarator, the appropriate choice of length scale is less evident, but one is helped by the fact that the magnetic shear is typically much smaller than in tokamaks. As a consequence, in stellarators, the choice is less important and we shall simply take it to be a fixed parallel length, i.e.
$\Delta \ell = \mathrm{constant}$
.
3. Numerical results
In the following results, we investigate the behaviour of the available energy divided by the thermal energy in a flux tube
$E_T= (3/2) n_0 T_0 \pi \Delta \psi \Delta \alpha \int B^{-1}\, \mathrm{d} \ell$
and
$\rho _*^2$
. (This latter factor is simply because the available energy normalised by the thermal energy scales with the correlation length squared, which we have posited to be
$\rho _*^2$
.) In total, we thus have
Equations (2.17) and (2.21) are furthermore normalised in the following manner:
\begin{equation} \!\! \begin{aligned} v_T &\equiv \sqrt {\frac {2 T_0}{m}}, & \hat {v}_\perp &\equiv \frac {v_\perp }{v_T}, & \hat {v}_\| &\equiv \frac {v_\|}{v_T}, & \hat {\omega }_*^T &\equiv \frac {\Delta \psi }{T_0} \omega _*^T, & \hat {\omega }_n &\equiv - \frac {(\Delta \psi )\partial _\psi n}{n} \\ \hat {\omega }_T &\equiv - \frac {(\Delta \psi )\partial _\psi T}{T}, &\hat {\omega }_\psi &\equiv \frac {\Delta \alpha }{\mu B} \omega _\psi , &\hat {\omega }_\alpha &\equiv \frac {\Delta \psi }{\mu B} \omega _\alpha , &\hat {\kappa }_\alpha &\equiv \frac {\Delta \psi \kappa _\alpha }{T_0}, & \hat {\kappa }_\psi &\equiv \frac {\Delta \alpha \kappa _\psi }{T_0} \end{aligned} \end{equation}
where details of these normalisations are relegated to Appendix B. Finally, the code used to calculate the available energy is freely available: https://github.com/RalfMackenbach/AE_cITG.
We note that the available energy code is fairly fast, with a typical computation taking seconds on a single CPU of a typical laptop computer, in tokamak geometry. The exact compute time can vary, with notable exceptions requiring longer compute time being calculations with
$0 \leqslant \eta \leqslant 2/3$
and calculations in magnetic geometries that are close to being isodynamic. A non-exhaustive comparison in terms of relative compute times with other methods for estimating turbulent transport levels is included here, recognising the fact that the wide variety of codes and methods obfuscates a simple analysis: different codes will likely excel in different situations. We continue nonetheless and take the following values as characteristic for the different computations. Calculating the nonlinear heat-flux in a tokamak on a laptop with CPUs using the gene code ((Jenko et al. Reference Jenko, Dorland, Kotschenreuther and Rogers2000), though we stress that gene can also run on GPUs), which is a fair comparison since the available energy is calculated on CPUs as well, requires tens of CPU-hours to get sufficient statistics (for ITG-driven turbulence with adiabatic electrons). Instead, simply calculating the linear growth rate, frequency and spectrum for a single mode on the same laptop computer with a single CPU can take tens of minutes (solving the initial-value problem, where a precision of
${\sim} 10^{-3}$
was requested). A quasi-linear estimate would require several of these modes, resulting in a compute time on the order of an hour. The reduced model tglf (Kinsey, Staebler & Waltz Reference Kinsey, Staebler and Waltz2008) speeds up such a linear calculation significantly, where it takes of the order of CPU-seconds to calculate a single mode, and tens of CPU-seconds for a spectrum of modes and estimation of the fluxes. Compared with typical ITG optimisation proxies, such as those presented by Roberg-Clark, Xanthopoulos & Plunk (Reference Roberg-Clark, Xanthopoulos and Plunk2024) and Goodman et al. (Reference Goodman, Xanthopoulos, Plunk, Smith, Nührenberg, Beidler, Henneberg, Roberg-Clark, Drevlak and Helander2024), the available energy is fairly expensive, as these methods have negligible compute (with main operations consisting of fitting a second-order polynomial or simple operations on arrays).
3.1. Parallel and phase-space structure of the available energy
Here, we first investigate the local properties of the available energy, i.e. how it depends on the local drifts at each
$\ell$
. This may be achieved by considering a vanishingly small parallel extent
$\Delta \ell$
. The available energy then becomes a function of four parameters
and we investigate its dependence here. The result is plotted in figure 2, where we have furthermore included a plot of the solutions to (2.17),
$\hat {\kappa }_\alpha$
and
$\hat {\kappa }_\psi$
.
Let us take note of two general symmetries here. First, note invariance of the available energy and the density constraint equations under
$(\kappa _\psi ,\omega _\psi ) \rightarrow -(\kappa _\psi ,\omega _\psi )$
. Thus, the available energy depends only on the magnitude of the radial drift and not its sign. In terms of figure 2, this manifests as a mirror symmetry about the
$\hat {\omega }_\psi = 0$
axis. Furthermore, the substitution
$(\omega _\alpha ,\kappa _\alpha ,\omega _*^T) \rightarrow -(\omega _\alpha ,\kappa _\alpha ,\omega _*^T)$
similarly leaves the density constraint equations and the available energy unchanged. This tells us that the available energy depends only on the relative sign of
$\omega _*^T$
and
$\omega _\alpha$
. Indeed, if one flips the sign of
$\omega _*^T$
, one finds that figure 2 is mirrored with respect to the
$\hat {\omega }_\alpha = 0$
axis.

Figure 2. Available energy
$\widehat {A}$
(with white contour lines added so different regions can be seen clearly), and the solutions to the density constraint equations
$\hat {\kappa }_\alpha$
and
$\hat {\kappa }_\psi$
, as a function of the radial (
$\hat {\omega }_{\alpha }$
) and binormal derivative (
$\hat {\omega }_\psi$
) of the magnetic field. Here,
$\hat {\omega }_T = 10$
and
$\hat {\omega }_n = 2$
. Note that since
$\hat {\omega }_T\sim - \partial _\rho \ln T$
(and similarly for
$\hat {\omega }_n$
) and furthermore,
$\omega _\alpha \sim \partial _\rho \ln B$
. Positive/negative
$\omega _\alpha$
means the magnetic field gradient is anti-/co-aligned with the density and temperature gradient.
Now, investigating the available energy in detail, it is clear that the most available energy is present for negative
$\hat {\omega }_\alpha$
, i.e. if the density and temperature gradient are anti-aligned with the magnetic field gradient as in the bad-curvature region. The good-curvature region, conversely, has only very little available energy present. It is furthermore interesting to notice that if the magnitude of the binormal drift becomes sufficiently large in the bad-curvature region, the available energy decreases. Physically, this may be interpreted as follows: if the particles are drifting too fast, they are unable to couple to and resonate with the drift-wave, resulting in low available energy. For
$\omega _\psi = 0$
, we see that there exists a ‘sweet-spot’ where the drifting particles are maximally resonant with the drift wave, freeing up the most available energy, at
$\hat {\omega }_\alpha \approx -1.3$
(though this value of course depends on the gradients in density and temperature). The dependence of the available energy on
$\hat {\omega }_\psi$
is less intricate: increasing the radial drift simply increases the total available energy.
Having investigated the dependence of the available energy at fixed
$\ell$
, we now investigate its dependence on
$\hat {v}_\|$
and
$\hat {v}_\perp$
, i.e. we investigate
$\int \mathrm{d} \psi\, \mathrm{d} \alpha\, \mathrm{d} \ell \; \epsilon (f_M - F) / E_T \rho _*^2$
for
$\Delta \ell \rightarrow 0$
, which becomes (see (B8))
\begin{equation} \begin{aligned} \widehat {\mathcal{A}}(\hat {v}_\perp , \hat {v}_\|) =& \frac {e^{ - \hat {v}_\|^2 - \hat {v}_\perp ^2} \hat {v}_\perp }{3 \sqrt {\pi }} \\ &\times \Bigg [ \sqrt { (\hat {v}_\perp ^2 \hat {\omega }_\alpha + \hat {\kappa }_\alpha )^2 + (\hat {v}_\perp ^2\hat {\omega }_\psi - \hat {\kappa }_\psi )^2} \sqrt {(\hat {v}_\perp ^2\hat {\omega }_\alpha - \hat {\omega }_*^T )^2 + (\hat {v}_\perp ^2\hat {\omega }_\psi )^2} \\ &-(\hat {v}_\perp ^2\hat {\omega }_\alpha + \hat {\kappa }_\alpha ) (\hat {v}_\perp ^2\hat {\omega }_\alpha - \hat {\omega }_*^T) - (\hat {v}_\perp ^2\hat {\omega }_\psi - \hat {\kappa }_\psi ) (\hat {v}_\perp ^2 \hat {\omega }_\psi ) \Bigg ] , \end{aligned} \end{equation}
so that
$ \widehat {A} = \int \mathrm{d} v_\perp \,\mathrm{d} v_\| \; \widehat {\mathcal{A}}(\hat {v}_\perp , \hat {v}_\|)$
. This allows us to probe the structure of the ground state, its (an)isotropic features and where it differs the most from the initial Maxwellian. A plot of the phase-space structure is given in figure 3, where
$\eta \gt 2/3$
. It is clear that the overall phase-space structure is rich, showing a region of much available energy near the origin and in a ‘bean’ at
$\hat {v}_\perp \approx 2$
. The structure is furthermore fairly isotropic in the bad-curvature region with small drifts compared with the density and temperature gradients (negative and small
$\hat {\omega }_\alpha$
, as in the top-right plot), and gains more anisotropic features in the good-curvature region (positive
$\hat {\omega }_\alpha$
). Note that there is nonetheless energy available, even in the good-curvature region. The anisotropic features partly answer how any electrostatic instability can exist in the good-curvature region, just as Ivanov et al. (Reference Ivanov, Luhadiya, Adkins and Schekochihin2025) argued that such instabilities cannot exist under certain assumptions of isotropy. The phase-space structure indicates that isotropy is broken, opening up new routes for an instability to exist.
All in all, we see that the available energy exhibits rich behaviour in terms of its dependencies on magnetic geometry and its velocity-space coordinates. The full calculation of the available energy is a weighted integral of available energies at different
$\ell$
, as
$\hat {\omega }_\alpha (\ell )$
and
$\hat {\omega }_\psi (\ell )$
describe a trajectory in the space of figure 2 (e.g. the trajectory of a zero-shear large-aspect-ratio circular tokamak would be a circle centred at the origin,
$\hat {\omega }_\alpha \sim -\cos \theta$
and
$\omega _\psi \sim \sin \theta$
with
$\theta =0$
corresponding to the outboard mid-plane). As we have shown here, regions of bad curvature will contribute the most to such a trajectory in
$(\hat {\omega }_\alpha ,\hat {\omega }_\psi )$
-space.
3.2. Comparison to nonlinear local gyrokinetics
In this section, we compare the available energy with results from local, gyrokinetic, ITG-driven turbulence simulations. A database of such simulations in ‘random’ stellarator geometries with adiabatic electrons has recently been constructed by Landreman et al. (Reference Landreman, Choi, Alves, Balaprakash, Churchill, Conlin and Roberg-Clark2025), where the results from
${\gt} 2\, {\times}\, 10^5$
simulations are stored. The magnetic geometry of the stellarators in that article are sampled in three distinct manners, which we briefly review (note that one can sample multiple flux tubes from a single geometry).
-
(i) One sampling method imposes that the stellarators are heliotron-like (i.e. the cross-section is a rotating ellipse), where the number of field periods (
$N_{\text{fp}}$
), the aspect ratio, the elongation, the axis torsion and the plasma beta are sampled randomly. Roughly,
$27\,\% / 25\,\%$
of the stellarators/flux tubes are sampled in this manner. We note that these geometries generally do not confine trapped particles. -
(ii) Another method simply samples equilibria from the quasr database (Giuliani Reference Giuliani2024), in which (approximately) quasi-symmetric geometries are stored (i.e. where
$B$
has an invariant direction on a flux surface in Boozer-coordinates, resulting in confined trapped particles). This constitutes some
$19\,\%/24\,\%$
of the stellarators/flux tubes. -
(iii) The final method samples random boundary shapes by generating its Fourier modes from probability distributions that have been fit to a dataset of known stellarator shapes. Some
$54 \,\% / 51\,\%$
of the stellarators/flux tubes are sampled in this manner.
The combined set of stellarators is diverse, and includes aspect ratios ranging from 2.9 to 10, and volume-averaged betas from 0 % to 5 %. The number of field periods,
$N_{\text{fp}}$
, varies between
$2$
and
$8$
, which results in varying magnetic-well lengths. We have expanded this database with nonlinear simulations performed in ‘random’ tokamak geometries. These simulations, like those by Landreman et al. (Reference Landreman, Choi, Alves, Balaprakash, Churchill, Conlin and Roberg-Clark2025), were performed with the gx-code (Mandell et al. Reference Mandell, Dorland, Abel, Gaur, Kim, Martin and Qian2024), assuming adiabatic electrons and accounting for an ion-temperature and density gradient. More details, such as the construction of the probability density in parameter space where tokamaks are sampled using the analytical Miller equilibrium (Miller et al. Reference Miller, Chu, Greene, Lin-Liu and Waltz1998) and a numerical convergence study, are provided in Appendix D.
Both simulation sets contain a fixed-gradient subset with
$\partial _\rho \ln T= -3.0$
and
$\partial _\rho \ln n= -0.9$
, where
$\rho = r/a_{\text{minor}}$
with
$r$
being the minor radial coordinate labelling the flux surfaces and
$a_{\text{minor}}$
is the minor radius of the device. The complement of the fixed-gradient subset has gradients that are chosen randomly, according to a sampling procedure. These two subsets are constructed so that one may systematically assess both the effect of the geometry and the effect of the gradients in density and temperature separately. To aid in the latter, some simulations are performed in the same geometry twice: once with the density and temperature gradients fixed, and once with randomly sampled values.
Finally, it should be noted that a crude argument on the basis of energy conservation relates the available energy to the energy flux (as also argued in TÆ). Consider the invariant energy in the long wavelength, electrostatic limit of gyrokinetics (Dubin et al. Reference Dubin, Krommes, Oberman and Lee1983; Brizard & Hahm Reference Brizard and Hahm2007),
where
$\delta f$
is the fluctuating part of the ion distribution function and
$\boldsymbol{v}_{\boldsymbol{E}}$
is the
$\boldsymbol{E} \times \boldsymbol{B}$
drift velocity. The available energy bounds by how much the first term of (3.5) can decrease, and it thus provides an upper bound on the kinetic ‘sloshing’ energy (the second term). Thus, one finds
$\boldsymbol{v}_{\boldsymbol{E}}^2 \sim A$
, and since the energy flux goes as
$Q \sim \epsilon (\delta f) |\boldsymbol{v}_{\boldsymbol{E}}|$
(to be made precise in § 3.2.1), we have
$Q \sim A^{3/2}$
. Results shall often be compared with this expected scaling.
3.2.1. Fixed-gradient subset
We start our analysis by focussing on the fixed-gradient subset. The result of this analysis is plotted in figure 4, where the time-averaged nonlinear radial energy flux is plotted against the available energy. The former is defined as
where the radial and binormal coordinates are defined in (2.53), and
$t_{\text{sat}}$
is a time window in which the turbulence is saturated. Furthermore,
$\delta f$
is the fluctuating part of the distribution function, the electric-field drift
$\boldsymbol{v}_{\boldsymbol{E}}$
is the
$\boldsymbol{E} \times \boldsymbol{B}/B^2$
, and
$L_\rho$
and
$L_s$
measure the perpendicular dimensions of the flux tube so that the integral over the perpendicular coordinates is averaged. Finally, the angular brackets define a flux-surface average
$\langle \ldots \rangle = \int \mathrm{d} \ell \; \ldots B^{-1}/\int \mathrm{d} \ell \; B^{-1}$
.

Figure 4. Scatter plot comparing the available energy and the nonlinear, time-averaged, radial energy flux (from nonlinear gyrokinetic simulations) for the fixed-gradient subset (i.e.
$\partial _\rho \ln T = -3.0$
and
$\partial _\rho \ln n = -0.9$
). The different outer panels correspond to different number of field-periods, and all the field-periods are plotted together in the centre plot. The black dotted line shows the expected power-law
$Q \propto \widehat {A}^{3/2}$
, and the colour of the scatter indicates whether the geometry comes from the quasr-database (blue) or not (red). Furthermore
$N_{\textrm {fp}}=0$
corresponds to the tokamak case.

Figure 5. Left: scatter plot of the available energy against the nonlinear radial energy flux for tokamaks alone, where the points are coloured according to their connection length. Right: scatter plot of the (logarithm of the) ratio
$Q/A^{3/2}$
and the connection length. Both show results for the fixed-gradient subset.
It is evident that, though there is certainly correlation if
$N_{\text{fp}}$
is small, for high
$N_{\text{fp}}$
, there is very little correlation in the bulk of the dataset, and the quasr equilibria showcase an even smaller amount of correlation (quantitative values will be provided in § 3.2.3). A likely reason for this mismatch is the dependence of the importance of parallel dynamics (which we have ignored) on the periodicity, as a typical magnetic well size scales as
$L_{\text{well}} \sim R/N_{\text{fp}}$
. Approximating the parallel wavenumber as
$k_{\|} \sim 1/L_{\text{well}} \sim N_{\text{fp}}/R$
, one violates
$k_{\|} v_{T} \ll \boldsymbol{k}_{\perp } \boldsymbol{\cdot }\boldsymbol{v}_{D}$
to an increasing degree when raising
$N_{\text{fp}}$
, invalidating a central assumption of the available energy derived. To assess the validity of this hypothesis, we furthermore include a plot of the tokamak dataset with fixed gradients (see figure 5), where the parallel length scale can readily be defined via the connection length
$L_{\text{con}} \equiv \int \mathrm{d} \theta \; B/\boldsymbol{B} \boldsymbol{\cdot }\boldsymbol{\nabla }\theta$
, the total length required to make one poloidal turn. It may be seen that the simulations with a very short connection length (and thus high
$k_\| \sim 1/L_{\text{con}}$
) deviate strongly from the predicted power law. Conversely, simulations that are characterised by long connection lengths stay closer to the predicted power law, although certainly with deviations. This corroborates the idea that the parallel dynamics, i.e. non-negligible ion motion over a connection length, affects the turbulence and violates our key assumption concerning the available energy. Using the right-most plot of figure 5, we see that the decrease in
$\log _{10}Q/\widehat {A}^{3/2}$
with decreasing logarithmic connection length is roughly linear, until
$\log _{10}( L_{\text{con}}/a_{\text{minor}}) \approx 0.7$
is approached from above, after which the heat-flux drops strongly. This gives a quantitative estimate of when parallel dynamics is non-negligible (namely at
$L_{\text{con}}/a_{\text{minor}} \approx 5$
) and for shorter connection lengths, the available energy is likely no longer of practical use (for this combination of gradients in tokamaks).

Figure 6. Distribution of
$\log _{10} \widehat {A}$
for ‘stable’ (
$Q\leqslant 0.1$
, blue) and ‘unstable’ (
$Q\gt 0.1$
, orange) simulation data. The
$y$
-axis denotes the probability density so that the total area under the blue and orange distributions evaluate to unity.

Figure 7. Scatter plot of the available energy against the nonlinear, time-averaged, radial energy flux for the varying-gradient subset. The outer panels correspond to different number of field-periods, and all the field-periods are plotted together in the centre plot. The black dotted line shows the expected power-law
$Q \propto \widehat {A}^{3/2}$
, and the colour of the scatter indicates whether the geometry comes from the quasr-database (blue) or not (red).
Figures 4 and 5 do not show the full extent of the dataset, as stable simulations are characterised by exponential decay of the heat flux, and thus depend critically on the decay rate, simulation time and initial condition, rendering the precise value of
$Q$
meaningless. To investigate whether available energy may be useful in predicting the nonlinear stability of a simulation, we plot histograms of
$\widehat {A}$
for
$Q \leqslant 0.1$
(‘stable’ cases) and
$Q\gt 0.1$
(‘unstable’ cases). The result is shown in figure 6. One sees that for all
$N_{\text{fp}}$
, except tokamaks (
$N_{\text{fp}}=0$
), sufficiently small available energy implies that the simulation is stable. This bolsters some hope for stellarator equilibrium optimisation purposes, as optimising for sufficiently low available energy will then likely imply that the device is nonlinearly stable. Upon closer scrutiny, one reason for the mismatch in tokamaks becomes apparent. As may be seen in figure 5, simulations with very short connection lengths tend to be stable and the available energy is a poor predictor in this regime. Furthermore, the shortest connection lengths
$L_{\text{con}} \sim q R$
are characterised by small major radius and thus strong curvature drive as
$\omega _\alpha \sim 1/R$
. The points with the strongest curvature drive have large available energy (as in a strongly driven limit
$A \sim \omega _\alpha$
), but are in reality stabilised by the short connection length, thus explaining the mismatch. Indeed, repeating the same analysis on the tokamak set but only allowing for data with
$3\lt R/a_{\text{minor}}\lt 4$
, this mismatch is reduced somewhat, and the stable and unstable distributions end up looking similar, making available energy at best a poor predictor of nonlinear stability in tokamaks.
A similar phenomenon seems to occur for the stable simulations with high available energy, present for
$N_{\text{fp}} = 8$
and
$N_{\text{fp}} = 9$
. These data are characterised by having a magnetic field with a high mirror ratio (leading to stronger mirror forces) and a short dominant parallel wavelength (increasing
$k_\|$
), both enhancing the parallel dynamics. The available energy strongly overestimates the turbulent transport of these points since due to the large variation in magnetic field, the
$\boldsymbol{\nabla }B$
-drifts are significantly enhanced, increasing the curvature drive. The parallel dynamics, however, seemingly stabilises turbulence resulting in the mismatch.
3.2.2. Varying-gradient subset
We next consider the data with varying gradients, excluding the fixed-gradient subset discussed in the previous section. The result is shown in figure 7. It is evident that the scatter is much smaller in this case, highlighting that available energy is able to capture the dependence of energy flux on the gradients in density and temperature. As before, the scatter for the tokamak subset is worse than the stellarators. To further assess how the gradient dependency is captured, we include a scatter of the data against these gradients. The result is shown in figure 8, where one sees expected trends: increasing the strength of the temperature gradient tends to increase the available energy and nonlinear energy flux. However, if
$\eta$
is sufficiently close to or smaller than
$2/3$
, both the nonlinear energy flux and available energy are significantly reduced. It is noteworthy that the critical
$\eta$
below which the energy flux is stable is approximately
$\eta \approx 1$
, which could be due to other instabilities (e.g. the slab branch) dominating or the Dimits-shift stabilising the turbulence. The current available energy model does not capture such effects, and instead shows a significant reduction if
$\eta \lt 2/3$
as expected from the asymptotic theory discussed in § 2.4.

Figure 8. Top row: the energy flux (left) and available energy (right) scattered against the density (
$\hat {\omega }_n$
) and temperature (
$\hat {\omega }_T$
) gradients. Bottom row: the energy flux and available energy scatter against
$\arctan (\hat {\omega }_T/\hat {\omega }_n)$
. The
$\eta =2/3$
line is added in all plots as a dashed red line, and an
$\eta =1$
line is added as a dashed grey line. Data of the varying-gradient subset.
Table 1. Various quantitative measures of correlation, for datasets of stellarators and tokamaks, split between the fixed (
$\mathfrak{F}$
) and random (
$\mathfrak{R}$
) gradient subsets. In the first column, the correlation measure and analysis type, regression (regr.) or classification (clas.), is stated. The ‘Landreman’ column has best scoring values of Landreman et al. (Reference Landreman, Choi, Alves, Balaprakash, Churchill, Conlin and Roberg-Clark2025). The ‘Stellarators’ column analyses the predictive capabilities of
$\widehat {A}$
for stellarators alone. The ‘Tokamaks’ column does the same for tokamaks alone. For the XGBoost analyses, each value is the mean score on held-out data with fivefold cross-validation.

3.2.3. Quantitative comparison
Some quantitative measures of correlation are computed as a final step allowing for direct comparison to results found by Landreman et al. (Reference Landreman, Choi, Alves, Balaprakash, Churchill, Conlin and Roberg-Clark2025), who constructed a set of scalar ‘features’ that correlate especially well with the energy flux. Three measures of correlation are investigated.
-
(i) The Spearman coefficient, which lies between
$-1$
and
$1$
, where a higher absolute value indicates tighter correlation and a perfect monotonic relationship between two variables returns a magnitude of
$1$
, see Spearman (Reference Spearman1904). For analyses involving the Spearman coefficient, whenever
$Q\lt 0.1$
, it is set to zero as the exact value of such ‘stable’ simulations is meaningless, though we note that leaving
$Q$
unchanged does not alter the results significantly. The Spearman coefficient then measures the correlation between
$\widehat {A}$
and
$Q$
(or equivalently between
$\ln \widehat {A}$
and
$\ln Q$
). -
(ii) For regression analyses, the coefficient of determination
$R^2 \in [0,1]$
is used where a higher value indicates better correlation. The regression is performed between the true value
$\ln Q$
and its predicted value
$\ln Q_p$
. To predict the energy flux, the machine learning gradient-boosted decision-tree package XGBoost is used (Chen & Guestrin Reference Chen and Guestrin2016), which attempts to find a function
$X$
that maps inputs
$\boldsymbol{I}$
to the output
$\ln Q$
, resulting in the prediction
$X(\boldsymbol{I}) = \ln Q_p$
. For the fixed-gradient subset the input has only one component, namely
$\boldsymbol{I}=\{ \widehat {A} \}$
, whereas the varying gradient subset uses
$\boldsymbol{I} = \{\widehat {A},\, \hat {\omega }_T,\, \hat {\omega }_n \}$
. -
(iii) Finally, the log-loss (also known as cross-entropy) is used for scoring classification predictions of (in)stability, where a lower value indicates more accurate predictions. The classification task attempts to predict whether a simulation is ‘stable’ (
$ Q \gt 0.1$
) or ‘unstable’ (
$Q \leqslant 0.1$
). This prediction is again performed using XGBoost, where the fixed-gradient subset uses only
$\boldsymbol{I}=\{ \widehat {A} \}$
as an input and the random-gradient subset uses
$\boldsymbol{I} = \{\widehat {A},\, \hat {\omega }_T,\, \hat {\omega }_n \}$
, resulting in the mapping
$X(\boldsymbol{I})=\text{stable/unstable}$
. Accuracy scores (
) for the classification analyses are included as well, but these can be misleading as most of the data are unstable so that simply predicting each datum to be unstable can lead to high accuracy.
Finally, the tokamak and stellarator subsets are analysed separately due to their differing behaviours. All these correlation measures are compared with their best-scoring counterpart of Landreman et al. (Reference Landreman, Choi, Alves, Balaprakash, Churchill, Conlin and Roberg-Clark2025), who found that the nonlinear energy flux correlates especially well with
where
$\boldsymbol{\kappa } = \boldsymbol{b} \boldsymbol{\cdot }\boldsymbol{\nabla }\boldsymbol{b}$
is the curvature vector and the operator
$\mathrm{mean}$
takes the average of the input array. As such, the correlation analysis with Spearman coefficient and the regression analysis is performed as mentioned, where
$f_Q$
replaces
$\widehat {A}$
. To predict stability instead, the feature
is used. The analysis for stability is then performed as mentioned, but with
$f_{\text{stab}}$
replacing
$\widehat {A}$
.
The results are presented in table 1, where four columns are presented. The first column states the correlation measure and whether it was performed on the fixed (
$\mathfrak{F}$
) or random/varying (
$\mathfrak{R}$
) gradient subset. It is furthermore stated if it is a regression (regr.) or classification (clas.) analysis. Best-scoring values for different correlation measures presented by Landreman et al. (Reference Landreman, Choi, Alves, Balaprakash, Churchill, Conlin and Roberg-Clark2025) are included in the second column, (‘Landreman’). The third column (‘Stellarators’) analyses the predictive capabilities of available energy for stellarators alone, where we stress again that the fixed gradient dataset only uses
$\widehat {A}$
to predict
$Q$
, and the varying-gradient database uses the density and temperature gradients as well to predict the energy flux. The fourth column (‘Tokamaks’) does the same for tokamaks, excluding stellarators. The correlation coefficients exhibit the behaviour discussed in previous sections: the available energy correlates relatively poorly with the energy flux in tokamaks in general. It correlates fairly well in stellarators if the gradients in density and temperature are allowed to vary, and it can furthermore make fairly accurate predictions of stability in stellarators although both effects can largely be explained by the ITG: the Spearman correlation coefficient between the ITG and nonlinear energy flux is
$0.80$
(not included in table 1), and the high correlation of the available energy is thus largely explained by its dependence on it, increasing to
$0.84$
due to its additional dependencies. Similarly, performing XGBoost regression and classification analyses on the varying-gradient subset where the only features retained are the gradients in density and temperature (also not included in table 1), gives
$R^2 \approx 0.71$
and
$\mathrm{accuracy} \approx 0.92$
, respectively. The available energy increases these values to
$0.76$
and
$0.94$
, respectively, showing that predictive capabilities increase, though only slightly. The most surprising finding is that available energy can predict stability in tokamaks fairly well too. This is likely a consequence of the anti-correlation found (with higher available energy corresponding to short connection lengths and, possibly, stability), and is thus likely strongly dependent on the probability space in which the tokamaks are sampled (e.g. sampling at constant connection length may lead to different results). We note in passing that similar implications on sampling likely exist in the stellarator database too (e.g. sampling geometries with high mirror force will likely give different outcomes).
4. Conclusions
As has been shown, the ground state associated with the curvature-driven branch of the ITG instability may be calculated by neglecting parallel dynamics (
$k_\| v_T \ll \boldsymbol{k}_{\perp } \boldsymbol{\cdot }\boldsymbol{v}_D$
, achieved by setting
$v_\|$
and
$\ell$
as invariants), where an adiabatic electron response furthermore implies that the density profile must be held fixed. The available energy in the limit of a flux tube can then be calculated analytically, and it is found that it vanishes exactly if the magnetic field is isodynamic,
$0\leqslant \eta \leqslant 2/3$
, and the amount of bad curvature is sufficiently small. Furthermore, in the limit of strong gradients of density and temperature, the available energy is relatively small in any magnetic field under the far less restrictive condition
$0\leqslant \eta \leqslant 2/3$
. The available energy then approaches a constant and thus remains finite in the limit of infinitely large gradients (at fixed ratio of gradients). It is notable that the condition
$0\leqslant \eta \leqslant 2/3$
, which guarantees linear stability of curvature-driven ITG modes, also has nonlinear significance.
Investigating the contributions to the available energy, it is found that regions of bad curvature contribute the most whereas regions of good curvature only contribute slightly. Concerning the ground state in these regions, it is found that the velocity-dependent contribution to the available energy is strongly anisotropic behaviour in regions of good curvature, in contrast to regions of bad curvature that have more isotropic structure.
The utility of the available energy presented has been assessed by means of a large database of gyrokinetic nonlinear simulations, created by supplementing an existing stellarator database (Landreman et al. Reference Landreman, Choi, Alves, Balaprakash, Churchill, Conlin and Roberg-Clark2025) by including
$6\,{\times }\,10^4$
tokamak simulations. The available energy was calculated in all magnetic geometries simulated and compared with the nonlinear energy flux as computed by gx. When the gradients in density and temperature are held fixed, the available energy and energy flux are correlated if the number of stellarator field periods (
$N_{\text{fp}}$
) is sufficiently small. Assuming that the parallel wavenumber varies like
$k_\| \sim 1/L_{\text{well}} \sim N_{\text{fp}}/R$
, it is postulated that the mismatch is a consequence of the neglect of parallel ion motion in the available energy. This hypothesis is verified for tokamaks by showing that the correlation is especially poor for geometries with a short connection length, whereas geometries with long connection lengths exhibit better correlation. When the gradients in density and temperature are chosen randomly over a physically relevant range, the correlation between available energy and energy flux is much more pronounced for the stellarators and to a lesser degree for tokamaks, highlighting that available energy captures the dependence of turbulence on these gradients quite well. Finally, the dependence on
$\eta$
is investigated, and it is observed that both the available energy and the turbulent energy flux are small when
$\eta \lt 2/3$
. The energy flux, however, shows a marked decrease already when
$\eta$
approaches unity from above, indicating different instabilities (e.g. the slab-branch of the ITG mode) or the Dimits shift may play a role.
All in all, the results show that the curvature-driven branch of the ITG can be modelled, though imperfectly, by the available energy, where the assumption
$k_\| v_T \ll \boldsymbol{k}_{\perp } \boldsymbol{\cdot }\boldsymbol{v}_D$
appears critical in determining its use as a proxy for the nonlinear energy flux. Future works may enhance the model by a better choice of the parallel and perpendicular length scales, which may be chosen by, for example, data-driven methods. Parallel dynamics could also be captured by averaging the inputs (e.g. the gradient drifts) over some parallel length scale, similar to Roberg-Clark, Plunk & Xanthopoulos (Reference Roberg-Clark, Plunk and Xanthopoulos2022). One could also allow for Gardner restacking over a small parallel range
$\Delta \ell \sim \rho _{\text{gyro}} v_T/|\boldsymbol{v}_D|$
to capture parallel dynamics. Further coupling the current ion model to trapped electrons, via quasi-neutrality, would extend both models to account for mixed ITG and trapped-electron mode driven turbulence, which shall be done in a future investigation.
Acknowledgements
The authors wish to thank J. Ball, A. Balestri, S. Coda, P. Costello, R. Ewart, A. Hoffmann, P. Ivanov, O. Krutkin, P. Mulholland, E. Paul, E. Rodríguez, W. Sengupta, G. Snoep, H. Sun and A Volčokas for insightful discussions. This publication is part of the project ‘Enabling a star on Earth with thermodynamics: A path to viable fusion power plants’ with project number 019.241EN.015 of the research programme Rubicon which is (partly) financed by the Dutch Research Council (NWO). This work was supported by a grant from the Swiss National Supercomputing Centre (CSCS) under project ID lp72 on Alps.
Editor Alex Schekochihin thanks the referees for their advice in evaluating this article.
Data availability
The database of nonlinear gyrokinetic simulations is made available via Zenodo: https://zenodo.org/records/15799186. Note that this constitutes a reduced dataset (to reduce size), where e.g. the inputs, the time-traces of the heat-flux and the time-averaged spectra of the electrostatic potential are stored as HDF5 files, and data of Landreman et al. (Reference Landreman, Choi, Alves, Balaprakash, Churchill, Conlin and Roberg-Clark2025) are included for completeness too. The full data (which includes ‘checkpoint’ files that contain all information of the simulation at a certain snapshot, and spatio-temporal information on the full distribution function) are archived and can be made available upon request. As stated in the main text, code for reproducing results presented is made accessible via https://github.com/RalfMackenbach/AE_cITG.
Declaration of interests
The authors report no conflicts of interest.
Appendix A. Uniqueness of
$\kappa _\psi$
and
$\kappa _\alpha$
Here, we show that, if one has found a pair
$(\kappa _\psi ,\kappa _\alpha )$
that solves (2.17), it is the only solution. First, let us show that the solution line
$\kappa _\psi (\kappa _\alpha )$
to (2.17b
) is unique, which may be done by showing monotonicity of the left-hand side in
$\kappa _\psi$
for any fixed
$\kappa _\alpha$
. Taking the partial derivative with respect to
$\kappa _\psi$
of the left-hand side of (2.17b
) results in
which is indeed always negative, and we have thus shown that the solution curve
$\kappa _\psi (\kappa _\alpha )$
is unique. It now remains to prove that, given
$\kappa _\psi (\kappa _\alpha )$
, (2.17a
) is monotonic in
$\kappa _\alpha$
. Taking the derivative of the left-hand side of this equation with respect to
$\kappa _\alpha$
results in the following condition for monotonicity:
Let us conveniently define the following averaging operator:
\begin{align} &\overline {\ldots } =\nonumber \\& \frac { \int \mathrm{d} \mu \,\mathrm{d} v_\| \; \ldots {f_{M,0}}/({T_0}) {(\Delta \psi )^2 (\kappa _\alpha +\omega _\alpha )^2 }/({ (\Delta \psi )^2 (\kappa _\alpha +\omega _\alpha )^2 + (\Delta \alpha )^2 (\kappa _\psi -\omega _\psi )^2}) G }{ \int \mathrm{d} \mu \,\mathrm{d} v_\| \; {f_{M,0}}/({T_0}) {(\Delta \psi )^2 (\kappa _\alpha +\omega _\alpha )^2}{ (\Delta \psi )^2 /((\kappa _\alpha +\omega _\alpha )^2 + (\Delta \alpha )^2 (\kappa _\psi -\omega _\psi )^2}) G }, \end{align}
so that (A2) may be written as
\begin{equation} \overline {\left ( \frac {\omega _\psi - \kappa _\psi }{\kappa _\alpha + \omega _\alpha } \right )^2} + \overline {\left ( \frac {\omega _\psi - \kappa _\psi }{ \kappa _\alpha + \omega _\alpha }\right ) } \kappa _\psi ' \gt 0. \end{equation}
In similar notation, the derivative of (2.17b
), given
$\kappa _\psi (\kappa _\alpha )$
, with respect to
$\kappa _\alpha$
becomes
and we thus require
\begin{equation} \overline {\left ( \frac {\omega _\psi - \kappa _\psi }{\kappa _\alpha + \omega _\alpha } \right )^2} - \overline {\left ( \frac {\omega _\psi - \kappa _\psi }{ \kappa _\alpha + \omega _\alpha }\right ) }^2 = \overline {\left [ \frac {\omega _\psi - \kappa _\psi }{\kappa _\alpha + \omega _\alpha } -\overline {\left ( \frac {\omega _\psi - \kappa _\psi }{ \kappa _\alpha + \omega _\alpha }\right ) } \right ]^2 } \gt 0, \end{equation}
which is indeed true, showing that the solution pair
$(\kappa _\psi ,\kappa _\alpha )$
is unique. This argument fails if and only if
$\omega _\psi = \kappa _\psi = 0$
, i.e. for isodynamic magnetic fields. This case is treated in detail in Appendix C, where it is shown that the solutions to the density constraint equation for
$\kappa _\alpha$
can indeed become degenerate. However, all these degenerate solutions map to the same available energy (namely
$A=0$
), and
$A$
remains a single-valued function.
Appendix B. Dimensionless equations and numerical implementation
Here, we non-dimensionalise the relevant equations, which is useful for the purpose of numerical implementation and calculating the available energy in the limiting case of no radial drifts. It will prove convenient to define
where the thermal velocity is defined as
$v_T \equiv \sqrt {2T_0/m}$
. The nonlinear function
$G$
, given in (2.15), becomes
\begin{equation} G = \sqrt {\frac {(\hat {v}_\perp ^2 \hat {\omega }_\alpha - \hat {\omega }_*^T)^2 + (\hat {v}_\perp ^2 \hat {\omega }_\psi )^2}{(\hat {v}_\perp ^2 \hat {\omega }_\alpha + \hat {\kappa }_\alpha )^2 + (\hat {v}_\perp ^2 \hat {\omega }_\psi - \hat {\kappa }_\psi )^2}}. \end{equation}
Furthermore, the Maxwellian distribution function
$f_{M,0}$
, as given in (2.7), simplifies to
\begin{equation} f_{M,0} = \frac {n_0 e^{ - \hat {v}_\|^2 - \hat {v}_\perp ^2}}{\pi ^{3/2} v_T^3}. \end{equation}
The density constraint, (2.17), can now be written as
\begin{align} \frac {1}{\sqrt {\pi }}\int _{0}^{\infty } \mathrm{d} \hat {v}_\|^2 \int _0^\infty \mathrm{d} \hat {v}_\perp ^2 \; \frac {e^{ - \hat {v}_\|^2 - \hat {v}_\perp ^2}}{\hat {v}_\|} \left ( \hat {\kappa }_\alpha + \hat {v}_\perp ^2 \hat {\omega }_\alpha \right ) G &= \hat {\omega }_n + \hat {\omega }_\alpha ,\end{align}
\begin{align} \frac {1}{\sqrt {\pi }}\int _0^{\infty } \mathrm{d} \hat {v}_\|^2 \int _0^\infty \mathrm{d} \hat {v}_\perp ^2 \; \frac {e^{ - \hat {v}_\|^2 - \hat {v}_\perp ^2}}{\hat {v}_\|} \left ( \hat {v}_\perp ^2 \hat {\omega }_\psi - \hat {\kappa }_\psi \right ) G &= \hat {\omega }_\psi . \end{align}
Similarly non-dimensionalising the available energy, given in (2.21), results in
\begin{equation} \begin{aligned} A = & \frac {\pi \Delta \psi \Delta \alpha n_0 T_0}{8} \frac {1}{\sqrt {\pi }} \int \mathrm{d} \ell\, \mathrm{d} \hat {v}_\perp ^2\, \mathrm{d} \hat {v}_{\|} \; \frac {e^{ - \hat {v}_\|^2 - \hat {v}_\perp ^2}}{B_0} \\ &\times\Bigg [ \sqrt { (\hat {v}_\perp ^2 \hat {\omega }_\alpha + \hat {\kappa }_\alpha )^2 + (\hat {v}_\perp ^2\hat {\omega }_\psi - \hat {\kappa }_\psi )^2} \sqrt {(\hat {v}_\perp ^2\hat {\omega }_\alpha - \hat {\omega }_*^T )^2 + (\hat {v}_\perp ^2\hat {\omega }_\psi )^2} \\ &-(\hat {v}_\perp ^2\hat {\omega }_\alpha + \hat {\kappa }_\alpha ) (\hat {v}_\perp ^2\hat {\omega }_\alpha - \hat {\omega }_*^T) - (\hat {v}_\perp ^2\hat {\omega }_\psi - \hat {\kappa }_\psi ) (\hat {v}_\perp ^2 \hat {\omega }_\psi ) \Bigg ] . \end{aligned} \end{equation}
Normalising the available energy to the total thermal energy in the flux tube
we find
\begin{equation} \begin{aligned} \widehat {A} = & \frac {1}{12 \int \frac {\mathrm{d} \ell }{B_0}} \int \frac {\mathrm{d} \ell }{B_0} \; \Bigg ( \frac {1}{\sqrt {\pi }} \int _0^\infty \mathrm{d} \hat {v}_\perp ^2 \int _{0}^{\infty } \mathrm{d} \hat {v}_\|^2 \; \frac { e^{ - \hat {v}_\|^2 - \hat {v}_\perp ^2}}{\hat {v}_\|} \\ &\times\Bigg [ \sqrt { (\hat {v}_\perp ^2 \hat {\omega }_\alpha + \hat {\kappa }_\alpha )^2 + (\hat {v}_\perp ^2\hat {\omega }_\psi - \hat {\kappa }_\psi )^2} \sqrt {(\hat {v}_\perp ^2\hat {\omega }_\alpha - \hat {\omega }_*^T )^2 + (\hat {v}_\perp ^2\hat {\omega }_\psi )^2} \\ &-(\hat {v}_\perp ^2\hat {\omega }_\alpha + \hat {\kappa }_\alpha ) (\hat {v}_\perp ^2\hat {\omega }_\alpha - \hat {\omega }_*^T) - (\hat {v}_\perp ^2\hat {\omega }_\psi - \hat {\kappa }_\psi ) (\hat {v}_\perp ^2 \hat {\omega }_\psi ) \Bigg ] \Bigg ), \end{aligned} \end{equation}
where we made use of the fact that the integrand is even in
$v_\|$
. If the integrand under the
$\ell$
-integral is periodic or the integral extends many times around the torus, the expression becomes equal to a flux-surface average (Helander Reference Helander2014), which we denote by angular brackets and thus arrive at the expression
\begin{equation} \begin{aligned} \widehat {A} = \frac {1}{12 \sqrt {\pi }} \Bigg \langle & \int _0^\infty \mathrm{d} \hat {v}_\perp ^2 \int _{0}^{\infty } \mathrm{d} \hat {v}_\|^2 \; \frac { e^{ - \hat {v}_\|^2 - \hat {v}_\perp ^2}}{\hat {v}_\|} \\ &\times \Bigg ( \sqrt { (\hat {v}_\perp ^2 \hat {\omega }_\alpha + \hat {\kappa }_\alpha )^2 + (\hat {v}_\perp ^2\hat {\omega }_\psi - \hat {\kappa }_\psi )^2} \sqrt {(\hat {v}_\perp ^2\hat {\omega }_\alpha - \hat {\omega }_*^T )^2 + (\hat {v}_\perp ^2\hat {\omega }_\psi )^2} \\ &-(\hat {v}_\perp ^2\hat {\omega }_\alpha + \hat {\kappa }_\alpha ) (\hat {v}_\perp ^2\hat {\omega }_\alpha - \hat {\omega }_*^T) - (\hat {v}_\perp ^2\hat {\omega }_\psi - \hat {\kappa }_\psi ) (\hat {v}_\perp ^2 \hat {\omega }_\psi ) \Bigg ) \Bigg \rangle . \end{aligned} \end{equation}
To evaluate the integrals numerically let us take note of the following transformation,
where the inverse error function is defined as the inverse of
$\mathrm{Erf}(x) = (2/\sqrt {\pi }) \int _0^x \mathrm{d} t \; e^{-t^2}$
. With this substitution, relevant integrals simplify to
\begin{equation} \iint \mathrm{d} \hat {v}_\perp ^2 \,\mathrm{d} \hat {v}_\|^2 \; \frac { e^{ - \hat {v}_\|^2 - \hat {v}_\perp ^2}}{\hat {v}_\|} f(\hat {v}_\perp ^2,\hat {v}_\|^2) = \sqrt {\pi } \iint \mathrm{d} u \,\mathrm{d} v \; f\left \{ - \ln (1-u), \left [\mathrm{Erf}^{-1}(v)\right ]^2 \right \}, \end{equation}
with the integration range
$u \in [0,1]$
and
$v \in [0,1]$
. We have found that the integral is well approximated by a fixed Gaussian quadrature scheme in
$u$
and
$v$
using
$100 {\times } 100$
nodes. Other integration schemes (e.g. Hermite–Laguerre) have been attempted too, but were found to be less robust in certain cases. An iterative fixed-point scheme for solving the density constraint (i.e. rewriting (B4) in the form
$\boldsymbol{\kappa } = \mathcal{F}(\boldsymbol{\kappa })$
and iterating as
$\boldsymbol{\kappa }_{n+1} = \mathcal{F}(\boldsymbol{\kappa }_{n})$
) was found to be the most sound method of approximating solutions, where the solver halts if the change in solution (
$\boldsymbol{\kappa }_{n+1} - \boldsymbol{\kappa }_{n}$
) is less then some prescribed amount.
Appendix C. Limiting cases: vanishing radial drifts and strong gradients of density and temperature
In this appendix, we simplify the relevant equations, and we do so in the limit of vanishing radial drift or very large gradients in density and temperature. This will allow us to verify the calculation of the available energy in these limiting scenarios, thus bolstering confidence that the numerical routines are correct.
C.1 Vanishing radial drifts
We first consider the case of vanishing radial drifts, i.e.
$\hat {\omega }_\psi = 0$
, as is the case in isodynamic magnetic fields or on specific locations in a fusion device (e.g. on the outboard and inboard midplanes of an up-down symmetric tokamak). We shall employ the non-dimensional equations denoted in Appendix B, where for ease of notation, we drop the hats, understanding that we are still referring to normalised quantities.
Constraint on the density
In the isodynamic limit, the equation for
$\kappa _\alpha$
, as given in (B4), becomes
\begin{equation} \frac {1}{\sqrt {\pi }} \int \mathrm{d} v_\perp ^2\, \mathrm{d} v_\|^2 \; \frac { e^{ - v_\|^2 - v_\perp ^2}}{v_\|} \sigma \left (v_\perp ^2 \omega _\alpha + \kappa _\alpha \right ) |\omega _n \eta | \left | \frac {1}{\eta } - \frac {3}{2} + \left ( 1 - \frac {\eta _B}{\eta } \right )v_\perp ^2 + v_\|^2 \right |= \omega _n + \omega _\alpha . \end{equation}
We first note that if a solution to this equation exists, it is unique. This follows from the fact that the left-hand side is a monotonically increasing function of
$\kappa _\alpha$
, which implies uniqueness of the solution. In order to evaluate the integral, we define
and
so that the integral can be written as
\begin{equation} \frac {1}{\sqrt {\pi }} \int \mathrm{d} v_\perp ^2 \,\mathrm{d} v_\|^2 \; \frac { e^{ - v_\|^2 - v_\perp ^2}}{v_\|} \sigma \left (v_\perp ^2 - \tilde {\kappa }_\alpha \right ) \left |v_\|^2 - v_0^2 \right | = \sigma (\omega _\alpha ) \frac {\omega _n + \omega _\alpha }{|\omega _n \eta |}. \end{equation}
We first focus on the integral over the parallel velocity,
\begin{equation} \mathcal{I}(v_0^2) \equiv \frac {1}{\sqrt {\pi }} \int _0^\infty \mathrm{d} v_\|^2\; \frac {e^{-v_\|^2}}{v_\|} \left |v_\|^2 - v_0^2 \right |, \end{equation}
which is equal to
\begin{equation} \mathcal{I} = \frac {1}{\sqrt {\pi }} \int _0^\infty \mathrm{d} v_\|^2 \; \frac {e^{-v_\|^2}}{v_\|} \left (v_\|^2 - v_0^2 \right ) = \frac {1}{2} - v_0^2. \end{equation}
if
$v_0\lt 0$
and otherwise
\begin{equation} \begin{aligned} \mathcal{I} &= \frac {1}{\sqrt {\pi }} \int _0^{v_0^2} \mathrm{d} v_\|^2 \; \frac {e^{-v_\|^2}}{v_\|} \left (v_0^2 - v_\|^2 \right ) + \frac {1}{\sqrt {\pi }} \int _{v_0^2}^{\infty } \mathrm{d} v_\|^2 \frac {e^{-v_\|^2}}{v_\|} \left (v_\|^2 - v_0^2 \right ) \\ &= \frac {1}{2} - v_0^2 - \left ( 1 - 2v_0^2 \right ) \mathrm{Erf}(v_0) + \frac {2 v_0}{\sqrt {\pi }} e^{-v_0^2}. \end{aligned} \end{equation}
where the error function is defined as
$\mathrm{Erf}(x) = (2/\sqrt {\pi }) \int _0^x e^{-t^2} \mathrm{d} t$
. The entire integral can thus be expressed as
where
$\varTheta (x)$
denotes the Heaviside function.
We now turn our attention to the remaining integral, which simplifies to
If
$\tilde {\kappa }_\alpha \lt 0$
, the left-hand side is independent of
$\tilde {\kappa }_\alpha$
, and we thus restrict our solution-space to
$\tilde {\kappa }_\alpha \in [0,\infty )$
.Footnote
6
One may split the integral into
We note that the remaining integral over perpendicular velocity may be performed analytically as well (by changing integration-variable to
$v_0^2$
), but we shall numerically solve the density constraint equation as above.
The available energy
Given a
$\kappa _\alpha$
that solves (C10), we may now calculate the available energy in the isodynamic limit, which can be expressed as
\begin{equation} \widehat {A}_{\textrm {iso}} = \frac {1}{6 \sqrt {\pi } \int \frac {\mathrm{d} \ell }{B}} \int \frac {\mathrm{d} \ell }{B} \int \mathrm{d} v_\perp ^2 \mathrm{d} v_\|^2 \; \frac { e^{ - v_\|^2 - v_\perp ^2}}{v_\|} \mathcal{R} \left [ - \omega _T \omega _\alpha (v_\perp ^2 - \tilde {\kappa }_\alpha )(v_\|^2 - v_0^2) \right ]. \end{equation}
The integral over the parallel velocity may be evaluated by considering what sign both
$-\omega _\alpha \omega _T (v_\perp ^2 - \tilde {\kappa }_\alpha )$
and
$v_0^2$
have. Let us denote this integral as
\begin{equation} \mathcal{J}(v_0^2,\varOmega ) \equiv \frac {1}{\sqrt {\pi }} \int _0^\infty \mathrm{d} v_\|^2 \; \frac {e^{-v_\|^2}}{v_\|} \mathcal{R} \left [ \varOmega (v_\|^2 - v_0^2) \right ], \end{equation}
where we have relabelled
$\varOmega = - \omega _T \omega _\alpha (v_\perp ^2 - \tilde {\kappa }_\alpha )$
. Now, if
$v_0^2 \leqslant 0$
, there is no zero crossing in
$v_\|$
in this integral, which may simply be evaluated as
\begin{equation} \begin{aligned} \mathcal{J} &= \frac {\mathcal{R} ( \varOmega )}{\sqrt {\pi }} \int _0^\infty \mathrm{d} v_\|^2 \; \frac {e^{-v_\|^2}}{v_\|} (v_\|^2 - v_0^2) \\ &= \mathcal{R} (\varOmega ) \left ( \frac {1}{2} - v_0^2 \right ). \end{aligned} \end{equation}
If
$v_0^2 \gt 0$
, however,
$v_\|$
changes sign at
$v_0$
so that the entire integral may be evaluated as
\begin{equation} \begin{aligned} \mathcal{J} &= \frac {\mathcal{R}(-\varOmega )}{\sqrt {\pi }} \int _0^{v_0^2} \mathrm{d} v_\|^2\; \frac {e^{-v_\|^2}}{v_\|} (v_0 - v_\|^2) + \frac {\mathcal{R} ( \varOmega ) }{\sqrt {\pi }} \int _{v_0^2}^\infty \mathrm{d} v_\|^2 \; \frac {e^{-v_\|^2}}{v_\|} (v_\|^2 - v_0^2) \\ &= \mathcal{R}(\varOmega ) \left ( \frac {1}{2} - v_0^2 \right ) + |\varOmega | \left [ \frac { v_0}{\sqrt {\pi }} e^{-v_0^2} - \left ( \frac {1}{2} - v_0^2 \right ) \mathrm{Erf}(v_0) \right ], \end{aligned} \end{equation}
where we have used
$\mathcal{R}(x) + \mathcal{R}(-x) = |x|$
. The entire function may now be written as
Returning to the task of evaluating the available energy, it may now succinctly be written as
where the final integral over
$v_\perp ^2$
may be done numerically.
C.2 Limit of strong gradients
Here, we simplify the equations in the limit of steep gradients in temperature and density.
Constraint on the density
Let us rewrite (2.46) in terms of the normalisations given in Appendix B, where we furthemore introduce
$\hat {\kappa }_{\alpha ,1}=\Delta \psi \kappa _{\alpha ,0}/T_0$
and
$\hat {\kappa }_{\psi ,1}=\Delta \alpha \kappa _{\psi ,0}/T_0$
. Dropping the hats for ease of notation, we have
\begin{align} \kappa _{\alpha ,0} &= - \frac {\int \mathrm{d} v_\perp ^2 \,\mathrm{d} v_\|^2 \; \frac {e^{-v_\perp ^2 -v_\|^2}}{v_\|} \left [ \omega _*^T + { |\omega _*^T| v_\perp ^2 \omega _\alpha }/\left({\sqrt {(\kappa _{\alpha ,0} + v_\perp ^2 \omega _\alpha )^2 + ( v_\perp ^2 \omega _\psi - \kappa _{\psi ,0})^2}} \right)\right ] }{\int \mathrm{d} v_\perp ^2\, \mathrm{d} v_\|^2 \; \frac {e^{-v_\perp ^2 -v_\|^2}}{v_\|} { |\omega _*^T|}/{\left(\sqrt {(\kappa _{\alpha ,0} + v_\perp ^2 \omega _\alpha )^2 + ( v_\perp ^2 \omega _\psi - \kappa _{\psi ,0})^2} \right)} },\end{align}
\begin{align} \kappa _{\psi ,0} &= \frac {\int \mathrm{d} v_\perp ^2 \mathrm{d} v_\|^2 \; \frac {e^{-v_\perp ^2 -v_\|^2}}{v_\|} { |\omega _*^T| v_\perp ^2 \omega _\psi }/{\left(\sqrt {(\kappa _{\alpha ,0} + v_\perp ^2 \omega _\alpha )^2 + ( v_\perp ^2 \omega _\psi - \kappa _{\psi ,0})^2}\right) }}{\int \mathrm{d} v_\perp ^2 \mathrm{d} v_\|^2 \; \frac {e^{-v_\perp ^2 -v_\|^2}}{v_\|} { |\omega _*^T|}/{\left(\sqrt {(\kappa _{\alpha ,0} + v_\perp ^2 \omega _\alpha )^2 + ( v_\perp ^2 \omega _\psi - \kappa _{\psi ,0})^2} \right)} }\end{align}
The integrals over parallel velocity are of the form
\begin{align} \mathcal{I}_1 = \frac {1}{\omega _T\sqrt {\pi }} \int \mathrm{d} v_\|^2 \; \frac {e^{ -v_\|^2}}{v_\|} \omega _*^T , \quad \mathcal{I}_2 = \frac {1}{|\omega _T|\sqrt {\pi }}\int \mathrm{d} v_\|^2 \; \frac {e^{-v_\|^2}}{v_\|} |\omega _*^T| , \end{align}
and can be calculated analytically, leaving the remaining integrals over
$v_\perp ^2$
to be evaluated numerically. As in (C2), we may rewrite the diamagnetic drift as
where we have defined
$v_1^2 = 3/2-1/\eta - v_\perp ^2$
. These integrals are nearly identical to (C5), and we find
so that the density constraint equations reduce to
\begin{align} &\kappa _{\alpha ,0} =\nonumber \\& - \frac {\int \mathrm{d} v_\perp ^2 \; e^{-v_\perp ^2} \left [ \sigma (\omega _T) \mathcal{I}_1(v_1^2) + { \mathcal{I}(v_1^2) v_\perp ^2 \omega _\alpha }/{\left(\sqrt {(\kappa _{\alpha ,0} + v_\perp ^2 \omega _\alpha )^2 + ( v_\perp ^2 \omega _\psi - \kappa _{\psi ,0})^2}\right)} \right ] }{\int \mathrm{d} v_\perp ^2 \; e^{-v_\perp ^2} {\mathcal{I}(v_1^2)}/{\left(\sqrt {(\kappa _{\alpha ,0} + v_\perp ^2 \omega _\alpha )^2 + ( v_\perp ^2 \omega _\psi - \kappa _{\psi ,0})^2} \right)} }, \end{align}
\begin{align} \kappa _{\psi ,0} &= \frac {\int \mathrm{d} v_\perp ^2 \; e^{-v_\perp ^2} { \mathcal{I}(v_1^2) v_\perp ^2 \omega _\psi }/{\left(\sqrt {(\kappa _{\alpha ,0} + v_\perp ^2 \omega _\alpha )^2 + ( v_\perp ^2 \omega _\psi - \kappa _{\psi ,0})^2}\right)} }{\int \mathrm{d} v_\perp ^2 \; e^{-v_\perp ^2} { \mathcal{I}(v_1^2) }/{\left(\sqrt {(\kappa _{\alpha ,0} + v_\perp ^2 \omega _\alpha )^2 + ( v_\perp ^2 \omega _\psi - \kappa _{\psi ,0})^2}\right) } }. \end{align}
The problem has thus been simplified from involving double integrals to single ones, which reduces computational costs.
The available energy
Similarly, the available energy in the strong-gradient limit, given in (2.47), may be written as
\begin{equation} \begin{aligned} \widehat {A}_{\textrm {strong}} &= \frac {1}{12 \int \frac {\mathrm{d} \ell }{B}} \int \frac {\mathrm{d} \ell }{B} \; \Bigg ( \frac {1}{\sqrt {\pi }} \int _0^\infty \mathrm{d} v_\perp ^2 \int _{0}^{\infty } \mathrm{d} v_\|^2 \; \frac { e^{ - v_\|^2 - v_\perp ^2}}{v_\|} \\ &\quad \times \Bigg [ \omega _*^T\left ( v_\perp ^2 \omega _\alpha + \kappa _{\alpha ,0} \right ) + |\omega _*^T| \sqrt {\left ( v_\perp ^2 \omega _\alpha + \kappa _{\alpha ,0} \right )^2 + \left ( v_\perp ^2 \omega _\psi - \kappa _{\psi ,0} \right )^2} \Bigg ] \Bigg ), \end{aligned} \end{equation}
and one can again evaluate the integral over the parallel velocity. The available energy becomes
\begin{equation} \begin{aligned} \widehat {A}_{\textrm {strong}} &= \frac {1}{12 \int \frac {\mathrm{d} \ell }{B}} \int \frac {\mathrm{d} \ell }{B} \; \Bigg ( \int _0^\infty \mathrm{d} v_\perp ^2 \; e^{ - v_\perp ^2} |\omega _T| \\ &\quad \times \!\Bigg [\! \sigma (\omega _T) \mathcal{I}_1(v_1^2)\!\left ( v_\perp ^2 \omega _\alpha + \kappa _{\alpha ,0} \right ) + \mathcal{I}(v_1^2) \sqrt {\left ( v_\perp ^2 \omega _\alpha + \kappa _{\alpha ,0} \right )^2 + \left ( v_\perp ^2 \omega _\psi + \kappa _{\psi ,0} \right )^2} \Bigg ] \Bigg )\!, \end{aligned} \end{equation}
thus again reducing the number of integrals by one.
Isodynamic field with strong gradients
As a final step, we evaluate the available energy in an isodynamic field with strong gradients. This is most readily done from (2.49a ), which in the case of isodynamicity becomes
\begin{align} \frac {1}{\sqrt {\pi }} \int \mathrm{d} v_\perp ^2 \,\mathrm{d} v_\|^2 \; \frac {e^{-v_\|^2 - v_\perp ^2}}{v_\|} \left [ \omega _*^T +|\omega _*^T| \sigma (\kappa _{\alpha ,0}+v_\perp ^2\omega _\alpha ) \right ] \approx 0, \end{align}
and the integral over parallel velocity similarly becomes
Defining
$\tilde {\kappa }_{\alpha ,1} = - \kappa _{\alpha ,0}/\omega _\alpha$
, where we impose
$\tilde {\kappa }_{\alpha ,1} \in [0,\infty )$
, we find
\begin{equation} -\int _0^{\tilde {\kappa }_{\alpha ,1}} \mathrm{d} v_\perp ^2 \; e^{- v_\perp ^2} \mathcal{I}(v_1^2) + \int _{\tilde {\kappa }_{\alpha ,1}}^\infty \mathrm{d} v_\perp ^2 \; e^{- v_\perp ^2} \mathcal{I}(v_1^2) \approx \frac {\omega _n \sigma (\omega _\alpha )}{|\omega _T|}, \end{equation}
which can be solved numerically and used to calculate the available energy as in (C23).
C.3 A comparison of the limits
Here, we numerically evaluate the limiting cases derived and compare them with a calculation of the full available energy. To do so, we assume a vanishingly small parallel domain (
$\Delta \ell \rightarrow 0$
), so that the integral over the parallel coordinate need not be evaluated. In such a scenario, the available energy depends on
$\widehat {A} = \widehat {A}(\hat {\omega }_n,\hat {\omega }_T,\hat {\omega }_\alpha ,\hat {\omega }_\psi )$
and we investigate its dependencies on these parameters. This may be seen in figure 9, where
$\widehat {A}$
in both limits derived and the full available energy are plotted.
It may be seen that the limits agree closely in various cases. In the limit of only radial drifts (i.e. panels a, d and g), we see that the strongly driven limit agrees closely with
$\widehat {A}$
, especially if the gradients are sufficiently large. The isodynamic available energy, however, is zero everywhere and does not depend on the radial drift. Further investigating a case where there is a pure binormal drift (panels b, e and h), we find that all agree closely, with only the strongly driven limit showing more pronounced deviations at low gradients. Finally, investigating a case where both radial and binormal drifts are present (panels c, f and i), we see that the isodynamic available energy underestimates the available energy at negative
$\hat {\omega }_T$
, which is present in the full calculation and the strongly driven limit.
As a final check, the dependence of the full available energy and its strong-gradient asymptote on the gradient strength is calculated and compared, further verifying that the code is correct. The result is shown in figure 10, where one clearly sees that the results agree in the large-gradient limit. One furthermore sees the error approach a constant value for large enough gradients, and this constant is set by the numerical resolution of the integrals.

Figure 9. A figure of the available energy, calculated without additional assumptions (panels a–c), in the limiting case of strong gradients in temperature and density (panels d–f), and in the limiting case of vanishing radial drifts (panels g–i).

Figure 10. Available energy (solid orange), its strong-gradient asymptote (dashed blue) and the relative error (dotted red) as a function of the gradient strength. For this figure,
$\hat {\omega }_\alpha =\hat {\omega }_\psi =1$
and
$\eta =2$
.
Appendix D. Details of constructing the tokamak simulation database
D.1 Construction of the probability space
To sample ‘random’ tokamaks, we opt to use a radially local equilibrium model as done by Miller et al. (Reference Miller, Chu, Greene, Lin-Liu and Waltz1998). Such a radially local equilibrium model solves the Grad–Shafranov equation given the following properties of a flux surface: its rotational transform and magnetic shear, the pressure gradient, its poloidal cross-section and the poloidal cross-section of neighbouring flux surfaces. The latter two quantities are given with the following parametrisation (Turnbull et al. Reference Turnbull, Lin-Liu, Miller, Taylor and Todd1999):
Here,
$\theta \in [-\pi ,\pi )$
is a poloidal angle parametrising the flux surfaces,
$r$
measures the minor radius,
$R_0(r)$
the centre of the flux surface,
$\kappa (r)$
the elongation,
$\delta (r)$
the triangularity and
$\zeta (r)$
the squareness. Given all these function values and their derivatives at some
$r_0$
, one can construct the flux surface at
$r_0$
and its immediate neighbours. Importantly, this parametrisation is up-down symmetric and hence does not have large intrinsic rotation (Peeters et al. Reference Peeters2011; Ball et al. Reference Ball, Parra, Barnes, Dorland, Hammett, Rodrigues and Loureiro2014). It should be noted that not all local equilibria parametrised in this way correspond to a valid global MHD equilibrium: for instance, if
$|\partial _r R_0| \gt 1$
, flux surfaces will intersect.
We continue the construction of random tokamaks by normalising all length scales to the minor radius
$a_{\text{ minor}}$
, so that
$\mathbb{A} = R_0/a_{\text{minor}}$
is the aspect ratio and
$r/a_{\text{minor}} = \rho$
is the normalised radial coordinate. The aspect ratio is sampled uniformly on the interval
$[1.1,10]$
, whereas
$\rho$
is sampled from a linear probability density function,
$P(\rho ) = 2 \rho$
for
$\rho \in [0,1]$
, resampling if
$\rho \lt 0.01$
. The radial derivative of the aspect ratio,
$\partial _\rho \mathbb{A} = \partial _r R_0$
, is informed from TCV-fits, and we sample it uniformly on the interval
$[0.0,0.2]$
.
Next, focussing on the shaping, the elongation
$\kappa (\rho )$
is uniformly sampled from the interval
$[1,3]$
, and its radial derivative
$\partial _\rho \kappa$
is sampled from a normal distribution whose mean and standard deviation are
$\kappa$
. This allows for exotic choices such as negative
$\partial _\rho \kappa$
, which may indeed occur in cases with hollow current profiles (Ball Reference Ball2016). The triangularity (
$\delta _a$
) and squareness (
$\zeta _a$
) at the edge of the device (
$\rho =1$
) are sampled from a Gaussian. Specifically,
$\delta _a$
is sampled from a normal distribution with zero mean and a standard deviation of
$0.4$
, resampling if
$|\delta _a|\gt 0.9$
. Similarly, the distribution of
$\zeta _a$
has zero mean and a standard deviation of
$0.2$
, and is resampled if
$\zeta _a \lt -0.45$
or
$\zeta _a \gt 0.9$
to avoid self-intersection of the flux surface. The triangularity and squareness at
$\rho$
are then calculated by employing the flat current-profile solution to the Grad–Shafranov equation (Ball Reference Ball2016, Ch. 3), i.e.
$\delta = \rho \delta _a$
and
$\zeta = \rho ^2 \zeta _a$
. Radial derivatives
$\partial _\rho \delta$
and
$\partial _\rho \zeta$
are sampled from a normal distribution, too, whose mean is given by
$\delta _a$
and
$2 \rho \zeta _a$
, respectively. The standard deviation of the distribution of
$\partial _\rho \delta$
and
$\partial _\rho \zeta$
are chosen to be twice their mean. If
$\delta$
and
$\partial _\rho \delta$
have opposite signs, it is resampled, and the same is done for
$\zeta$
and
$\partial _\rho \zeta$
.
Finally, we describe sampling procedures for the rotational transform, magnetic shear and pressure gradient. The safety factor
$q$
is sampled uniformly on the interval
$[1,10]$
and the magnetic shear
$s$
is sampled uniformly from the interval
$[-1,2]$
resampling if
$|s|\lt 0.05$
(this is because low-shear simulations can be difficult to resolve). The pressure gradient is given as
$\beta \partial _\rho \ln p = \beta ( \partial _\rho \ln n + \partial _\rho \ln T)$
, where the latter two gradients are kept fixed at
$\partial _\rho \ln n = -0.9$
and
$\partial _\rho \ln T = -3.0$
for the fixed-gradient subset. (Sampling procedures for the random gradient subset shall be introduced later.) Hence, we require a sampling procedure for
$\beta$
, which we sample uniformly on the interval
$[0\,\%,1\,\%]$
. This sampling procedure gives a set of parameters, but self-intersection or cross-intersection of flux surfaces may occur. We numerically check if such intersections take place (simply checking for intersections between all line-segments compromising the discretised flux surface), resampling the tokamak if an intersection is found.
For data-normalisation purposes, we also need to define a reference magnetic field
$B_{\text{ref}}$
, which is specified by giving the major radial coordinate
$R_{\text{geo}}$
where the toroidal field is equal to the reference field strength,
$B_{\text{toroidal}}(R_{\text{geo}}) = B_{\text{ref}}$
. A typical choice is to set
$R_{\text{geo}} = R_0$
, the field at the geometric centre. However, in stellarator simulations it is typical to set the reference field by dividing the total toroidal flux passing the the last closed flux surface,
$2 \pi \psi _a$
, by its poloidal cross-sectional area,
$\pi a_{\text{minor}}^2$
. Though the difference arising from these two definitions is minor, we nonetheless employ the stellarator definition of the reference-field to allow for an ‘apples-to-apples’ comparison between stellarator and tokamak datasets, noting that relevant quantities may be converted to other reference fields a posteriori. The toroidal flux over the cross-sectional area at
$\rho$
of a tokamak parametrised by (D1),Footnote
7
is given as
\begin{equation} B_{\text{ref}} = R_{\text{geo}} B_{\text{ref}} \frac {\int _{r/a_{\text{minor}} = \rho } \mathrm{d} R \; \frac {Z}{R} }{\int _{r/a_{\text{minor}} = \rho } \mathrm{d} R \; Z} \implies R_{\text{geo}} = \frac {\int _{r/a_{\text{minor}} = \rho } \mathrm{d} R \; Z}{\int _{r/a_{\text{minor}} = \rho } \mathrm{d} R \; \frac {Z}{R} }. \end{equation}
We find that the relative difference between
$R_0$
and
$R_{\textrm {geo}}$
as in (D2) is typically
${\lt} 1\,\%$
for a randomly sampled tokamak.
The git commit 0318a675 of the gx-code has been used for the simulations. Small modifications to the Miller geometry module have been made to include squareness and these may be found in the code directory of the available energy code. Code for sampling the magnetic geometries may be found there too.
D.2 Convergence analysis of fixed-gradient subset
To ensure that tokamaks residing in the constructed probability space are sufficiently accurately simulated, we draw
$8$
random tokamaks and find numerical settings that accurately resolve them all, using a standard twist-and-shift boundary condition for the parallel coordinate. To this end, we have doubled/halved numerical parameters of interest individually,Footnote
8
and verified that the time-averaged energy flux
$Q$
stays within 20 % of the lesser resolved, nominal case. We have found that a simulation time of
$t_{\text{sim}} = 2500 \; v_T\sqrt {2}/a_{\text{minor}}$
is sufficient, with numerical settings
$\texttt {ntheta}=24$
,
$\texttt {ny}=96$
,
$\texttt {nx}=193$
,
$\texttt {nhermite}=12$
,
$\texttt {nlaguerre}=4$
and
$\texttt {y0}=50.0$
(where
$\texttt {y0}$
is binormal box-size in number of gyroradii). The time-step cushion is set to
$\texttt {cfl}=0.6$
and the amount of hyper-diffusion is set to
$\texttt {D}_{\texttt{hyper}} = 0.1$
. It was verified that increasing the resolution drastically (e.g. doubling nx, and ny simultaneously) does not reduce the error significantly below 20 %, whereas compute time increases significantly, indicating that the current error level is reasonable. Finally, a small amount of collisions is present, chosen to be
$\texttt {vnewk} = \nu _{ii} a_{\text{minor}}/v_T\sqrt {2} = 0.01$
. We have verified that this low amount of collisions does not impact results, as halving vnewk changed the time-averaged energy flux by
${\lt} 20\,\%$
. With these settings, we find that on average a simulation requires one node-hour on the ‘Alps’ supercomputer of CSCS, with one node consisting of four GH200 Nvidia GPUs.

Figure 11. Histogram of maximal difference of logarithms between the nominal and more highly resolved energy fluxes. Analysis performed on the unstable dataset, defined as
$Q_{\text{nom}}\gt 0.1$
. One can see that almost all data fall below a maximal difference of one, meaning that the energy flux changes by a factor less than two. Both the fixed-gradient (blue) and random-gradient (orange) subset are included, having similar distributions. There are two data-points with whose maximal difference in logarithms
$\gt 3$
: one with value
$4.0$
and one with value
$15.1$
. A dashed black line is added denoting where the maximal difference of logarithms equals
$\log _2(1.2)$
, i.e.
$20\,\%$
error.

Figure 12. Scatter of the nominal energy flux (
$Q_{\text{nom}}$
) against the energy flux from a more highly resolved simulation (
$Q_{\text{res}}$
). The line of ‘perfect’ convergence is included as a black dashed line. All data with
$Q\leqslant 0.1$
have been taken to be stable (
$Q=0$
). The left figure has fixed gradients and the right figure has varying gradients. We furthermore note that
$2 \boldsymbol{\cdot }\texttt {ny}$
,
$2 \boldsymbol{\cdot }\texttt {nx}$
,
$2 \boldsymbol{\cdot }\texttt {nhermite}$
,
$2 \boldsymbol{\cdot }\texttt {nlaguerre}$
,
$2 \boldsymbol{\cdot }\texttt {ntheta}$
and
$2 \boldsymbol{\cdot }\texttt {t max}$
correspond to doubling the number of binormal wavenumbers, radial grid-points, the number of Hermite moments with which the distribution function is approximated, the number of Laguerre moments with which the distribution function is approximated, the number of gridpoints in the parallel direction and the simulated time. Furthermore
$2 \boldsymbol{\cdot }\texttt {jmult}$
and
$2 \boldsymbol{\cdot }\texttt {y0}$
correspond to doubling the radial box-size, and doubling the radial and binormal box size, respectively. Finally,
$1/2 \boldsymbol{\cdot }\texttt {D hyper}$
halves the hyperdiffusion and
$1/2 \boldsymbol{\cdot }\texttt {cfl}$
halves the time step. We note that far outliers are typically simulations that are marginally unstable/stable, which are then stabilised/destabilised by changing one parameter.
To assess how well these numerical settings work on a larger set of tokamak simulations, we have drawn
$100$
new random tokamaks and have doubled/halved numerical parameters on these simulations too. The data are subdivided in an ‘unstable’ and a ‘stable’ set, where (for the nominal case) the former has
$Q \gt 0.1$
and the latter has
$Q \leqslant 0.1$
. This distinction is important, as a stable simulation is characterised by exponential decay of the initial condition, and the value of
$Q$
is thus set by the initial random perturbation, the decay rate and the simulation time, making relative errors in
$Q$
meaningless. On the unstable dataset (
$N=96$
), we find that approximately 72 % (
$N=69$
) of the data are converged (i.e.
$Q$
changes by less than 20 % upon doubling/halving all relevant parameters individually). The distribution of energy fluxes in the unconverged set shows a similar distribution as the converged set, i.e. it is not the case that simulations with either large or small fluxes systematically require higher resolution. On the stable dataset (
$N=4$
), we find that
$Q$
can rise above
$0.1$
when doubling/halving relevant parameters for 50 % (
$N=2$
) of the data.
However, the current investigation focusses on the logarithm of
$Q$
and we have thus performed an error analysis on
$\log _2 Q$
. Denoting the nominal value as
$Q_{\text{nom}}$
, and all the more highly resolved values (doubling/halving numerical parameters) as
$\boldsymbol{Q}_{\text{res}}$
, a histogram of the maximal difference of logarithms is given in figure 11. We find that some 98 % of the unstable data change by a factor less then
$2$
upon doubling/halving numerical parameters of interest, and as such, we expect that most of the data are well converged for our analysis with the gradients of density and temperature held fixed. A more detailed plot is given in figure 12, where the nominal energy flux is compared with the energy flux of a more highly resolved simulation.
D.3 Random-gradient probability space and numerical convergence
To construct the dataset with varying gradients, the gradients are specified indirectly by
$-\partial _\rho \ln p$
and
$\arctan (\eta )$
, which are both sampled from a normal distribution. The former has mean
$3.9$
and standard deviation 1.0, and is resampled if
$-\partial _\rho \ln p \lt 0.5$
. The ratio of gradients is specified via an angle
$\vartheta$
, where
$\tan \vartheta = \eta$
. This angle is sampled from a normal distribution with mean
$\arctan (3.0/0.9)$
and standard deviation
$0.25$
, and is resampled if
$\vartheta \lt \arctan (1/3)$
or
$\vartheta \gt \pi /2 + 0.1$
. Given these two samples, it is decided with probabilities
$1/3$
to change only
$\eta$
, only
$-\partial _\rho \ln p$
or both, as compared with the nominal case. Finally, it is verified that the gradients
$-\partial _\rho \ln T$
and
$-\partial _\rho \ln n$
are not too close to the nominal case (circumventing redundant simulations), resampling if they are. A plot of the sampled gradients is given in figure 13. The simulations are performed in the same magnetic fields as the fixed-gradient set, so that if only
$\eta$
or
$-\partial _\rho \ln p$
is varied, it may e.g. be used to estimate their respective critical values beyond which the simulation is nonlinearly stable.

Figure 13. Sampled gradient values. The white circle in the centre are values excluded due to being too close to the nominal values.
We have kept the numerical parameters the same as in the fixed-gradient case when varying the gradients, and performed a convergence study on
$N=108$
samples. Splitting the data once more into a stable
$(Q \leqslant 0.1)$
and unstable
$(Q \gt 0.1)$
set, and investigating the change in the logarithm of the heat flux when doubling/halving numerical parameters, we find that most of the data are well converged, as may be seen in figure 11, and some 96 % of the data change by less than a factor of two when doubling/halving parameters. Further performing a similar analysis as the fixed-gradient subset on the random gradient subset gives somewhat differing results. The energy flux changes by less than 20 % when parameters are doubled or halved for 55 % (
$N=53$
) of the unstable (
$N=97$
) data. The stable data (
$N=11$
) are converged for 72 % (
$N=8$
) of the cases. All the data are furthermore displayed in figure 12.


































































