Formula reference: stability

This page is generated from the docstrings of vaft/formula/stability.py: 19 public functions. The category overview and notation come from the module docstring; every entry below is what vaft.formula.describe("stability.<name>") prints. Back to the formula reference index.

Overview

This module provides functions for calculating various stability parameters including beta limits, ballooning stability, MHD stability criteria, operational limits, and transport parameters.

SymbolMeaningUnit
β_Nnormalized beta-
β_ppoloidal beta-
β_ttoroidal beta-
q_95safety factor at 95% flux surface-
αballooning parameter-
smagnetic shear-
n_GGreenwald density limit10¹⁹ m⁻³
P_Lpower limitW
ν*effective collisionality-
v_AAlfven speedm/s
c_sion-sound speedm/s
τ_Eenergy confinement times

Functions

ballooning_alpha_from_p_B_R

ballooning_alpha_from_p_B_R(p, B, R)

Convention-sensitive.

Normalised pressure gradient of the $s$-$\alpha$ ballooning model, without $q^2$.

\[\alpha = -\frac{2\mu_0 R}{B^2}\,\frac{dp}{dR}\]
ParameterTypeUnitDescription
pfloat or np.ndarrayPa

Pressure along a radial cut.

Bfloat or np.ndarrayT

Magnetic field strength.

Rfloat or np.ndarraym

Major radius of the samples, monotonic.

ReturnsTypeUnitDescription
float or np.ndarray-

Ballooning parameter as defined above.

Convention.

Connor, Hastie and Taylor define $\alpha = -2\mu_0 R q^2\,(dp/dr)/B^2$ with $r$ the minor radius. This routine omits the $q^2$ factor and differentiates against the major radius $R$, so it returns the standard $\alpha$ divided by $q^2$; multiply by $q^2$ before reading it against the $s$-$\alpha$ diagram. Tracked in #364.

Numerical notes.

numpy.gradient along the supplied axis (second-order interior, first-order ends), sign-sensitive to the direction of R.

References.

  1. J. W. Connor, R. J. Hastie and J. B. Taylor, Phys. Rev. Lett. 40 (1978) 396, Eq. (2).
  2. J. Wesson, Tokamaks, 4th ed., Oxford University Press (2011), Sec. 6.13 (ballooning modes).

ballooning_stability_criterion

ballooning_stability_criterion(alpha, s)

Empirical fit.

Distance from the first ballooning stability boundary $\alpha_{crit} \approx 0.6\,s$.

\[\Delta = \alpha - \alpha_{crit}, \qquad \alpha_{crit} = 0.6\,s\]
ParameterTypeUnitDescription
alphafloat or np.ndarray-

Ballooning parameter in the Connor-Hastie-Taylor normalisation.

sfloat or np.ndarray-

Magnetic shear.

ReturnsTypeUnitDescription
marginfloat or np.ndarray-

$\alpha - \alpha_{crit}$; positive means unstable.

alpha_critfloat or np.ndarray-

The threshold $0.6\,s$.

Validity.

Empirical fit. A straight-line approximation of the first-stability boundary of the circular $s$-$\alpha$ diagram [1] for moderate shear ($0.3 \lesssim s \lesssim 1.5$); the true boundary bends over and closes at $\alpha \approx 1$, with second stability beyond.

Limitations.

Ignores shaping, which raises the boundary, and the second-stable region; uncited coefficient (read from the diagram).

References.

  1. J. W. Connor, R. J. Hastie and J. B. Taylor, Phys. Rev. Lett. 40 (1978) 396, Fig. 1.
  2. J. Wesson, Tokamaks, 4th ed., Oxford University Press (2011), Sec. 6.13.

beta_N_from_beta_a_B0_Ip

beta_N_from_beta_a_B0_Ip(beta, a, B0, I_p)

Convention-sensitive.

Normalised beta evaluated literally as $\beta\,a\,B_0/I_p$.

\[\beta_N = \frac{\beta\,a\,B_0}{I_p}\]
ParameterTypeUnitDescription
betafloat-

Toroidal beta as a fraction.

afloatm

Minor radius.

B0floatT

Toroidal field on axis.

I_pfloatA

Plasma current.

ReturnsTypeUnitDescription
floatm T/A

The ratio in fraction-metre-tesla per ampere.

Convention.

The community $\beta_N$ (Troyon) is quoted in %·m·T/MA, i.e. $\beta$ in percent and $I_p$ in MA, and the Troyon limit is $\beta_N \lesssim 2.8$ in those units. This function does not rescale: with the SI inputs above the result is $10^{-8}$ times the conventional number. Feed $\beta$ in percent and $I_p$ in MA to obtain it directly. Tracked in #349.

References.

  1. F. Troyon et al., Plasma Phys. Control. Fusion 26 (1984) 209.
  2. ITER Physics Expert Groups, Nucl. Fusion 39 (1999) 2175, Ch. 3, Sec. 2.1 (definition of $\beta_N$).

beta_pol_from_beta_tor

beta_pol_from_beta_tor(beta_tor, q_95)

Poloidal beta from toroidal beta, $\beta_p = \beta_t\,q_{95}^2$.

\[\beta_p = \beta_t\,q_{95}^2\]
ParameterTypeUnitDescription
beta_torfloat-

Toroidal beta.

q_95float-

Safety factor at the 95% flux surface.

ReturnsTypeUnitDescription
float-

Poloidal beta.

Assumptions.

Circular, large-aspect-ratio cylinder in which $B_p/B_t = \varepsilon/q$.

Limitations.

The cylindrical relation is $\beta_p = \beta_t\,(q/\varepsilon)^2$; the $1/\varepsilon^2$ is missing here, so the result equals the standard value only at $\varepsilon = 1$ and underestimates $\beta_p$ by $\varepsilon^2$ otherwise. Tracked in #363.

References.

  1. J. Wesson, Tokamaks, 4th ed., Oxford University Press (2011), Sec. 3.5 (relation between $\beta$, $\beta_p$ and $q$).

beta_stability_boundary

beta_stability_boundary(beta_N, q_95)

Empirical fit.

Heuristic beta margin against $\beta_{N,crit} = 0.028\,q_{95}$.

\[\Delta = \beta_N - \beta_{N,crit}, \qquad \beta_{N,crit} = 0.028\,q_{95}\]
ParameterTypeUnitDescription
beta_Nfloat-

Normalised beta as a fraction (Troyon’s 2.8 % is 0.028).

q_95float-

Safety factor at the 95% flux surface.

ReturnsTypeUnitDescription
marginfloat-

$\beta_N - \beta_{N,crit}$; positive means the limit is exceeded.

beta_N_critfloat-

The threshold $0.028\,q_{95}$.

Validity.

Empirical fit. The fraction-convention twin of kink_stability_criterion (2.8 versus 0.028); the Troyon coefficient [1] is the only sourced part, the $q_{95}$ factor is not. plasma_stability_margins builds on this function, so it lives in the fraction convention. Tracked in #350.

References.

  1. F. Troyon et al., Plasma Phys. Control. Fusion 26 (1984) 209.

beta_tor_from_beta_pol

beta_tor_from_beta_pol(beta_pol, q_95)

Toroidal beta from poloidal beta, $\beta_t = \beta_p/q_{95}^2$.

\[\beta_t = \frac{\beta_p}{q_{95}^2}\]
ParameterTypeUnitDescription
beta_polfloat-

Poloidal beta.

q_95float-

Safety factor at the 95% flux surface.

ReturnsTypeUnitDescription
float-

Toroidal beta.

Assumptions.

Circular, large-aspect-ratio cylinder; inverse of beta_pol_from_beta_tor.

Limitations.

Missing $\varepsilon^2$ factor of the cylindrical relation $\beta_t = \beta_p\,\varepsilon^2/q^2$, as for beta_pol_from_beta_tor. Tracked in #363.

References.

  1. J. Wesson, Tokamaks, 4th ed., Oxford University Press (2011), Sec. 3.5.

c_s_from_Te_Ti_mi

c_s_from_Te_Ti_mi(T_e_keV, T_i_keV, m_i=1.67262192e-27)

Convention-sensitive.

Isothermal ion sound speed $c_s = \sqrt{(T_e + T_i)/m_i}$.

\[c_s = \sqrt{\frac{\gamma_eT_e + \gamma_iT_i}{m_i}}, \qquad \gamma_e = \gamma_i = 1\]
ParameterTypeUnitDescription
T_e_keVfloatkeV

Electron temperature.

T_i_keVfloatkeV

Ion temperature.

m_ifloat, optionalkg

Ion mass; default the proton mass.

ReturnsTypeUnitDescription
floatm/s

Ion sound speed.

Convention.

Isothermal closure ($\gamma = 1$ for both species); the adiabatic $\gamma_i = 3$ used for ion acoustic waves gives a speed larger by up to $\sqrt{(T_e + 3T_i)/(T_e + T_i)}$.

References.

  1. J. P. Freidberg, Plasma Physics and Fusion Energy, Cambridge University Press (2007), Sec. 10.4 (sound waves).
  2. NRL Plasma Formulary (2019), p. 29.

collisionality_from_n_T_B_R

collisionality_from_n_T_B_R(n_e, T_e_keV, B_t, R0)

Convention-sensitive.

Electron collisionality figure $6.921\times10^{-18}\,n_e R_0/(T_e^2 B_t)$.

\[\nu_* = 6.921\times10^{-18}\,\frac{n_e\,R_0}{T_e^2\,B_t}\]
ParameterTypeUnitDescription
n_efloat1e19 m^-3

Electron density.

T_e_keVfloatkeV

Electron temperature.

B_tfloatT

Toroidal field.

R0floatm

Major radius.

ReturnsTypeUnitDescription
float-

Collisionality figure in this function’s own normalisation.

Convention.

The prefactor is Sauter’s $\nu_{e} = 6.921\times10^{-18}\,qR\,n_e Z_{\mathrm{eff}}\ln\Lambda/(T_e^2\varepsilon^{3/2})$ with $n_e$ in m^-3 and $T_e$ in eV [1]. This routine drops $q$, $\varepsilon^{-3/2}$, $Z_{\mathrm{eff}}$ and $\ln\Lambda$, divides by $B_t$ instead, and takes $n_e$ in $10^{19}$ m^-3 and $T_e$ in keV, so it is not Sauter’s $\nu_$ nor the IPB98 database $\nu_*$ it was labelled with, and it is not comparable to vaft.formula.equilibrium.nu_star_from_n_T_B_R_epsilon_kappa_I. Tracked in #353.

Limitations.

Use only for relative trends within one dataset.

References.

  1. O. Sauter, C. Angioni and Y. R. Lin-Liu, Phys. Plasmas 6 (1999) 2834, Eq. (18b).

empirical_li_qa

empirical_li_qa()

Empirical fit.

Surveyed $(q_a, l_i)$ operating points from the JET disruption study.

Eighteen $(q_a, l_i)$ pairs read from the JET operational diagram: at each integer $q_a$ from 2 to 10, the upper and lower $l_i$ of the observed operating band.

ReturnsTypeUnitDescription
qanp.ndarray-

Edge safety factor of each point.

linp.ndarray-

Internal inductance of each point.

Physical interpretation.

Low $q_a$ goes with high $l_i$ (a peaked current profile); above $q_a \approx 6$ the lower branch saturates near $l_i \approx 0.3$ (flat profile). The band bounds the region where JET discharges avoided disruptions in the $q_a$-$l_i$ plane.

Validity.

Empirical fit. Digitised from the JET survey of Wesson et al. [1] (ohmic and early NBI discharges, circular-to-D-shaped, 1985-1988); the values are approximate readings of a published figure, not tabulated data.

Limitations.

JET-specific operating experience; a spherical tokamak reaches lower $q_a$ and different $l_i$ ranges, so use only as a qualitative boundary.

References.

  1. J. A. Wesson et al., “Disruptions in JET”, Nucl. Fusion 29 (1989) 641, Fig. 5 ($l_i$-$q_a$ diagram).

greenwald_density

greenwald_density(I_p, a)

Empirical fit. Convention-sensitive.

Greenwald density limit $n_G$.

\[n_G\,[10^{20}\,\mathrm{m^{-3}}] = \frac{I_p\,[\mathrm{MA}]}{\pi a^2\,[\mathrm{m^2}]}\]

returned as $10\,I_p/(\pi a^2)$ in units of $10^{19}\,\mathrm{m^{-3}}$.

ParameterTypeUnitDescription
I_pfloatMA

Plasma current.

afloatm

Minor radius.

ReturnsTypeUnitDescription
float1e19 m^-3

Greenwald density limit.

Convention.

Engineering units (MA, m) with the result in $10^{19}\,\mathrm{m^{-3}}$; the literature quotes $n_G$ in $10^{20}\,\mathrm{m^{-3}}$. Pair with the line-averaged electron density when forming $f_G$ (greenwald_fraction).

Physical interpretation.

Operational density limit above which discharges typically disrupt through edge cooling and MARFE formation; not a hard MHD boundary.

Validity.

Empirical fit. Multi-machine ohmic and auxiliary-heated database, Greenwald et al. 1988 [1]; reviewed with H-mode data in [2]. Peaked profiles can exceed $f_G = 1$.

Limitations.

No dependence on shaping, heating power or fuelling; spherical tokamaks routinely exceed it.

References.

  1. M. Greenwald et al., Nucl. Fusion 28 (1988) 2199, Eq. (1).
  2. M. Greenwald, Plasma Phys. Control. Fusion 44 (2002) R27, Sec. 2.

greenwald_fraction

greenwald_fraction(n_e, n_G)

Convention-sensitive.

Greenwald fraction $f_G = n_e/n_G$.

\[f_G = \frac{\bar n_e}{n_G}\]
ParameterTypeUnitDescription
n_efloat1e19 m^-3

Line-averaged electron density.

n_Gfloat1e19 m^-3

Greenwald density limit in the same unit.

ReturnsTypeUnitDescription
float-

Greenwald fraction.

Convention.

Both inputs in one unit and with the line-averaged density, the definition used in the Greenwald database; a volume average gives a systematically lower fraction.

References.

  1. M. Greenwald, Plasma Phys. Control. Fusion 44 (2002) R27, Sec. 2.

kink_stability_criterion

kink_stability_criterion(q_95, beta_N)

Empirical fit.

Heuristic kink margin against $\beta_{N,crit} = 2.8\,q_{95}$.

\[\Delta = \beta_N - \beta_{N,crit}, \qquad \beta_{N,crit} = 2.8\,q_{95}\]
ParameterTypeUnitDescription
q_95float-

Safety factor at the 95% flux surface.

beta_Nfloat-

Normalised beta in %·m·T/MA.

ReturnsTypeUnitDescription
marginfloat-

$\beta_N - \beta_{N,crit}$; positive means the limit is exceeded.

beta_N_critfloat-

The threshold $2.8\,q_{95}$.

Validity.

Empirical fit. The coefficient 2.8 is the Troyon limit $\beta_N \le 2.8$ [1]; the multiplication by $q_{95}$ has no source in the literature or the VAFT history and makes the limit rise with $q_{95}$, opposite to the observed trend. beta_stability_boundary uses the same form with 0.028, i.e. the fraction rather than percent convention of $\beta_N$. Tracked in #350.

Limitations.

Not a stability calculation; use DCON or a Troyon-type $\beta_N \le C\,l_i$ estimate for a physical limit.

References.

  1. F. Troyon et al., Plasma Phys. Control. Fusion 26 (1984) 209.

li_from_qa_empirical

li_from_qa_empirical(qa)

Empirical fit.

Internal inductance at a given $q_a$ by interpolating the JET survey points.

\[l_i(q_a) = \mathrm{interp}\big(q_a;\ q_a^{(k)}, l_i^{(k)}\big)\]
ParameterTypeUnitDescription
qanp.ndarray-

Edge safety factor values.

ReturnsTypeUnitDescription
np.ndarray-

Interpolated internal inductance.

Validity.

Empirical fit. Piecewise-linear interpolation through the eighteen empirical_li_qa points from Wesson et al. [1]; a sanity check for when only $q_a$ is known.

Limitations.

The survey lists two $l_i$ per integer $q_a$ (upper and lower band edge), so numpy.interp over the duplicated abscissae returns a value that depends on the point ordering; outside $2 \le q_a \le 10$ the end values are held constant (no extrapolation).

References.

  1. J. A. Wesson et al., Nucl. Fusion 29 (1989) 641, Fig. 5.

plasma_stability_margins

plasma_stability_margins(beta_N, q_95, n_e, n_G)

Convention-sensitive.

Beta, $q_{95}$ and density margins in one call.

\[\Delta_\beta = \beta_N - 0.028\,q_{95}, \qquad \Delta_q = q_{95} - 2, \qquad f_G = \frac{n_e}{n_G}\]
ParameterTypeUnitDescription
beta_Nfloat-

Normalised beta as a fraction.

q_95float-

Safety factor at the 95% flux surface.

n_efloat1e19 m^-3

Line-averaged electron density.

n_Gfloat1e19 m^-3

Greenwald density limit.

ReturnsTypeUnitDescription
beta_marginfloat-

From beta_stability_boundary; positive exceeds the limit.

q_marginfloat-

$q_{95} - 2$; negative is below the $q_{95} = 2$ disruption boundary.

density_marginfloat-

Greenwald fraction, from greenwald_fraction; 1 is the limit.

Convention.

The three margins use three different sign conventions: beta and $q$ are differences (sign tells the side of the boundary) while density is a ratio. $q_{95} = 2$ is the empirical operational boundary [1].

References.

  1. J. A. Wesson et al., Nucl. Fusion 29 (1989) 641.
  2. M. Greenwald, Plasma Phys. Control. Fusion 44 (2002) R27.

power_limit_from_beta

power_limit_from_beta(beta_N, B0, V)

Energy-like figure $\beta_N B_0^2 V/(2\mu_0)$ labelled a power limit.

\[P = \beta_N\,\frac{B_0^2}{2\mu_0}\,V\]
ParameterTypeUnitDescription
beta_Nfloat-

Normalised beta, any convention.

B0floatT

Toroidal field on axis.

Vfloatm^3

Plasma volume.

ReturnsTypeUnitDescription
floatJ

The expression above, dimensionally an energy.

Limitations.

$\beta B_0^2V/2\mu_0$ is the stored energy at beta $\beta$ (vaft.formula.equilibrium.stored_energy_from_beta_V), not a power; no time scale enters, and no source records what limit was intended. Kept for compatibility. Tracked in #362.

References.

  1. F. Troyon et al., Plasma Phys. Control. Fusion 26 (1984) 209 (the $\beta_N$ limit the expression appears to draw on).

power_limit_from_q

power_limit_from_q(q_95, I_p, R0)

Expression $2\pi R_0 I_p/(\mu_0 q_{95})$ labelled a power limit.

\[P = \frac{2\pi R_0\,I_p}{\mu_0\,q_{95}}\]
ParameterTypeUnitDescription
q_95float-

Safety factor at the 95% flux surface.

I_pfloatA

Plasma current.

R0floatm

Major radius.

ReturnsTypeUnitDescription
floatA^2

The expression above.

Limitations.

Dimensionally $I_p R/\mu_0 q$ is A$^2$ (current times $R/L$), not a power; no derivation or source is recorded. Kept for compatibility. Tracked in #362.

References.

  1. J. Wesson, Tokamaks, 4th ed., Oxford University Press (2011), Sec. 3.4 (cylindrical $q$, the relation this seems to rearrange).

rhostar_from_Te_a_Bt

rhostar_from_Te_a_Bt(Te_eV, a_minor, B_t, m_e=9.10938356e-31)

Convention-sensitive.

Electron gyroradius figure $\sqrt{T_e}\,a/B_t$ (as implemented).

\[\rho_*^{\mathrm{(impl)}} = \frac{\sqrt{T_e}}{B_t}\,a\]
ParameterTypeUnitDescription
Te_eVfloateV

Electron temperature.

a_minorfloatm

Minor radius.

B_tfloatT

Toroidal field.

m_efloat, optionalkg

Electron mass, accepted but unused; default ME.

ReturnsTypeUnitDescription
floateV^1/2 m/T

The expression above.

Convention.

Intended as the normalised electron gyroradius $\rho_e/a$ with $\rho_e = \sqrt{2m_eT_e}/(eB)$, which divides by $a$ and carries the constant $\sqrt{2m_e/e} = 3.37\times10^{-6}$ m T eV$^{-1/2}$. The implementation multiplies by $a$ and omits the constant, so it is neither dimensionless nor proportional to $\rho_*$ across devices. Tracked in #348; use vaft.formula.equilibrium.normalized_larmor_radius_from_M_T_a_Bt with M=ME.

References.

  1. ITER Physics Expert Groups, Nucl. Fusion 39 (1999) 2175, Ch. 2, Sec. 6 (dimensionless parameters).

sawtooth_stability_criterion

sawtooth_stability_criterion(q_0, beta_pol)

Empirical fit.

Heuristic sawtooth margin against $\beta_{p,crit} = 0.3\,(1 - q_0)$.

\[\Delta = \beta_p - \beta_{p,crit}, \qquad \beta_{p,crit} = 0.3\,(1 - q_0)\]
ParameterTypeUnitDescription
q_0float-

Safety factor on axis.

beta_polfloat-

Poloidal beta.

ReturnsTypeUnitDescription
marginfloat-

$\beta_p - \beta_{p,crit}$; positive means the threshold is exceeded.

beta_pol_critfloat-

The threshold.

Validity.

Empirical fit. Modelled on the Porcelli trigger, in which the internal-kink threshold scales with the poloidal beta inside the $q=1$ surface and a critical value of order 0.3 [1]; the linear $(1 - q_0)$ dependence and the coefficient are VAFT heuristics without a recorded source.

Limitations.

Uses the global $\beta_p$, not $\beta_{p,1}$ inside $q=1$; returns a negative threshold for $q_0 > 1$, where sawteeth do not occur. Tracked in #350.

References.

  1. F. Porcelli, D. Boucher and M. N. Rosenbluth, Plasma Phys. Control. Fusion 38 (1996) 2163, Sec. 3.

v_alfven_from_B_n_mi

v_alfven_from_B_n_mi(B, n, m_i=1.67262192e-27)

Alfven speed $v_A = B/\sqrt{\mu_0 n m_i}$.

\[v_A = \frac{B}{\sqrt{\mu_0\,n\,m_i}}\]
ParameterTypeUnitDescription
BfloatT

Magnetic field strength.

nfloatm^-3

Ion number density.

m_ifloat, optionalkg

Ion mass; default the proton mass.

ReturnsTypeUnitDescription
floatm/s

Alfven speed.

Assumptions.

Single ion species, $n_i = n$; the mass density is $n m_i$ (electron mass neglected).

References.

  1. J. P. Freidberg, Plasma Physics and Fusion Energy, Cambridge University Press (2007), Sec. 10.5 (Alfven waves).
  2. NRL Plasma Formulary (2019), p. 29.

Refreshing this snapshot

From a checkout of the develop branch, run:

python -m vaft.formula.catalog --output /path/to/vaft-gh/_data/formula_catalog.yml

The snapshot records the SHA-256 of every vaft/formula/*.py source file; documentation validation compares them when VAFT_REGISTRY_SOURCE points to the corresponding source checkout. The same text is available offline as vaft.formula.describe("<name>"), vaft.formula.search("<text>") and vaft.formula.list_formulas(category="<category>").

results matching ""

    No results matching ""