API: vaft.formula
Generated from each module's __all__ by python -m vaft._api_catalog:
551 published objects in 33 modules.
Signatures and summaries are read from the source; nothing here is written by hand.
All API pages
No object matches.
vaft.formula
Formula namespace for physics helpers.
AMU
data
AMU = 1.6605390666e-27
BASE_DIMENSIONS
data
BASE_DIMENSIONS = ('L', 'M', 'T', 'I')
C_B
data
C_B = np.float64(4.230421226622645e-29)
C_LIGHT
data
C_LIGHT = 299792458.0
COLLISIONALITY_COEF
data
COLLISIONALITY_COEF = 6.921e-18
E_ALPHA
data
E_ALPHA = 5.607618219e-13
EPS0
data
EPS0 = 8.8541878128e-12
GREEN_EXACT_MODES
data
GREEN_EXACT_MODES = ('psi', 'dpsi_dr', 'dpsi_dz', 'd2psi_drdz', 'd2psi_dr2', 'K', 'E')
H_PLANCK
data
H_PLANCK = 6.62607015e-34
K_B_COEF
data
K_B_COEF = 0.052
K_BOLTZMANN
data
K_BOLTZMANN = 1.380649e-23
LLOYD_FIGURE_OF_MERIT_ECH_V_PER_M
data
LLOYD_FIGURE_OF_MERIT_ECH_V_PER_M = 100.0
LLOYD_FIGURE_OF_MERIT_OHMIC_V_PER_M
data
LLOYD_FIGURE_OF_MERIT_OHMIC_V_PER_M = 1000.0
ME
data
ME = 9.10938356e-31
MI_P
data
MI_P = 1.67262192e-27
MU0
data
MU0 = 1.2566370614359173e-06
PA_PER_TORR
data
PA_PER_TORR = 133.32236842105263
PHYSICAL_DIMENSIONS
data
PHYSICAL_DIMENSIONS = <builtins.mappingproxy>
QE
data
QE = 1.602176634e-19
SIGMA_V_COEF
data
SIGMA_V_COEF = 1.1e-24
SPITZER_RESISTIVITY_COEF
data
SPITZER_RESISTIVITY_COEF = 5.2e-05
VIRIAL_SINGULAR_EPS
data
VIRIAL_SINGULAR_EPS = 1e-09
vaft.formula.atomic
Atomic equilibrium and line-radiation formulae backed by OPEN-ADAS ADF11.
coronal_relaxation_time — Slowest relaxation time of the ionisation balance towards coronal equilibrium. Reference source
Also exported as vaft.formula.coronal_relaxation_time.
fractional_abundances — Ionisation-equilibrium (coronal) fractional abundances from ACD and SCD tables. Reference source
Also exported as vaft.formula.fractional_abundances.
hydrogenic_energy_level — Bohr energy of level $n$ of a one-electron ion, with the reduced-mass correction. Reference source
Also exported as vaft.formula.hydrogenic_energy_level.
hydrogenic_transition_wavelength — Vacuum wavelength of the $n_u \to n_l$ line of a one-electron ion (Rydberg formula). Reference source
Also exported as vaft.formula.hydrogenic_transition_wavelength.
impurity_fraction_from_effective_charge — Impurity-to-electron density ratio that produces a given effective charge. Reference source
Also exported as vaft.formula.impurity_fraction_from_effective_charge.
interpolate_adf11 — Interpolate every charge-state block of an ADF11 table at given $(n_e, T_e)$. Reference source
Also exported as vaft.formula.interpolate_adf11.
line_cooling_coefficient — Equilibrium line-radiation cooling coefficient $L_{line}(n_e, T_e)$ of a species. Reference source
Also exported as vaft.formula.line_cooling_coefficient.
mean_charge_from_charge_state_densities — Mean charge of one element over its charge states. Reference source
Also exported as vaft.formula.mean_charge_from_charge_state_densities.
mean_square_charge_from_charge_state_densities — Mean square charge of one element over its charge states. Reference source
Also exported as vaft.formula.mean_square_charge_from_charge_state_densities.
vaft.formula.boundaries
Operational boundaries from the literature: one data model for density, transition and stability limits.
Applicability
class
source
Applicability(machine_class: str = '', ranges: Mapping[str, tuple] = <factory>, assumptions: tuple = (), evidence_ranges: Mapping[str, tuple] = <factory>) -> None
The domain a boundary was established on.
Also exported as vaft.formula.Applicability.
4 fields
machine_class: strranges: Mapping[str, tuple]assumptions: tupleevidence_ranges: Mapping[str, tuple]
Boundary
class
source
Boundary(key: str, family: str, target: BoundaryQuantity, inputs: tuple, form: str, allowed_side: str, sources: tuple, coefficient: Optional[float] = None, exponents: Mapping[str, float] = <factory>, function: Optional[Callable] = None, hardness: str = 'soft', origin: str = 'published', basis: str = 'empirical', event: str = '', regime: str = '', applicability: Applicability = <factory>, uncertainty: Uncertainty = <factory>, notes: str = '', source_regime: str = '', target_regime: str = '', branch: str = '', kind: str = 'limit') -> None
One published or derived operational boundary.
Also exported as vaft.formula.Boundary.
22 fields · 2 members
key: strfamily: strtarget: BoundaryQuantityinputs: tupleform: strallowed_side: strsources: tuplecoefficient: Optional[float]exponents: Mapping[str, float]function: Optional[Callable]hardness: strorigin: strbasis: strevent: strregime: strapplicability: Applicabilityuncertainty: Uncertaintynotes: strsource_regime: strtarget_regime: strbranch: strkind: strinput_namesproperty sourceinputmethod source
boundary_curve — A boundary sampled along one input, as $(x, y) = (x_\mathrm{sweep}, b)$ arrays. Reference source
Also exported as vaft.formula.boundary_curve.
boundary_value — Value of a boundary’s target quantity at the given inputs. Reference source
Also exported as vaft.formula.boundary_value.
BoundaryCurve
class
source
BoundaryCurve(key: str, x: np.ndarray, y: np.ndarray, x_quantity: BoundaryQuantity, y_quantity: BoundaryQuantity, allowed_side: str, fixed: Mapping[str, float] = <factory>) -> None
A boundary sampled on a 2-D projection, ready to overlay.
Also exported as vaft.formula.BoundaryCurve.
7 fields · 1 members
key: strx: np.ndarrayy: np.ndarrayx_quantity: BoundaryQuantityy_quantity: BoundaryQuantityallowed_side: strfixed: Mapping[str, float]xyproperty —(N, 2)array of[x, y]: thevaft.diagramChart.curveslayout. source
BoundaryEvaluation
class
source
BoundaryEvaluation(key: str, target: BoundaryQuantity, boundary_value: object, operating_value: object, ratio: object, difference: object, margin: object, allowed: object, allowed_side: str, extrapolated: tuple, warnings: tuple) -> None
How one operating state compares with one boundary.
Also exported as vaft.formula.BoundaryEvaluation.
11 fields · 1 members
key: strtarget: BoundaryQuantityboundary_value: objectoperating_value: objectratio: objectdifference: objectmargin: objectallowed: objectallowed_side: strextrapolated: tuplewarnings: tuplein_domainproperty — True when no input lies outside the source’s stated ranges. source
BoundaryPropagation
class
source
BoundaryPropagation(key: str, boundary: object, margin: object, source: 'Uncertainty', source_parameters_relative: Optional[float], source_scatter_relative: Optional[float], margin_std_from_source_parameters: Optional[float], margin_std_from_source_scatter: Optional[float], source_note: str, source_parameters_complete: bool = False, extrapolated: tuple = (), warnings: tuple = ()) -> None
Measured-input uncertainty of a boundary value and of a state’s margin, beside the source’s own.
Also exported as vaft.formula.BoundaryPropagation.
12 fields
key: strboundary: objectmargin: objectsource: 'Uncertainty'source_parameters_relative: Optional[float]source_scatter_relative: Optional[float]margin_std_from_source_parameters: Optional[float]margin_std_from_source_scatter: Optional[float]source_note: strsource_parameters_complete: boolextrapolated: tuplewarnings: tuple
BoundaryQuantity
class
source
BoundaryQuantity(name: str, symbol: str, unit: str, definition: str = '') -> None
A physical quantity with a fixed identity and unit.
Also exported as vaft.formula.BoundaryQuantity.
4 fields
name: strsymbol: strunit: strdefinition: str
BoundarySource
class
source
BoundarySource(citation: str, equation: str = '', doi: str = '', note: str = '') -> None
Where a boundary comes from: citation, equation number and DOI.
Also exported as vaft.formula.BoundarySource.
4 fields
citation: strequation: strdoi: strnote: str
BoundaryWindow
class
source
BoundaryWindow(key: str, regime: str, lower: Boundary, upper: Boundary) -> None
An access window: permitted between a lower and an upper boundary.
Also exported as vaft.formula.BoundaryWindow.
4 fields
key: strregime: strlower: Boundaryupper: Boundary
cylindrical_kink_coordinates — Menard’s cylindrical safety factor, $q^* = \pi a^2 B_{T0}(1+\kappa^2)/(\mu_0 R_0 I_P)$. Reference source
Also exported as vaft.formula.cylindrical_kink_coordinates.
evaluate_boundary — Distance and side of an operating value relative to a boundary. Reference source
Also exported as vaft.formula.evaluate_boundary.
evaluate_window — Position of an operating value relative to an access window. Reference source
Also exported as vaft.formula.evaluate_window.
get_boundary — A registered boundary or window by key. Reference source
Also exported as vaft.formula.get_boundary.
hugill_coordinates — Hugill-diagram coordinates of an operating state: $(\bar n_e R/B_T,\ 1/q_\mathrm{cyl})$. Reference source
Also exported as vaft.formula.hugill_coordinates.
hugill_coordinates_st — Spherical-tokamak Hugill coordinates $(\bar n_e R/B_T,\ 1/q_\mathrm{cyl}^{ST})$ of Sykes et al. (2000). Reference source
Also exported as vaft.formula.hugill_coordinates_st.
iter_q95_coordinates — The ITER design-guideline $q_{95}$ estimate from global shape, $q_{95} \approx q_* f(\epsilon)$. Reference source
Also exported as vaft.formula.iter_q95_coordinates.
kink_coordinates — Freidberg’s kink safety factor of an elongated tokamak, $q_* = 2\pi a^2\kappa B_0/(\mu_0 R_0 I)$. Reference source
Also exported as vaft.formula.kink_coordinates.
list_boundaries — Keys of the registered boundaries, optionally restricted to one family. Reference source
Also exported as vaft.formula.list_boundaries.
propagate_boundary_uncertainty — Propagate measured-input uncertainty into a boundary value and a state’s margin (#1874). Reference source
Also exported as vaft.formula.propagate_boundary_uncertainty.
same_quantity — Whether two quantities are the same physical quantity in the same unit. Reference source
Also exported as vaft.formula.same_quantity.
start_q95_coordinates — The START low-aspect-ratio $q_{95}$ estimate of Akers et al. (2000) from global shape. Reference source
Also exported as vaft.formula.start_q95_coordinates.
threshold_curve — A threshold boundary drawn as a straight line across a 2-D projection. Reference source
Also exported as vaft.formula.threshold_curve.
Uncertainty
class
source
Uncertainty(coefficient: Optional[float] = None, exponents: Mapping[str, float] = <factory>, note: str = '', coefficient_factor: Optional[float] = None, rms_relative: Optional[float] = None) -> None
Uncertainty the source itself reports, never an invented one.
Also exported as vaft.formula.Uncertainty.
5 fields
coefficient: Optional[float]exponents: Mapping[str, float]note: strcoefficient_factor: Optional[float]rms_relative: Optional[float]
WindowEvaluation
class
source
WindowEvaluation(key: str, lower: BoundaryEvaluation, upper: BoundaryEvaluation, inside: object) -> None
How one operating state compares with an access window.
Also exported as vaft.formula.WindowEvaluation.
4 fields
key: strlower: BoundaryEvaluationupper: BoundaryEvaluationinside: object
vaft.formula.catalog
Searchable catalog of the formula layer, read out of the docstrings.
CATEGORIES
data
CATEGORIES = ('utils', 'equilibrium', 'virial', 'stability', 'green', 'atomic', 'statistics', 'magnetics', 'neoclassical', 'startu...
categories
function
source
categories() -> list[CategoryDoc]
Every submodule as a documentation category, constants included.
CategoryDoc
class
source
CategoryDoc(name: str, module: str, title: str, overview: str, notation: tuple, conventions: str, count: int) -> None
One submodule as a documentation category.
7 fields · 1 members
name: strmodule: strtitle: stroverview: strnotation: tupleconventions: strcount: intas_dictmethod source
describe
function
source
describe(name: str) -> FormulaSpec
The spec of one formula.
documentation_snapshot
function
source
documentation_snapshot(category: str | None = None, provenance: Mapping[str, str] | None = None) -> dict
Deterministic, site-ready representation of the whole catalog.
export_documentation_snapshot
function
source
export_documentation_snapshot(output: str | Path, category: str | None = None, provenance: Mapping[str, str] | None = None) -> Path
Write the YAML snapshot and return its path.
FormulaSpec
class
source
FormulaSpec(name: str, category: str, module: str, signature: str, summary: str, description: str, parameters: tuple[ParamDoc, ...], returns: tuple[ReturnDoc, ...], sections: tuple[tuple[str, str], ...], references: tuple[Reference, ...], empirical: bool, convention_sensitive: bool, deprecated: bool, aliases: tuple[str, ...] = (), shadowed_by: str | None = None, errors: tuple[str, ...] = (), raises: tuple[RaiseDoc, ...] = (), source_path: str = '', source_line: int = 0, source_end_line: int = 0, source_code: str = '', definitions: tuple[str, ...] = (), reduction: Reduction | None = None, semantics: Semantics | None = None, uncertainty_propagation: bool = False, analytic_jacobian: bool = False) -> None
Everything the catalog knows about one public formula function.
26 fields · 6 members
name: strcategory: strmodule: strsignature: strsummary: strdescription: strparameters: tuple[ParamDoc, ...]returns: tuple[ReturnDoc, ...]sections: tuple[tuple[str, str], ...]references: tuple[Reference, ...]empirical: boolconvention_sensitive: booldeprecated: boolaliases: tuple[str, ...]shadowed_by: str | Noneerrors: tuple[str, ...]raises: tuple[RaiseDoc, ...]source_path: strsource_line: intsource_end_line: intsource_code: strdefinitions: tuple[str, ...]reduction: Reduction | Nonesemantics: Semantics | Noneuncertainty_propagation: boolanalytic_jacobian: boolqualnameproperty —category.name, the unambiguous catalog key. sourcedefinitionproperty — The defining equations as Markdown display math,""when there are none. sourcesectionmethod — Text of one section, orNonewhen the docstring lacks it. sourcerendermethod — Terminal-friendly description: signature, units, sections, references. sourceto_markdownmethod — The same card as Markdown with$...$math, for Jupyter and notebooks. sourceas_dictmethod — The snapshot row: plain scalars and lists, Sphinx roles stripped. source
list_formulas
function
source
list_formulas(category: str | None = None, *, reduction_kind: str | None = None, locality: str | None = None, role: str | None = None, output_representation: str | None = None) -> list[FormulaSpec]
Specs of every formula, or of one category, in category-then-name order.
search
function
source
search(text: str, *, category: str | None = None) -> list[FormulaSpec]
Formulas whose name, prose, sections, parameters or references mention text.
show
function
source
show(name: str, sections: list[str] | tuple[str, ...] | None = None) -> FormulaMarkdown
One formula’s card, or the chosen parts of it, as Markdown for a notebook.
vaft.formula.constants
Physical constants and the confinement-scaling coefficient table.
AMU
data
AMU = 1.6605390666e-27
C_B
data
C_B = np.float64(4.230421226622645e-29)
C_LIGHT
data
C_LIGHT = 299792458.0
COLLISIONALITY_COEF
data
COLLISIONALITY_COEF = 6.921e-18
E_ALPHA
data
E_ALPHA = 5.607618219e-13
EPS0
data
EPS0 = 8.8541878128e-12
H_PLANCK
data
H_PLANCK = 6.62607015e-34
K_B_COEF
data
K_B_COEF = 0.052
K_BOLTZMANN
data
K_BOLTZMANN = 1.380649e-23
ME
data
ME = 9.10938356e-31
MI_P
data
MI_P = 1.67262192e-27
MU0
data
MU0 = 1.2566370614359173e-06
PA_PER_TORR
data
PA_PER_TORR = 133.32236842105263
QE
data
QE = 1.602176634e-19
SIGMA_V_COEF
data
SIGMA_V_COEF = 1.1e-24
SPITZER_RESISTIVITY_COEF
data
SPITZER_RESISTIVITY_COEF = 5.2e-05
vaft.formula.dimensional
Dimensional analysis: dimension matrices, Buckingham-Pi groups and similarity constraints.
BASE_DIMENSIONS
data
BASE_DIMENSIONS = ('L', 'M', 'T', 'I')
dimension_matrix — Dimension matrix $D$ of a list of variables, exactly. Reference source
Also exported as vaft.formula.dimension_matrix.
dimensionless_groups — A basis of the Buckingham-Pi groups of a set of variables: $\ker D$. Reference source
Also exported as vaft.formula.dimensionless_groups.
express_in_basis — Exact coefficients $\mathbf c$ with $\mathbf t = \sum_k c_k \mathbf b_k$. Reference source
Also exported as vaft.formula.express_in_basis.
monomial_dimension — Base dimensions of the monomial $\prod_j x_j^{a_j}$: $D\mathbf a$. Reference source
Also exported as vaft.formula.monomial_dimension.
PHYSICAL_DIMENSIONS
data
PHYSICAL_DIMENSIONS = <builtins.mappingproxy>
rational_null_space — Exact basis of the null space ${\mathbf a : M\mathbf a = 0}$ of a rational matrix. Reference source
Also exported as vaft.formula.rational_null_space.
vaft.formula.disruption
Disruption reference relations: thermal and current quench, induced field, runaway electrons.
avalanche_efolds_from_current_drop — Number of avalanche e-folds a current quench provides, $E \gg E_c$. Reference source
Also exported as vaft.formula.avalanche_efolds_from_current_drop.
avalanche_growth_rate — Rosenbluth–Putvinski avalanche (secondary) growth rate of the runaway density. Reference source
Also exported as vaft.formula.avalanche_growth_rate.
connor_hastie_critical_field — Connor–Hastie critical field below which no electron runs away. Reference source
Also exported as vaft.formula.connor_hastie_critical_field.
current_quench_current — Exponential (L/R) current quench of the plasma current. Reference source
Also exported as vaft.formula.current_quench_current.
dreicer_field — Dreicer field: the drag on a thermal electron. Reference source
Also exported as vaft.formula.dreicer_field.
dreicer_generation_rate — Dreicer (primary) runaway generation rate, Connor–Hastie asymptotic form. Reference source
Also exported as vaft.formula.dreicer_generation_rate.
inductive_parallel_electric_field — Parallel electric field a changing plasma current induces in the plasma. Reference source
Also exported as vaft.formula.inductive_parallel_electric_field.
relativistic_collision_time — Collision time of a relativistic electron, $\tau_c = m_ec/(eE_c)$. Reference source
Also exported as vaft.formula.relativistic_collision_time.
runaway_critical_momentum — Critical momentum above which an electron runs away, in units of $m_ec$. Reference source
Also exported as vaft.formula.runaway_critical_momentum.
vaft.formula.equilibrium
Plasma equilibrium, current, energy, and geometry calculations.
alpha_heating_power_from_n_D_n_T_T_keV_V — D-T alpha heating power with the rough $\langle\sigma v\rangle \propto T^2$ fit. Reference source
Also exported as vaft.formula.alpha_heating_power, vaft.formula.alpha_heating_power_from_n_D_n_T_T_keV_V, vaft.formula.equilibrium.alpha_heating_power.
aspect_ratio_from_a_R — Aspect ratio $A = R/a = 1/\varepsilon$. Reference source
Also exported as vaft.formula.aspect_ratio_from_a_R.
auxiliary_heating_power — Split auxiliary power into heating and current-drive parts. Reference source
Also exported as vaft.formula.auxiliary_heating_power.
ballooning_alpha_from_volume — Normalised pressure gradient $\alpha$ of local ballooning theory on a general equilibrium. Reference source
Also exported as vaft.formula.ballooning_alpha_from_volume.
beta_normal_from_beta_tor — Normalized beta (Troyon) from toroidal beta, minor radius, field and current. Reference source
Also exported as vaft.formula.beta_normal_from_beta_tor.
beta_normal_from_beta_volume — Normalized volume beta: the volume beta normalized like the Troyon beta_N. Reference source
Also exported as vaft.formula.beta_normal_from_beta_volume.
beta_poloidal_from_circumference — Poloidal beta in the EFIT/OMFIT convention, normalized by the LCFS circumference. Reference source
Also exported as vaft.formula.beta_poloidal_from_circumference.
beta_poloidal_from_pressure_integral — Poloidal beta in the IMAS definition, from the pressure volume integral. Reference source
Also exported as vaft.formula.beta_poloidal_from_pressure_integral.
beta_t_from_n_T_B — Toroidal beta from density, temperature and field. Reference source
Also exported as vaft.formula.beta_t_from_n_T_B, vaft.formula.calc_beta_t, vaft.formula.equilibrium.calc_beta_t.
beta_toroidal_from_p_B0 — Toroidal beta from the volume-averaged pressure and the vacuum field. Reference source
Also exported as vaft.formula.beta_toroidal_from_p_B0.
beta_volume_from_p_B2 — Volume beta: the volume-averaged pressure over the volume-averaged total magnetic energy density. Reference source
Also exported as vaft.formula.beta_volume_from_p_B2.
bootstrap_current_fraction — Heuristic bootstrap-current fraction $f_{BS}$. Reference source
Also exported as vaft.formula.bootstrap_current_fraction.
bremsstrahlung_power_density_from_n_e_T_e_Z_eff — Maxwellian free-free (bremsstrahlung) power density from first principles. Reference source
Also exported as vaft.formula.bremsstrahlung_power_density_from_n_e_T_e_Z_eff.
bremsstrahlung_power_density_from_T_e_p_Z_eff — Bremsstrahlung power density in the pressure form. Reference source
Also exported as vaft.formula.bremsstrahlung_power_density_from_T_e_p_Z_eff.
bremsstrahlung_radiation_power_from_z_eff_n_e_t_e — Bremsstrahlung power density, NRL engineering form. Reference source
Also exported as vaft.formula.bremsstrahlung_radiation_power_from_z_eff_n_e_t_e.
calc_inverse_aspect_ratio — Inverse aspect ratio $\varepsilon = a/R_{geo}$ with input validation. Reference source
Also exported as vaft.formula.calc_inverse_aspect_ratio.
check_kadomtsev_constraint — Whether engineering exponents satisfy the Kadomtsev constraint within a tolerance. Reference source
Also exported as vaft.formula.check_kadomtsev_constraint.
confinement_factor_ITER89P — Confinement enhancement factor $H_{89}$ relative to ITER89P. Reference source
Also exported as vaft.formula.confinement_factor_ITER89P.
confinement_scaling_basis — Energy and power basis a published confinement scaling was fitted on. Reference source
Also exported as vaft.formula.confinement_scaling_basis.
confinement_time_from_engineering_parameters — Thermal energy confinement time from an engineering-parameter scaling law. Reference source
Also exported as vaft.formula.confinement_time_from_engineering_parameters.
confinement_time_from_P_loss_W_th — Energy confinement time as stored energy over loss power. Reference source
Also exported as vaft.formula.confinement_time_from_P_loss_W_th.
ConfinementScalingBasis
class
source
ConfinementScalingBasis(scaling: str, energy_basis: str, power_basis: str, energy_source: str, power_source: str)
Which confinement time and which power a published scaling predicts (issue #1713).
Also exported as vaft.formula.ConfinementScalingBasis.
coulomb_logarithm_from_n_T — Coulomb logarithm $\ln\Lambda$ for electron collisions above 10 eV. Reference source
Also exported as vaft.formula.coulomb_logarithm, vaft.formula.coulomb_logarithm_from_n_T, vaft.formula.equilibrium.coulomb_logarithm.
current_density_from_B — Toroidal current density from the radial derivative of a poloidal field. Reference source
Also exported as vaft.formula.current_density_from_B.
current_drive_efficiency — Heuristic lower-hybrid current-drive efficiency $\eta_{CD}$. Reference source
Also exported as vaft.formula.current_drive_efficiency.
current_limit_from_beta — Current figure obtained by substituting $\beta_N$ for $q$ in the cylindrical relation. Reference source
Also exported as vaft.formula.current_limit_from_beta.
current_limit_from_q — Plasma current at a prescribed edge safety factor, cylindrical approximation. Reference source
Also exported as vaft.formula.current_limit_from_q.
cyclotron_synchrotron_power_density_scaling_from_n_e_B_t_T_e — Classical electron-cyclotron emission power density, no reabsorption. Reference source
Also exported as vaft.formula.cyclotron_synchrotron_power_density_scaling_from_n_e_B_t_T_e.
cylindrical_safety_factor_from_R_B_epsilon_I_f_kappa_delta — Cylindrical safety factor with a shape function. Reference source
Also exported as vaft.formula.cylindrical_safety_factor_from_R_B_epsilon_I_f_kappa_delta.
decay_index_from_bz — Field decay index $n = -\dfrac{R}{B_Z}\dfrac{\partial B_Z}{\partial R}$. Reference source
Also exported as vaft.formula.decay_index_from_bz.
dimensionless_scaling_coeffs_from_engineering_scaling_coeffs — Dimensionless scaling indices $(\mu_\rho, \mu_\beta, \mu_\nu)$ from engineering exponents. Reference source
Also exported as vaft.formula.dimensionless_scaling_coeffs_from_engineering_scaling_coeffs.
ec_heating_power_from_I_ec_V_ec — Electron-cyclotron launched power $P_{ec} = I_{ec}V_{ec}$. Reference source
Also exported as vaft.formula.ec_heating_power_from_I_ec_V_ec.
eK_from_K — Elongation parameter $e_K$ of the virial relations. Reference source
Also exported as vaft.formula.eK_from_K.
electron_pressure — Electron thermal pressure from density and temperature, $p_e = n_e T_e$. Reference source
Also exported as vaft.formula.electron_pressure.
elongation_from_RZ_boundary — Boundary elongation $\kappa$ from the extremal points of a contour. Reference source
Also exported as vaft.formula.elongation_from_RZ_boundary.
engineering_exponents_from_dimensionless_coeffs — Engineering exponents $(\alpha_I, \alpha_B, \alpha_P, \alpha_n, \alpha_R)$ from dimensionless indices. Reference source
Also exported as vaft.formula.engineering_exponents_from_dimensionless_coeffs.
estimated_q95 — Estimated $q_{95}$ from global shape, plasma current and toroidal field. Reference source
Also exported as vaft.formula.estimated_q95.
exact_volume_from_RZ_contour — Plasma volume from a closed $(R, Z)$ contour by Green’s theorem. Reference source
Also exported as vaft.formula.exact_volume_from_RZ_contour.
flux_perturbation_from_normal_displacement — Ideal (flux-frozen) perturbed flux of a displacement normal to the flux surfaces. Reference source
Also exported as vaft.formula.flux_perturbation_from_normal_displacement.
generalized_parabolic_profile — Smooth core profile that falls from its axis value to its edge value. Reference source
Also exported as vaft.formula.generalized_parabolic_profile.
generalized_parabolic_profile_derivative — Gradient against normalized flux of generalized_parabolic_profile. Reference source
Also exported as vaft.formula.generalized_parabolic_profile_derivative.
generalized_straight_field_line_angle — Straight-field-line poloidal angle of the generalised family: PEST, Boozer, Hamada, equal-arc. Reference source
Also exported as vaft.formula.generalized_straight_field_line_angle.
goldston_l_mode_confinement_time_from_I_P_R_a_kappa — Goldston L-mode energy confinement time. Reference source
Also exported as vaft.formula.goldston_l_mode_confinement_time_from_I_P_R_a_kappa.
grad_shafranov_source — Right-hand side of the poloidal-flux equation from Ampere’s law, any region. Reference source
Also exported as vaft.formula.grad_shafranov_source.
heating_power_from_p_ohm_p_aux — Total heating power $P_{heat} = P_{ohm} + P_{aux}$. Reference source
Also exported as vaft.formula.heating_power_from_p_ohm_p_aux.
inductive_voltage_from_dW_magdt_I_p — Inductive voltage from the rate of change of magnetic energy. Reference source
Also exported as vaft.formula.inductive_voltage_from_dW_magdt_I_p.
internal_inductance_from_li_3_R0 — Dimensional internal inductance from the IMAS li_3. Reference source
Also exported as vaft.formula.internal_inductance_from_li_3_R0.
internal_inductance_from_W_int_Ip — Dimensional internal inductance from the poloidal-field energy inside the plasma. Reference source
Also exported as vaft.formula.internal_inductance_from_W_int_Ip.
inverse_aspect_ratio_from_a_R — Inverse aspect ratio $\varepsilon = a/R$. Reference source
Also exported as vaft.formula.inverse_aspect_ratio_from_a_R.
ion_pressure — Ion thermal pressure of one species from density and temperature, $p_i = n_i T_i$. Reference source
Also exported as vaft.formula.ion_pressure.
kadomtsev_constraint_from_engineering_exponents — Residual of the Kadomtsev high-beta constraint on engineering exponents. Reference source
Also exported as vaft.formula.kadomtsev_constraint_from_engineering_exponents.
kinetic_energy_from_beta_p_B_pa_V_p — Thermal energy from poloidal beta, $W_K = \tfrac{3}{2}\,\beta_p B_{pa}^2 V_p/(2\mu_0)$. Reference source
Also exported as vaft.formula.kinetic_energy_from_beta_p_B_pa_V_p.
kink_safety_factor — Kink safety factor $q_*$ with the Freidberg beta and current limits. Reference source
Also exported as vaft.formula.kink_safety_factor.
li_1_from_Bp2_volume_integral — Internal inductance in the circumference-normalized l_i(1) definition. Reference source
Also exported as vaft.formula.li_1_from_Bp2_volume_integral.
li_3_from_Bp2_volume_integral — Internal inductance in the IMAS li_3 definition, from the poloidal-field energy. Reference source
Also exported as vaft.formula.li_3_from_Bp2_volume_integral.
li_3_from_internal_inductance_R0 — IMAS li_3 from a dimensional internal inductance. Reference source
Also exported as vaft.formula.li_3_from_internal_inductance_R0.
line_to_volume_avg_density — Volume-averaged density from a line average with a fixed profile factor. Reference source
Also exported as vaft.formula.line_to_volume_avg_density.
loop_voltage_from_total_flux — Surface loop voltage from the time series of boundary flux. Reference source
Also exported as vaft.formula.loop_voltage_from_total_flux.
loss_power_from_p_heat_dWdt_p_rad — Loss power $P_{loss} = P_{heat} - dW/dt - P_{rad}$. Reference source
Also exported as vaft.formula.loss_power_from_p_heat_dWdt_p_rad.
magnetic_energy_from_li_B_pa_V_p — Poloidal magnetic energy from the internal inductance, $W_M = l_i B_{pa}^2 V_p/(2\mu_0)$. Reference source
Also exported as vaft.formula.magnetic_energy_from_li_B_pa_V_p.
miller_surface — Major radius and height of a Miller-parametrised flux surface. Reference source
Also exported as vaft.formula.miller_surface.
modified_tanh_profile — H-mode pedestal profile: Groebner’s modified hyperbolic tangent in normalized flux. Reference source
Also exported as vaft.formula.modified_tanh_profile.
modified_tanh_profile_derivative — Gradient against normalized flux of modified_tanh_profile. Reference source
Also exported as vaft.formula.modified_tanh_profile_derivative.
nbi_heating_power_from_I_nbi_V_nbi — Neutral-beam injected power $P_{nbi} = I_{nbi}V_{nbi}$. Reference source
Also exported as vaft.formula.nbi_heating_power_from_I_nbi_V_nbi.
neo_alcator_confinement_time_from_n_a_R_q — Neo-Alcator ohmic energy confinement time. Reference source
Also exported as vaft.formula.neo_alcator_confinement_time_from_n_a_R_q.
normalize_psi Deprecated — Deprecated: use psi_normalised. Reference source
Also exported as vaft.formula.normalize_psi.
normalized_collisionality_from_a_n_q_epsilon_T — Collisionality scaling form $\nu_* \propto a\,n\,q/(\varepsilon^{5/2}T^2)$. Reference source
Also exported as vaft.formula.normalized_collisionality_from_a_n_q_epsilon_T.
normalized_collisionality_from_nu_ii_T_i_M_i_R_a_q — Ion collisionality $\nu_*$ from a collision frequency. Reference source
Also exported as vaft.formula.normalized_collisionality_from_nu_ii_T_i_M_i_R_a_q.
normalized_larmor_radius_from_M_T_a_Bt — Normalised ion gyroradius $\rho_* = \rho_i/a$ in SI inputs. Reference source
Also exported as vaft.formula.normalized_larmor_radius_from_M_T_a_Bt.
normalized_plasma_current — Normalised plasma current $I_N = I_p/(a B_t)$ in MA/(m T). Reference source
Also exported as vaft.formula.normalized_plasma_current.
nu_star_from_n_T_B_R_epsilon_kappa_I — Normalised collisionality $\nu_*$ in the Verdoolaege engineering form. Reference source
Also exported as vaft.formula.calc_nu_star, vaft.formula.equilibrium.calc_nu_star, vaft.formula.nu_star_from_n_T_B_R_epsilon_kappa_I.
ohmic_heating_power_from_I_p_V_res — Ohmic heating power $P_{ohm} = I_pV_{res}$. Reference source
Also exported as vaft.formula.ohmic_heating_power_from_I_p_V_res.
ohmic_l_mode_confinement_time_from_tau_ohmic_tau_aux — Ohmic and auxiliary confinement times combined in quadrature. Reference source
Also exported as vaft.formula.ohmic_l_mode_confinement_time_from_tau_ohmic_tau_aux.
omega_i_tau_E_from_B_tau_E_M — Ion-cyclotron-normalised confinement time $\Omega_i\tau_E$. Reference source
Also exported as vaft.formula.calc_omega_i_tau_E, vaft.formula.equilibrium.calc_omega_i_tau_E, vaft.formula.omega_i_tau_E_from_B_tau_E_M.
peaking_factor — Profile peaking factor, central value over volume average. Reference source
Also exported as vaft.formula.peaking_factor.
phi_from_Bphi — Toroidal flux $\Phi$ through a poloidal cross-section. Reference source
Also exported as vaft.formula.phi_from_Bphi.
poloidal_field_factor — Sauter Eq. 20 prefactor $k = \sigma_{R\varphi Z}\,\sigma_{B_p}/(2\pi)^{e_{B_p}}$. Reference source
Also exported as vaft.formula.poloidal_field_factor.
poloidal_field_magnitude —
| Poloidal field strength $ | B_p | = \sqrt{B_R^2 + B_Z^2}$. |
Also exported as
vaft.formula.poloidal_field_magnitude.psi_from_RBtheta — Poloidal flux $\psi$ from a line integral of $R B_\theta$ across flux surfaces. Reference source
Also exported as vaft.formula.psi_from_RBtheta.
psi_normalised — Normalised poloidal flux $\psi_N$. Reference source
Also exported as vaft.formula.psi_normalised.
q_cyl_from_B_R_epsilon_kappa_I — Cylindrical safety factor in the Verdoolaege convention. Reference source
Also exported as vaft.formula.calc_q_cyl, vaft.formula.equilibrium.calc_q_cyl, vaft.formula.q_cyl_from_B_R_epsilon_kappa_I.
q_from_flux_surface_averages — Safety factor $q$ from flux-surface geometric averages and poloidal current. Reference source
Also exported as vaft.formula.q_from_flux_surface_averages.
q_from_phi — Safety factor $q$ as the flux derivative $d\Phi/d\psi$. Reference source
Also exported as vaft.formula.q_from_phi.
q_from_rhoN — Safety factor from the toroidal-flux label $\rho_N(\psi_N)$. Reference source
Also exported as vaft.formula.q_from_rhoN.
q_star_cylindrical — Menard’s cylindrical safety factor $q^* = \pi a^2 B_0(1+\kappa^2)/(\mu_0 R_0 I_p)$. Reference source
Also exported as vaft.formula.q_star_cylindrical.
q_star_kink — Freidberg’s kink safety factor $q_* = 2\pi a^2\kappa B_0/(\mu_0 R_0 I_p)$. Reference source
Also exported as vaft.formula.q_star_kink.
r_at_z_extremum_from_RZ_contour — Major radius where a closed contour reaches its highest or lowest point. Reference source
Also exported as vaft.formula.r_at_z_extremum_from_RZ_contour.
radial_magnetic_field_from_psi — Radial magnetic field $B_R$ from the poloidal flux map. Reference source
Also exported as vaft.formula.radial_magnetic_field_from_psi.
rho_star_from_M_T_B_R_epsilon — Normalised ion gyroradius $\rho_*$ in the Verdoolaege engineering form. Reference source
Also exported as vaft.formula.calc_rho_star, vaft.formula.equilibrium.calc_rho_star, vaft.formula.rho_star_from_M_T_B_R_epsilon.
rho_tor_from_phi —
| Dimensional toroidal-flux radius $\rho_{tor} = \sqrt{ | \Phi | /(\pi | B_0 | )}$. |
Also exported as
vaft.formula.rho_tor_from_phi.rhoN_from_phi — Normalised toroidal-flux radius $\rho_N$. Reference source
Also exported as vaft.formula.rhoN_from_phi.
rhoN_from_qpsiN — Normalised toroidal-flux radius from the $q$ profile. Reference source
Also exported as vaft.formula.rhoN_from_qpsiN.
sfl_toroidal_angle_shift — Toroidal-angle shift $\nu$ that keeps field lines straight in a non-PEST poloidal angle. Reference source
Also exported as vaft.formula.sfl_toroidal_angle_shift.
shafranov_shift_from_r_a_R0_beta_p_li — Large-aspect-ratio Shafranov shift of a circular surface relative to the boundary. Reference source
Also exported as vaft.formula.shafranov_shift_from_r_a_R0_beta_p_li.
shear_from_r_q — Magnetic shear $s$ of the safety-factor profile. Reference source
Also exported as vaft.formula.equilibrium.magnetic_shear, vaft.formula.magnetic_shear, vaft.formula.shear_from_r_q.
shear_from_volume — Magnetic shear against the volume radius $r_V = \sqrt{V/2\pi^2R_0}$. Reference source
Also exported as vaft.formula.shear_from_volume.
spitzer_resistivity_from_T_e_Z_eff_ln_Lambda — Spitzer parallel resistivity $\eta_\parallel$ (NRL, parallel coefficient). Reference source
Also exported as vaft.formula.spitzer_resistivity_from_T_e_Z_eff_ln_Lambda.
stored_energy_from_beta_V — Pressure volume integral $\langle p\rangle V$ from toroidal beta – not the thermal energy. Reference source
Also exported as vaft.formula.stored_energy_from_beta_V.
stored_energy_from_p_V — Pressure volume integral $\int p\,dV \approx \langle p\rangle V$ – not the thermal (stored) energy. Reference source
Also exported as vaft.formula.stored_energy_from_p_V.
straight_field_line_angle — Straight-field-line (PEST) poloidal angle on one flux surface. Reference source
Also exported as vaft.formula.straight_field_line_angle.
surface_poloidal_flux_from_psi_boundary — Total poloidal flux at the plasma surface, $\Phi_{surface} = 2\pi\psi_b$. Reference source
Also exported as vaft.formula.surface_poloidal_flux_from_psi_boundary.
thermal_energy_from_p_V — Thermal (stored kinetic) energy of the plasma, $W_{th} = \tfrac{3}{2}\int p\,dV$. Reference source
Also exported as vaft.formula.thermal_energy_from_p_V.
toroidal_current_density_from_p_prime_ff_prime — Plasma toroidal current density allowed by force balance, $J_\phi(p’, FF’)$. Reference source
Also exported as vaft.formula.toroidal_current_density_from_p_prime_ff_prime.
toroidal_electric_field — Toroidal electric field $E_\varphi = -\dfrac{1}{2\pi R}\dfrac{\partial\psi}{\partial t}$. Reference source
Also exported as vaft.formula.toroidal_electric_field.
toroidal_flux_from_q_psi — Cumulative toroidal flux $\Phi(\psi)$ from the $q$ profile on a full-weber grid. Reference source
Also exported as vaft.formula.toroidal_flux_from_q_psi.
triangularity_from_RZ_boundary — Boundary triangularity $\delta$, the mean of the upper and lower values. Reference source
Also exported as vaft.formula.triangularity_from_RZ_boundary.
triangularity_lower_from_RZ_boundary — Lower boundary triangularity $\delta_l$ from the contour’s lowest point. Reference source
Also exported as vaft.formula.triangularity_lower_from_RZ_boundary.
triangularity_upper_from_RZ_boundary — Upper boundary triangularity $\delta_u$ from the contour’s highest point. Reference source
Also exported as vaft.formula.triangularity_upper_from_RZ_boundary.
vacuum_toroidal_field — Vacuum toroidal field of a set of toroidal-field coils. Reference source
Also exported as vaft.formula.vacuum_toroidal_field.
verify_kadomtsev_constraint — Kadomtsev constraint residual of the engineering scaling behind dimensionless indices. Reference source
Also exported as vaft.formula.verify_kadomtsev_constraint.
vaft.formula.fast_ion
Classical fast-ion slowing down: critical velocity, slowing-down time, distribution, density and pressure.
critical_energy_from_T_e_A_b_n_species — Critical energy of a fast ion of mass number A_b: E_c = m_b v_c^2 / 2. Reference source
Also exported as vaft.formula.critical_energy_from_T_e_A_b_n_species.
critical_velocity_from_T_e_n_species — Critical speed at which a fast ion’s drag on electrons equals its drag on the field ions. Reference source
Also exported as vaft.formula.critical_velocity_from_T_e_n_species.
fast_ion_density_from_source — Fast-ion density held by a steady source slowing down classically. Reference source
Also exported as vaft.formula.fast_ion_density_from_source.
fast_ion_energy_density_from_source — Kinetic-energy density held by a steady source slowing down classically. Reference source
Also exported as vaft.formula.fast_ion_energy_density_from_source.
fast_ion_pressure_from_energy_density — Scalar fast-ion pressure of an isotropic fast population: p_f = 2 W_f / 3. Reference source
Also exported as vaft.formula.fast_ion_pressure_from_energy_density.
slowing_down_distribution — Steady isotropic classical slowing-down distribution of a monoenergetic source. Reference source
Also exported as vaft.formula.slowing_down_distribution.
vaft.formula.geometry
Canonical geometric approximations: slab, sheared slab, cylinder, local reduction.
cylindrical_current_diffusion_rate — Rate of change of the enclosed current under resistive diffusion of the poloidal field. Reference source
Also exported as vaft.formula.cylindrical_current_diffusion_rate.
cylindrical_enclosed_current — Axial current inside each radius of a straight current column. Reference source
Also exported as vaft.formula.cylindrical_enclosed_current.
cylindrical_internal_inductance — Normalized internal inductance of a current column of radius $a$. Reference source
Also exported as vaft.formula.cylindrical_internal_inductance.
cylindrical_parallel_wavenumber — Parallel wavenumber of an $m/n$ harmonic on a cylindrical surface of safety factor $q$. Reference source
Also exported as vaft.formula.cylindrical_parallel_wavenumber.
cylindrical_poloidal_field — Poloidal field of a straight current column by Ampère’s law. Reference source
Also exported as vaft.formula.cylindrical_poloidal_field.
cylindrical_poloidal_flux — Poloidal flux per radian of a straightened torus, zero on the axis. Reference source
Also exported as vaft.formula.cylindrical_poloidal_flux.
cylindrical_safety_factor_from_r_B — Safety factor of a straight cylinder standing in for a torus. Reference source
Also exported as vaft.formula.cylindrical_safety_factor_from_r_B.
harris_sheet_current_density — Current density of a Harris current sheet, from Ampere’s law. Reference source
Also exported as vaft.formula.harris_sheet_current_density.
harris_sheet_field — Reconnecting field of a Harris current sheet. Reference source
Also exported as vaft.formula.harris_sheet_field.
local_slab_from_cylinder — The field-aligned sheared slab of a cylinder at $r_0$: $(k_y, L_s, k_z)$ of an $m/n$ harmonic. Reference source
Also exported as vaft.formula.local_slab_from_cylinder.
peaked_current_safety_factor — Cylindrical $q$ profile of the peaked current $j \propto (1 - x^2)^\nu$. Reference source
Also exported as vaft.formula.peaked_current_safety_factor.
shear_length_from_q_R0_s — Magnitude of the shear length a torus or cylinder gives its local slab. Reference source
Also exported as vaft.formula.shear_length_from_q_R0_s.
sheared_slab_field — Magnetic field of the sheared slab at radial position $x$. Reference source
Also exported as vaft.formula.sheared_slab_field.
sheared_slab_parallel_wavenumber — Parallel wavenumber across a sheared slab, to first order in $x/L_s$. Reference source
Also exported as vaft.formula.sheared_slab_parallel_wavenumber.
vaft.formula.green
Green’s function calculations for plasma physics.
calculate_distance — Euclidean distance between $(r_1, z_1)$ and $(r_2, z_2)$ in the poloidal plane. Reference source
Also exported as vaft.formula.calculate_distance.
complete_elliptic_integral_e — Complete elliptic integral of the second kind $E(m)$. Reference source
Also exported as vaft.formula.complete_elliptic_integral_e.
complete_elliptic_integral_k — Complete elliptic integral of the first kind $K(m)$. Reference source
Also exported as vaft.formula.complete_elliptic_integral_k.
elliptic_integral — Polynomial approximations of $K$ and $E$ for a ring source and observer points. Reference source
Also exported as vaft.formula.elliptic_integral.
green_br_bz — Field of a unit-current ring, $(B_r, B_z)$ at observer points (legacy elliptic path). Reference source
Also exported as vaft.formula.green_br_bz.
green_br_bz_exact — $(B_r, B_z)$ per unit ring current, exact elliptic integrals, broadcasting. Reference source
Also exported as vaft.formula.green_br_bz_exact.
GREEN_EXACT_MODES
data
GREEN_EXACT_MODES = ('psi', 'dpsi_dr', 'dpsi_dz', 'd2psi_drdz', 'd2psi_dr2', 'K', 'E')
green_psi_exact — Poloidal flux per unit ring current, exact elliptic integrals. Reference source
Also exported as vaft.formula.green_psi_exact.
green_r — Poloidal flux per unit ring current at observer points (legacy elliptic path). Reference source
Also exported as vaft.formula.green_r.
greens_function_2d — Axisymmetric kernel $\sqrt{RR_0}\,K(m)$ between a field point and a ring source. Reference source
Also exported as vaft.formula.greens_function_2d.
greens_function_3d — Toroidal-angle-resolved variant of the $\sqrt{RR_0}\,K(m)$ kernel. Reference source
Also exported as vaft.formula.greens_function_3d.
greens_function_exact — Exact free-space axisymmetric Green’s function and its derivatives. Reference source
Also exported as vaft.formula.greens_function_exact.
greens_integral_2d — Line integral along $R$ of the 2-D kernel times a source density. Reference source
Also exported as vaft.formula.greens_integral_2d.
greens_integral_3d — Line integral along $R$ of the 3-D kernel times a source density. Reference source
Also exported as vaft.formula.greens_integral_3d.
mutual_inductance — Mutual inductance between two rectangular-cross-section ring coils. Reference source
Also exported as vaft.formula.mutual_inductance.
vaft.formula.impurity
Impurity-mixture algebra: moments, target-Z_eff densities, the reduced pseudo-impurity and main-ion dilution.
dilution_fraction_from_species — Main-ion dilution from an explicit impurity species list. Reference source
Also exported as vaft.formula.dilution_fraction_from_species.
dilution_fraction_from_zeff — Main-ion dilution from Z_eff and one effective impurity charge. Reference source
Also exported as vaft.formula.dilution_fraction_from_zeff.
EffectiveImpurity
class
source
EffectiveImpurity(charge: np.ndarray, density: np.ndarray, mass: Optional[np.ndarray])
One pseudo-impurity carrying a mixture’s charge, Z^2 and mass moments [-].
Also exported as vaft.formula.EffectiveImpurity.
expand_effective_impurity — Species densities of a known relative composition behind a pseudo-impurity. Reference source
Also exported as vaft.formula.expand_effective_impurity.
impurity_mixture_moments — Charge and mass moments of a normalised impurity mixture. Reference source
Also exported as vaft.formula.impurity_mixture_moments.
ImpurityMixtureSolution
class
source
ImpurityMixtureSolution(impurity_fractions: np.ndarray, main_ion_fraction: np.ndarray, alpha: np.ndarray)
Absolute density fractions that realise a target effective charge [-].
Also exported as vaft.formula.ImpurityMixtureSolution.
main_ion_density_from_species — Main-ion density that keeps a plasma with these impurities quasi-neutral. Reference source
Also exported as vaft.formula.main_ion_density_from_species.
main_ion_density_from_zeff — Main-ion density from n_e, Z_eff and one effective impurity charge. Reference source
Also exported as vaft.formula.main_ion_density_from_zeff.
main_ion_fraction_from_zeff — Main-ion fraction of the electron density from Z_eff and one effective impurity charge. Reference source
Also exported as vaft.formula.main_ion_fraction_from_zeff.
MixtureMoments
class
source
MixtureMoments(S1: np.ndarray, S2: np.ndarray, A_bar: Optional[np.ndarray])
Charge and mass moments of a normalised impurity mixture [-].
Also exported as vaft.formula.MixtureMoments.
vaft.formula.kinetic
Collisional closures of a multi-species plasma: collision times, energy exchange and classical diffusivities.
braginskii_gamma1_perp_from_Z — Braginskii’s electron perpendicular heat-conductivity coefficient $\gamma_1’(Z)$. Reference source
Also exported as vaft.formula.braginskii_gamma1_perp_from_Z.
classical_electron_heat_diffusivity_from_T_e_B — Braginskii perpendicular electron heat diffusivity, strongly magnetised limit. Reference source
Also exported as vaft.formula.classical_electron_heat_diffusivity_from_T_e_B.
classical_ion_heat_diffusivity_from_T_i_B — Braginskii perpendicular ion heat diffusivity, strongly magnetised limit. Reference source
Also exported as vaft.formula.classical_ion_heat_diffusivity_from_T_i_B.
electron_collision_time_from_T_e_n_species — Braginskii electron collision time against a mixture of ion species. Reference source
Also exported as vaft.formula.electron_collision_time_from_T_e_n_species.
electron_ion_energy_exchange_time_from_T_e_n_species — Time in which electrons and a mixture of ion species exchange thermal energy. Reference source
Also exported as vaft.formula.electron_ion_energy_exchange_time_from_T_e_n_species.
vaft.formula.magnetics
Magnetic-probe geometry shared by every forward model.
vaft.formula.nbi
Neutral beam injection: particle rate, neutral attenuation along a path, birth density, shine-through.
beam_birth_probability_density — Fast-ion birth probability per unit path length along the beam. Reference source
Also exported as vaft.formula.beam_birth_probability_density.
beam_particle_rate_from_power_energy — Injected particle rate of one monoenergetic beam component. Reference source
Also exported as vaft.formula.beam_particle_rate_from_power_energy.
injected_toroidal_angular_momentum_rate — Toroidal angular momentum carried into the machine per second by the injected particles. Reference source
Also exported as vaft.formula.injected_toroidal_angular_momentum_rate.
neutral_beam_optical_depth — Optical depth accumulated along the beam path, by the trapezoidal rule. Reference source
Also exported as vaft.formula.neutral_beam_optical_depth.
vaft.formula.neoclassical
Analytic neoclassical transport formulas: Sauter and Redl.
banana_width — Radial width of a thermal banana orbit, the conventional estimate. Reference source
Also exported as vaft.formula.banana_width.
BootstrapCoefficients
class
source
BootstrapCoefficients(L31: Numeric, L32: Numeric, L34: Numeric, alpha: Numeric)
The four dimensionless coefficients of the Sauter bootstrap expression.
Also exported as vaft.formula.BootstrapCoefficients.
collisions_per_transit — Collision frequency in units of the transit frequency, $\hat\nu = qR_0\nu/v$. Reference source
Also exported as vaft.formula.collisions_per_transit.
coulomb_logarithm_electron_sauter — Electron Coulomb logarithm $\ln\Lambda_e$ in the Sauter convention. Reference source
Also exported as vaft.formula.coulomb_logarithm_electron_sauter.
coulomb_logarithm_ion_sauter — Ion-ion Coulomb logarithm $\ln\Lambda_{ii}$ in the Sauter convention. Reference source
Also exported as vaft.formula.coulomb_logarithm_ion_sauter.
deeply_trapped_bounce_frequency — Bounce frequency of a deeply trapped particle, the small-amplitude limit of the banana orbit. Reference source
Also exported as vaft.formula.deeply_trapped_bounce_frequency.
electron_collisionality_sauter — Normalised electron collisionality $\nu_e^*$ in the Sauter convention. Reference source
Also exported as vaft.formula.electron_collisionality_sauter.
ion_collisionality_sauter — Normalised ion collisionality $\nu_i^*$ in the Sauter convention. Reference source
Also exported as vaft.formula.ion_collisionality_sauter.
neoclassical_regime_boundaries — Banana–plateau and plateau–Pfirsch–Schl"uter orderings in $\hat\nu$. Reference source
Also exported as vaft.formula.neoclassical_regime_boundaries.
redl_bootstrap_coefficients — The Redl 2021 bootstrap coefficients $L_{31}$, $L_{32}$, $L_{34}$, $\alpha$. Reference source
Also exported as vaft.formula.redl_bootstrap_coefficients.
redl_bootstrap_current — Flux-surface-averaged bootstrap current $\langle j_\parallel B\rangle$, Redl 2021. Reference source
Also exported as vaft.formula.redl_bootstrap_current.
redl_neoclassical_conductivity — Neoclassical parallel conductivity $\sigma_{\mathrm{neo}}$, Redl 2021. Reference source
Also exported as vaft.formula.redl_neoclassical_conductivity.
sauter_bootstrap_coefficients — The Sauter 1999 bootstrap coefficients $L_{31}$, $L_{32}$, $L_{34}$, $\alpha$. Reference source
Also exported as vaft.formula.sauter_bootstrap_coefficients.
sauter_bootstrap_current — Flux-surface-averaged bootstrap current $\langle j_\parallel B\rangle$, Sauter 1999. Reference source
Also exported as vaft.formula.sauter_bootstrap_current.
sauter_neoclassical_conductivity — Neoclassical parallel conductivity $\sigma_{\mathrm{neo}}$, Sauter 1999. Reference source
Also exported as vaft.formula.sauter_neoclassical_conductivity.
sauter_spitzer_conductivity — Spitzer parallel conductivity $\sigma_{\mathrm{Sptz}}$ in the Sauter normalisation. Reference source
Also exported as vaft.formula.sauter_spitzer_conductivity.
transit_frequency — Poloidal transit frequency of a passing particle on a large-aspect-ratio circular surface. Reference source
Also exported as vaft.formula.transit_frequency.
vaft.formula.ntv
Neoclassical toroidal viscosity: the analytic relations of transport in broken toroidal symmetry.
vaft.formula.ordering
Asymptotic ordering parameters: the scale separations reduced models assume.
alfven_time — Alfven transit time across a characteristic length. Reference source
Also exported as vaft.formula.alfven_time.
braginskii_electron_collision_time — Braginskii electron collision time. Reference source
Also exported as vaft.formula.braginskii_electron_collision_time.
braginskii_ion_collision_time — Braginskii ion collision time. Reference source
Also exported as vaft.formula.braginskii_ion_collision_time.
evolution_time — Evolution time of a state variable from its rate of change. Reference source
Also exported as vaft.formula.evolution_time.
inertial_length — Inertial (skin) length of a species: the light speed over its plasma frequency. Reference source
Also exported as vaft.formula.inertial_length.
knudsen_number — Knudsen number: mean free path over a characteristic length. Reference source
Also exported as vaft.formula.knudsen_number.
lundquist_number — Lundquist number: resistive diffusion time over Alfven time. Reference source
Also exported as vaft.formula.lundquist_number.
mach_number — Mach number of a flow against a reference speed. Reference source
Also exported as vaft.formula.mach_number.
magnetic_reynolds_number — Magnetic Reynolds number: flux advection against resistive diffusion. Reference source
Also exported as vaft.formula.magnetic_reynolds_number.
magnetization — Magnetization of a species: gyro-orbits per collision time. Reference source
Also exported as vaft.formula.magnetization.
mean_free_path — Mean free path: thermal speed times collision time. Reference source
Also exported as vaft.formula.mean_free_path.
pressure_anisotropy — Pressure anisotropy relative to the scalar pressure. Reference source
Also exported as vaft.formula.pressure_anisotropy.
resistive_diffusion_time — Resistive diffusion time of magnetic field across a characteristic length. Reference source
Also exported as vaft.formula.resistive_diffusion_time.
vaft.formula.particle
Single-particle motion in magnetic and electric fields.
boris_orbit — Charged-particle orbit from the Lorentz force, by the Boris scheme. Reference source
Also exported as vaft.formula.boris_orbit.
bounce_harmonic_detuning — Frequency mismatch of a trapped orbit with a toroidal-$n$ perturbation at bounce harmonic $\ell$. Reference source
Also exported as vaft.formula.bounce_harmonic_detuning.
canonical_toroidal_momentum — Canonical toroidal angular momentum of a particle in an axisymmetric field. Reference source
Also exported as vaft.formula.canonical_toroidal_momentum.
curvature_drift_velocity — Curvature drift velocity of the guiding centre. Reference source
Also exported as vaft.formula.curvature_drift_velocity.
exb_drift_velocity — E-cross-B drift velocity of the guiding centre. Reference source
Also exported as vaft.formula.exb_drift_velocity.
grad_b_drift_velocity — Grad-B drift velocity of the guiding centre. Reference source
Also exported as vaft.formula.grad_b_drift_velocity.
guiding_center_toroidal_momentum — Canonical toroidal momentum of a guiding centre, flux plus mechanical parts. Reference source
Also exported as vaft.formula.guiding_center_toroidal_momentum.
gyration_offset — Position of a gyrating particle relative to its guiding centre. Reference source
Also exported as vaft.formula.gyration_offset.
gyrofrequency — Signed gyrofrequency of a charged particle. Reference source
Also exported as vaft.formula.gyrofrequency.
larmor_radius — Larmor (gyro) radius of a charged particle. Reference source
Also exported as vaft.formula.larmor_radius.
magnetic_moment — Magnetic moment of a gyrating particle, the first adiabatic invariant. Reference source
Also exported as vaft.formula.magnetic_moment.
vaft.formula.pwi
Plasma-wall interaction: collision kinematics, reflection and recycling definitions, sputtering threshold.
binary_collision_energy_transfer_factor — Largest fraction of a projectile’s energy one elastic collision can give a target atom. Reference source
Also exported as vaft.formula.binary_collision_energy_transfer_factor.
mean_reflected_energy_fraction — Mean energy of a reflected particle, as a fraction of the incident energy. Reference source
Also exported as vaft.formula.mean_reflected_energy_fraction.
vaft.formula.regularized_profiles
Positive, regular flux-function profiles; independent of machine and ODS.
API_VERSION
data
API_VERSION = 'regularized-flux-profile-v1'
evaluate_regularized_profile — Evaluate a positive regular flux profile or its flux derivative. Reference source
fit_regularized_profile — Fit independent samples with Huber residuals and quadratic curvature. Reference source
profile_basis — Evaluate the positive profile basis or its flux-coordinate derivatives. Reference source
RegularizedProfileConfig
class
source
RegularizedProfileConfig(basis: str = 'bernstein2', scale: float = 1.0, domain_max: float = 1.0, huber_delta: float = 1.0, regularization: float = 0.0001, floor: float = 1e-10, max_nfev: int = 2000, tolerance: float = 1e-09, condition_limit: float = 10000000000.0, knot_fractions: tuple[float, float] = (0.7, 0.9)) -> None
Serializable numerical assumptions, not measurement uncertainties.
10 fields · 1 members
basis: strscale: floatdomain_max: floathuber_delta: floatregularization: floatfloor: floatmax_nfev: inttolerance: floatcondition_limit: floatknot_fractions: tuple[float, float]coefficient_countproperty source
RegularizedProfileFit
class
source
RegularizedProfileFit(config: RegularizedProfileConfig, parameters: np.ndarray, status: str, reason: str | None, diagnostics: dict, version: str = 'regularized-flux-profile-v1') -> None
A conditional fitted profile, never a measured uncertainty estimate.
vaft.formula.ripple
Toroidal-field ripple from a finite number of TF coils, and its orbit consequences.
gwb_stochastic_threshold — Goldston–White–Boozer ripple above which banana-tip motion is stochastic. Reference source
Also exported as vaft.formula.gwb_stochastic_threshold.
gwb_stochasticity_parameter — Ripple over its GWB threshold: stochastic banana tips where it exceeds 1. Reference source
Also exported as vaft.formula.gwb_stochasticity_parameter.
ripple_amplitude — Ripple amplitude from the extreme field strengths along the toroidal angle. Reference source
Also exported as vaft.formula.ripple_amplitude.
ripple_trapping_pitch —
| Largest pitch $ | v_\parallel/v | $ trapped in a ripple well of depth $\delta$. |
Also exported as
vaft.formula.ripple_trapping_pitch.vaft.formula.sensitivity
Generic kernels for local sensitivity, linear uncertainty propagation and identifiability (issue #1642).
finite_difference_jacobian — Jacobian of a vector function by forward or central differences. Reference source
Also exported as vaft.formula.finite_difference_jacobian.
FormulaPropagation
class
source
FormulaPropagation(value: np.ndarray, covariance: np.ndarray, std: np.ndarray, input_names: tuple, input_covariance: np.ndarray, method: str, jacobian: Optional[np.ndarray] = None, derivative_method: Optional[str] = None, linearity: Optional[float] = None, mc_mean: Optional[np.ndarray] = None, samples: Optional[int] = None, rejected: Optional[int] = None, fixed: Mapping[str, object] = <factory>) -> None
The result of propagate_formula_uncertainty: values with their provenance.
Also exported as vaft.formula.FormulaPropagation.
13 fields
value: np.ndarraycovariance: np.ndarraystd: np.ndarrayinput_names: tupleinput_covariance: np.ndarraymethod: strjacobian: Optional[np.ndarray]derivative_method: Optional[str]linearity: Optional[float]mc_mean: Optional[np.ndarray]samples: Optional[int]rejected: Optional[int]fixed: Mapping[str, object]
linear_covariance_propagation — Output covariance of a linearized model, correlations included. Reference source
Also exported as vaft.formula.linear_covariance_propagation.
linearity_ratio — How much of a finite response the linearization misses. Reference source
Also exported as vaft.formula.linearity_ratio.
monte_carlo_propagation — Output mean and covariance by sampling Gaussian inputs through the full model. Reference source
Also exported as vaft.formula.monte_carlo_propagation.
vaft.formula.sol
Scrape-off layer: sound speed, sheath fluxes, parallel conduction and the target heat-flux profile.
blob_collisionality — The collisionality that decides whether a filament stays connected to the sheaths. Reference source
Also exported as vaft.formula.blob_collisionality.
blob_crossover_size — Normalized size at which the inertial and sheath-connected limits give the same velocity. Reference source
Also exported as vaft.formula.blob_crossover_size.
blob_density_perturbation — The prescribed filament state: a Gaussian density perturbation on a background. Reference source
Also exported as vaft.formula.blob_density_perturbation.
blob_reference_size — The blob size at which sheath and polarization closure balance. Reference source
Also exported as vaft.formula.blob_reference_size.
blob_reference_velocity — The blob velocity scale at the reference size. Reference source
Also exported as vaft.formula.blob_reference_velocity.
blob_regime_velocities — The normalized velocity of each regime of the two-region (midplane plus X-point) model. Reference source
Also exported as vaft.formula.blob_regime_velocities.
BlobRegimeVelocities
class
source
BlobRegimeVelocities(resistive_ballooning: np.ndarray, resistive_x_point: np.ndarray, sheath_connected: np.ndarray, connected_ideal_interchange: np.ndarray)
Normalized radial velocities $\hat v$ of the four regimes of the two-region model [-].
Also exported as vaft.formula.BlobRegimeVelocities.
eich_integral_width — Integral power width of the Eich profile, mapped to the outer midplane. Reference source
Also exported as vaft.formula.eich_integral_width.
eich_target_heat_flux_profile — Target heat-flux profile: an exponential SOL decay convolved with Gaussian spreading. Reference source
Also exported as vaft.formula.eich_target_heat_flux_profile.
inertial_blob_velocity — Radial velocity of a blob whose polarization current closes across the field (inertia). Reference source
Also exported as vaft.formula.inertial_blob_velocity.
interpolated_blob_velocity — Normalized blob velocity bridging the inertial and sheath-connected limits. Reference source
Also exported as vaft.formula.interpolated_blob_velocity.
ion_saturation_current_density — Ion saturation current density collected by a negatively biased surface. Reference source
Also exported as vaft.formula.ion_saturation_current_density.
ion_sound_speed — Ion sound speed with the charge and the ion closure explicit. Reference source
Also exported as vaft.formula.ion_sound_speed.
radiative_condensation_growth_rate — Growth rate of the thermal-condensation (MARFE) instability at constant pressure. Reference source
Also exported as vaft.formula.radiative_condensation_growth_rate.
radiative_thermal_instability_growth_rate — Growth rate of the radiative thermal instability of a flute perturbation at constant density. Reference source
Also exported as vaft.formula.radiative_thermal_instability_growth_rate.
sheath_connected_blob_velocity — Radial velocity of a blob whose polarization current closes through the sheaths. Reference source
Also exported as vaft.formula.sheath_connected_blob_velocity.
sheath_heat_flux — Parallel heat-flux density into the target sheath. Reference source
Also exported as vaft.formula.sheath_heat_flux.
sheath_particle_flux — Particle flux density into the target sheath. Reference source
Also exported as vaft.formula.sheath_particle_flux.
vaft.formula.stability
Plasma stability, operational limits, and transport calculations.
ballooning_alpha_from_p_B_R — Normalised pressure gradient $\alpha$ of the $s$-$\alpha$ ballooning model. Reference source
Also exported as vaft.formula.ballooning_alpha_from_p_B_R.
ballooning_radial_wavenumber — Radial wavenumber of a ballooning mode along the field line, in the $s$-$\alpha$ local frame. Reference source
Also exported as vaft.formula.ballooning_radial_wavenumber.
ballooning_stability_criterion — Distance from the first ballooning stability boundary $\alpha_{crit} \approx 0.6\,s$. Reference source
Also exported as vaft.formula.ballooning_stability_criterion.
beta_N_from_beta_a_B0_Ip — Normalised beta in the Troyon convention, %·m·T/MA. Reference source
Also exported as vaft.formula.beta_N_from_beta_a_B0_Ip.
beta_pol_from_beta_tor — Poloidal beta from toroidal beta, cylindrical relation. Reference source
Also exported as vaft.formula.beta_pol_from_beta_tor.
beta_stability_boundary Deprecated — Deprecated: fraction-convention twin of kink_stability_criterion; use the troyon boundary. Reference source
Also exported as vaft.formula.beta_stability_boundary.
beta_tor_from_beta_pol — Toroidal beta from poloidal beta, cylindrical relation. Reference source
Also exported as vaft.formula.beta_tor_from_beta_pol.
bussac_internal_kink_energy — Reduced toroidal $m = n = 1$ internal-kink energy of Bussac et al., up to its positive prefactor. Reference source
Also exported as vaft.formula.bussac_internal_kink_energy.
bussac_poloidal_beta — Bussac’s poloidal beta inside the $q = 1$ surface. Reference source
Also exported as vaft.formula.bussac_poloidal_beta.
c_s_from_Te_Ti_mi — Isothermal ion sound speed $c_s = \sqrt{(T_e + T_i)/m_i}$. Reference source
Also exported as vaft.formula.c_s_from_Te_Ti_mi.
collisionality_from_n_T_B_R — Electron collisionality figure $6.921\times10^{-18}\,n_e R_0/(T_e^2 B_t)$. Reference source
Also exported as vaft.formula.collisionality_from_n_T_B_R.
delta_prime_from_outer_derivatives — Tearing stability index from the outer solution’s derivatives at the rational surface. Reference source
Also exported as vaft.formula.delta_prime_from_outer_derivatives.
empirical_li_qa — Vertices of the JET empirical $l_i$-$q_\psi$ stability boundary (Wesson 1989, Fig. 6). Reference source
Also exported as vaft.formula.empirical_li_qa.
field_line_label — Clebsch field-line label on a flux surface in straight-field-line coordinates. Reference source
Also exported as vaft.formula.field_line_label.
ggj_ideal_interchange_index — Glasser–Greene–Johnson ideal-interchange (Mercier) index $D_I$ from the layer coefficients. Reference source
Also exported as vaft.formula.ggj_ideal_interchange_index.
ggj_resistive_interchange_index — Glasser–Greene–Johnson resistive-interchange index $D_R$ from the layer coefficients. Reference source
Also exported as vaft.formula.ggj_resistive_interchange_index.
ggj_resistive_interchange_index_from_ideal — GGJ resistive-interchange index $D_R$ from the ideal index $D_I$ and $H$. Reference source
Also exported as vaft.formula.ggj_resistive_interchange_index_from_ideal.
greenwald_density — Greenwald density limit $n_G$. Reference source
Also exported as vaft.formula.greenwald_density.
greenwald_fraction — Greenwald fraction $f_G = n_e/n_G$. Reference source
Also exported as vaft.formula.greenwald_fraction.
helical_harmonic — The real perturbation carried by one complex $m/n$ Fourier coefficient. Reference source
Also exported as vaft.formula.helical_harmonic.
helical_phase — Helical phase of an $m/n$ perturbation at a point on a flux surface. Reference source
Also exported as vaft.formula.helical_phase.
island_pendulum_hamiltonian — Local flux function of a constant-$\psi$ magnetic island. Reference source
Also exported as vaft.formula.island_pendulum_hamiltonian.
island_separatrix_half_width — Radial half-width of the island separatrix at a given helical phase. Reference source
Also exported as vaft.formula.island_separatrix_half_width.
island_width_from_resonant_flux — Full magnetic island width from the pitch-resonant flux. Reference source
Also exported as vaft.formula.island_width_from_resonant_flux.
kadomtsev_mixing_radius — Kadomtsev mixing radius: where the $m/n = 1/1$ helical flux returns to its axis value. Reference source
Also exported as vaft.formula.kadomtsev_mixing_radius.
kink_stability_criterion Deprecated — Deprecated: heuristic margin against an unsourced $\beta_{N,crit} = 2.8\,q_{95}$; use the troyon boundary. Reference source
Also exported as vaft.formula.kink_stability_criterion.
li_from_qa_empirical — Internal inductance at a given $q_a$ by interpolating the JET survey points. Reference source
Also exported as vaft.formula.li_from_qa_empirical.
magnetic_well_from_specific_volume — Normalised magnetic well from the specific volume $V’$ against toroidal flux. Reference source
Also exported as vaft.formula.magnetic_well_from_specific_volume.
magnetosonic_phase_speeds — Fast and slow magnetosonic phase speeds at angle $\theta$ to $\mathbf B_0$. Reference source
Also exported as vaft.formula.magnetosonic_phase_speeds.
mercier_criterion_circular — Mercier’s interchange criterion for a large-aspect-ratio circular tokamak. Reference source
Also exported as vaft.formula.mercier_criterion_circular.
plasma_stability_margins Deprecated — Deprecated: beta, $q_{95}$ and density margins built on the unsourced $0.028\,q_{95}$ beta limit. Reference source
Also exported as vaft.formula.plasma_stability_margins.
power_limit_from_beta — Energy-like figure $\beta_N B_0^2 V/(2\mu_0)$ labelled a power limit. Reference source
Also exported as vaft.formula.power_limit_from_beta.
power_limit_from_q — Expression $2\pi R_0 I_p/(\mu_0 q_{95})$ labelled a power limit. Reference source
Also exported as vaft.formula.power_limit_from_q.
resonant_flux_from_delta — Pitch-resonant flux from the resonance parameter and the surface geometry. Reference source
Also exported as vaft.formula.resonant_flux_from_delta.
rhostar_from_Te_a_Bt — Normalised electron gyroradius $\rho_e/a$. Reference source
Also exported as vaft.formula.rhostar_from_Te_a_Bt.
s_alpha_ballooning_eigenmode — The most unstable localised eigenmode of the $s$-$\alpha$ ballooning equation with inertia. Reference source
Also exported as vaft.formula.s_alpha_ballooning_eigenmode.
s_alpha_ballooning_solution — The even solution $F(\theta)$ of the marginal $s$-$\alpha$ ballooning equation. Reference source
Also exported as vaft.formula.s_alpha_ballooning_solution.
s_alpha_ballooning_stable — Ideal ballooning stability of the circular $s$-$\alpha$ model. Reference source
Also exported as vaft.formula.s_alpha_ballooning_stable.
s_alpha_curvature_drive — Normal-curvature drive of the $s$-$\alpha$ ballooning equation along the extended angle. Reference source
Also exported as vaft.formula.s_alpha_curvature_drive.
s_alpha_marginal_alpha — First and second ballooning stability boundaries of the $s$-$\alpha$ model. Reference source
Also exported as vaft.formula.s_alpha_marginal_alpha.
sawtooth_stability_criterion Deprecated — Deprecated: heuristic margin against an unsourced $\beta_{p,crit} = 0.3\,(1 - q_0)$; no replacement. Reference source
Also exported as vaft.formula.sawtooth_stability_criterion.
shear_alfven_frequency — Frequency of the ideal shear Alfven wave in a uniform plasma. Reference source
Also exported as vaft.formula.shear_alfven_frequency.
slab_perturbed_flux — Helical flux of a sheared slab with a tearing- or twisting-parity perturbation. Reference source
Also exported as vaft.formula.slab_perturbed_flux.
vaft.formula.startup
Start-up physics from the gas fill to the first closed flux surfaces.
atomic_inventory_from_molecular_gas — Atom inventory of a molecular gas fill. Reference source
Also exported as vaft.formula.atomic_inventory_from_molecular_gas.
boundary_loop_voltage_terms_from_L_e_I_p_M_pj_I_j — Boundary loop voltage split into the four ways the boundary flux can change. Reference source
Also exported as vaft.formula.boundary_loop_voltage_terms_from_L_e_I_p_M_pj_I_j.
breakdown_margin — Available drive relative to the Lloyd breakdown threshold. Reference source
Also exported as vaft.formula.breakdown_margin.
critical_ionization_fraction_from_V_p_V_V — Ionisation fraction at the top of the radiation-ionisation barrier. Reference source
Also exported as vaft.formula.critical_ionization_fraction_from_V_p_V_V.
d_plasma_inductance_dR_hirshman_from_R_eps_kappa_li — Radial derivative of the Hirshman plasma inductance. Reference source
Also exported as vaft.formula.d_plasma_inductance_dR_hirshman_from_R_eps_kappa_li.
ejiri_f3_from_alpha — Low-temperature geometry factor of the Ejiri mirror proxy. Reference source
Also exported as vaft.formula.ejiri_f3_from_alpha.
ejiri_mirror_alpha_from_R_S_R_LIN_R_C_Z_max — Slope of the Ejiri confined-orbit boundary in velocity space. Reference source
Also exported as vaft.formula.ejiri_mirror_alpha_from_R_S_R_LIN_R_C_Z_max.
electron_cyclotron_resonance_field — Field magnitude at which electrons gyrate in step with a microwave source. Reference source
Also exported as vaft.formula.electron_cyclotron_resonance_field.
electron_cyclotron_resonance_radius — Major radius of the electron-cyclotron resonance in a vacuum toroidal field. Reference source
Also exported as vaft.formula.electron_cyclotron_resonance_radius.
flux_closure_margin_from_E_t_a_B_stray_eta — Order-of-magnitude margin for a current channel to overcome stray field. Reference source
Also exported as vaft.formula.flux_closure_margin_from_E_t_a_B_stray_eta.
internal_inductive_voltage_terms_from_L_i_I_p — Inductive voltage of the internal inductance, split into ramp and profile terms. Reference source
Also exported as vaft.formula.internal_inductive_voltage_terms_from_L_i_I_p.
ionization_fraction_from_n_e_n_D0 — Ionisation fraction of a partially ionised hydrogenic plasma. Reference source
Also exported as vaft.formula.ionization_fraction_from_n_e_n_D0.
lloyd_breakdown_field — Lloyd threshold toroidal field for hydrogenic tokamak breakdown. Reference source
Also exported as vaft.formula.lloyd_breakdown_field.
lloyd_figure_of_merit — Lloyd’s breakdown figure of merit: toroidal drive times field-line pitch. Reference source
Also exported as vaft.formula.lloyd_figure_of_merit.
LLOYD_FIGURE_OF_MERIT_ECH_V_PER_M
data
LLOYD_FIGURE_OF_MERIT_ECH_V_PER_M = 100.0
LLOYD_FIGURE_OF_MERIT_OHMIC_V_PER_M
data
LLOYD_FIGURE_OF_MERIT_OHMIC_V_PER_M = 1000.0
lr_time_from_L_R — Characteristic time of an inductive-resistive circuit. Reference source
Also exported as vaft.formula.lr_time_from_L_R.
neutral_density_after_ionization_from_n_0_n_e_V_p_V_V — Neutral atom density left in the vessel after some has been ionised. Reference source
Also exported as vaft.formula.neutral_density_after_ionization_from_n_0_n_e_V_p_V_V.
neutral_density_from_pressure — Number density of a fill gas at a measured pressure and temperature. Reference source
Also exported as vaft.formula.neutral_density_from_pressure.
plasma_current_derivative_lumped_from_V_loop_R_p_I_p_L_p — Rate of change of plasma current in a lumped single-loop circuit. Reference source
Also exported as vaft.formula.plasma_current_derivative_lumped_from_V_loop_R_p_I_p_L_p.
plasma_external_inductance_hirshman_from_R_eps_kappa — External inductance of a shaped plasma, Hirshman and Neilson’s fit. Reference source
Also exported as vaft.formula.plasma_external_inductance_hirshman_from_R_eps_kappa.
plasma_inductance_circular_from_R0_a_li — Self-inductance of a high-aspect-ratio plasma ring, Mitarai’s form. Reference source
Also exported as vaft.formula.plasma_inductance_circular_from_R0_a_li.
plasma_inductance_hirshman_from_R_eps_kappa_li — Total plasma inductance, Hirshman external plus the internal term. Reference source
Also exported as vaft.formula.plasma_inductance_hirshman_from_R_eps_kappa_li.
plasma_resistance_uniform_ellipse_from_eta_R0_a_kappa — Loop resistance of a uniform-current elliptical plasma ring. Reference source
Also exported as vaft.formula.plasma_resistance_uniform_ellipse_from_eta_R0_a_kappa.
plasma_self_field_from_I_p_a — Poloidal field a circular current channel makes at its own edge. Reference source
Also exported as vaft.formula.plasma_self_field_from_I_p_a.
radiation_ionization_barrier_from_P_RI_n_0_V_V — Height of the radiation-ionisation barrier a burn-through must cross. Reference source
Also exported as vaft.formula.radiation_ionization_barrier_from_P_RI_n_0_V_V.
radiation_ionization_power_from_P_RI_n_e_n_D0_V_p — Radiation and ionisation power lost by a partially ionised plasma. Reference source
Also exported as vaft.formula.radiation_ionization_power_from_P_RI_n_e_n_D0_V_p.
resistivity_from_n_e_nu_e — Resistivity from the electron momentum-transfer collision frequency. Reference source
Also exported as vaft.formula.resistivity_from_n_e_nu_e.
startup_geometry_from_limiter_radii — Geometric centre and minor radius of the limiter aperture. Reference source
Also exported as vaft.formula.startup_geometry_from_limiter_radii.
townsend_breakdown_field — Breakdown threshold field of a gas, by inverting the Townsend closure. Reference source
Also exported as vaft.formula.townsend_breakdown_field.
townsend_breakdown_field_for_gas — Breakdown threshold field of a catalogued fill gas, pressure in pascal. Reference source
Also exported as vaft.formula.townsend_breakdown_field_for_gas.
townsend_coefficients_for_gas — Townsend similarity coefficients of a catalogued fill gas, in SI. Reference source
Also exported as vaft.formula.townsend_coefficients_for_gas.
vaft.formula.statistics
Pure statistical kernels for residual and convergence diagnostics (issue #186).
bias_standard_error — Standard error of the mean of $n$ unit-variance samples, $1/\sqrt{n}$. Reference source
Also exported as vaft.formula.bias_standard_error.
chi_squared — Chi-square, $\sum_i (r_i/\sigma_i)^2$ over the finite terms. Reference source
Also exported as vaft.formula.chi_squared.
dynamic_range — Sample range, $\max - \min$ over the finite entries. Reference source
Also exported as vaft.formula.dynamic_range.
fractional_rms_improvement — Fractional RMS improvement, $1 - \mathrm{RMS}(r)/\mathrm{RMS}(r_0)$. Reference source
Also exported as vaft.formula.fractional_rms_improvement.
lag1_autocorrelation — Lag-1 autocorrelation of the finite entries, in the order given. Reference source
Also exported as vaft.formula.lag1_autocorrelation.
linear_trend — Least-squares slope of $y$ against $x$, in units of $y$ per unit $x$. Reference source
Also exported as vaft.formula.linear_trend.
log10_decay_rate — Least-squares slope of $\log_{10}x$ against iteration index over the tail. Reference source
Also exported as vaft.formula.log10_decay_rate.
median_absolute_deviation —
| Median absolute deviation, $\mathrm{median}( | x - \mathrm{median}(x) | )$. |
Also exported as
vaft.formula.median_absolute_deviation.monotonic_fraction — Fraction of consecutive steps in which the sequence decreased. Reference source
Also exported as vaft.formula.monotonic_fraction.
noise_band — Mean and population standard deviation of a reference (effect-free) sample. Reference source
Also exported as vaft.formula.noise_band.
normalized_residual — Residuals in units of the fitted uncertainty, $z = r\,w/k$. Reference source
Also exported as vaft.formula.normalized_residual.
outlier_fraction —
| Fraction of finite entries with $ | x_i | > \mathrm{level}$. |
Also exported as
vaft.formula.outlier_fraction.pearson_correlation — Pearson correlation of two series over their pairwise-finite samples. Reference source
Also exported as vaft.formula.pearson_correlation.
percentile_scale — A high percentile of |x| over the finite entries, an amplitude scale one anomalous sample cannot set. Reference source
Also exported as vaft.formula.percentile_scale.
reduced_chi_squared — Reduced chi-square, $\chi^2/\nu$ per degree of freedom. Reference source
Also exported as vaft.formula.reduced_chi_squared.
relative_spread —
| Relative spread, $(\max - \min)/\max | x | $ over the finite entries. |
Also exported as
vaft.formula.relative_spread.residual_bias — Mean of the finite entries, the systematic offset of a residual sample. Reference source
Also exported as vaft.formula.residual_bias.
rms — Root mean square, $\sqrt{\mathrm{mean}(x_i^2)}$, over the finite entries. Reference source
Also exported as vaft.formula.rms.
robust_z_scores — Deviation from the median in robust sigma units, sample by sample. Reference source
Also exported as vaft.formula.robust_z_scores.
runs_test_z — Wald-Wolfowitz runs-test z-score for the sign sequence of a sample. Reference source
Also exported as vaft.formula.runs_test_z.
vaft.formula.transformer
The plasma as a transformer secondary: Romero’s exact current and inductance balance.
current_weighted_flux_from_psi_j_dS — Current-weighted average of the poloidal flux over the plasma cross-section. Reference source
Also exported as vaft.formula.current_weighted_flux_from_psi_j_dS.
equilibrium_surface_voltage_from_I_p_dL_i_V_R — Voltage at the equilibrium flux surface, inferred from the inductance history. Reference source
Also exported as vaft.formula.equilibrium_surface_voltage_from_I_p_dL_i_V_R.
equilibrium_surface_voltage_from_L_i_dI_p_V_B_V_R — Voltage at the equilibrium flux surface, inferred from the current history. Reference source
Also exported as vaft.formula.equilibrium_surface_voltage_from_L_i_dI_p_V_B_V_R.
internal_inductance_from_psi_C_psi_B_I_p — Dimensional internal inductance from the equilibrium and boundary fluxes. Reference source
Also exported as vaft.formula.internal_inductance_from_psi_C_psi_B_I_p.
internal_inductance_rate_from_I_p_V_R_V_C — Rate of change of the internal inductance, Romero’s exact balance. Reference source
Also exported as vaft.formula.internal_inductance_rate_from_I_p_V_R_V_C.
plasma_current_rate_from_L_i_V_B_V_C_V_R — Rate of change of the plasma current, Romero’s exact balance. Reference source
Also exported as vaft.formula.plasma_current_rate_from_L_i_V_B_V_C_V_R.
vaft.formula.turbulence
Two-variable turbulence–zonal-flow predator–prey model (Lotka–Volterra form).
predator_prey_fixed_point — Positive (coexistence) fixed point of the predator–prey model. Reference source
Also exported as vaft.formula.predator_prey_fixed_point.
predator_prey_invariant — Conserved quantity of the classical predator–prey model. Reference source
Also exported as vaft.formula.predator_prey_invariant.
predator_prey_period — Small-amplitude oscillation period about the positive fixed point. Reference source
Also exported as vaft.formula.predator_prey_period.
vaft.formula.utils
Utility functions for plasma physics calculations.
calculate_peaking_factor — Peaking factor, central value over volume average. Reference source
Also exported as vaft.formula.calculate_peaking_factor.
calculate_poloidal_flux — Poloidal flux per radian from a line integral of $RB_\theta$. Reference source
Also exported as vaft.formula.calculate_poloidal_flux.
calculate_toroidal_flux — Toroidal flux as a sum of $B_\varphi$ over area elements. Reference source
Also exported as vaft.formula.calculate_toroidal_flux.
calculate_volume_weighted_average — Volume-weighted average of a sampled profile. Reference source
Also exported as vaft.formula.calculate_volume_weighted_average.
eped_tanh_bounds — Parameter box the eped_tanh fit uses for this data. Reference source
Also exported as vaft.formula.eped_tanh_bounds.
fit_profile — Fit a 1-D profile with a selectable model and evaluate it on a grid. Reference source
Also exported as vaft.formula.fit_profile.
gp_fit — Fit a squared-exponential Gaussian process and evaluate it on a grid. Reference source
Also exported as vaft.formula.gp_fit.
gradient — Derivative $dy/dx$ along the first axis of a sampled profile or map. Reference source
Also exported as vaft.formula.gradient.
make_fit_function — Build a 1-D parametric model $f(x; c_0, c_1, \dots)$ for profile fitting. Reference source
Also exported as vaft.formula.make_fit_function.
normalize_profile — Linear normalisation of a profile between its axis and boundary values. Reference source
Also exported as vaft.formula.normalize_profile.
vaft.formula.vde
Vertical displacement events: local motion, wall response and halo-current descriptors.
halo_current_fraction — Halo-current fraction: peak poloidal halo current over the pre-disruption plasma current. Reference source
Also exported as vaft.formula.halo_current_fraction.
thin_wall_time — Resistive time of a thin cylindrical wall, $\tau_w = \mu_0\sigma db$. Reference source
Also exported as vaft.formula.thin_wall_time.
toroidal_peaking_factor — Toroidal peaking factor of the halo current: maximum over the toroidal mean. Reference source
Also exported as vaft.formula.toroidal_peaking_factor.
vde_growth_rate —
| Local growth rate of a vertical displacement, $d\ln | Z - Z_0 | /dt$. |
Also exported as
vaft.formula.vde_growth_rate.vaft.formula.virial
Virial closures: global quantities from the Shafranov boundary integrals.
approximated_diamagnetism_from_B_pa_B_tv_R0_delta_phi — Diamagnetic parameter from the vacuum toroidal field and flux change. Reference source
Also exported as vaft.formula.approximated_diamagnetism_from_B_pa_B_tv_R0_delta_phi.
virial_alpha_approx_from_kappa — Virial closure coefficient from the boundary elongation (Bongard $\hat\alpha_1$). Reference source
Also exported as vaft.formula.virial_alpha_approx_from_kappa.
virial_alpha_from_R_Bz_Bp_dl — Virial closure coefficient from the boundary field (thin-annulus $\hat\alpha_2$). Reference source
Also exported as vaft.formula.virial_alpha_from_R_Bz_Bp_dl.
virial_beta_p_from_S_alpha_mu — Poloidal beta from the Shafranov integrals, low-aspect-ratio closure. Reference source
Also exported as vaft.formula.virial_beta_p_from_S_alpha_mu.
virial_beta_p_from_S_li — Poloidal beta from $S_1$, $S_2$ and a known internal inductance. Reference source
Also exported as vaft.formula.virial_beta_p_from_S_li.
virial_beta_p_from_volume — Poloidal beta from a volume integral of pressure. Reference source
Also exported as vaft.formula.virial_beta_p_from_volume.
virial_beta_p_lao_from_S_mu_rt — Poloidal beta, Lao large-aspect-ratio virial closure. Reference source
Also exported as vaft.formula.virial_beta_p_lao_from_S_mu_rt.
virial_beta_p_li_from_S_alpha_mu_rt — Lao closure bundle: $\beta_p$, $l_i$ and $\beta_{p,d}$ in one call. Reference source
Also exported as vaft.formula.virial_beta_p_li_from_S_alpha_mu_rt.
virial_beta_pd_from_S_mu_rt — Diamagnetic poloidal beta $\beta_{p,d}$ from $S_1$, $S_2$ and $\mu_i$. Reference source
Also exported as vaft.formula.virial_beta_pd_from_S_mu_rt.
virial_bongard_from_S_alpha_mu — Low-aspect-ratio virial closure (Bongard 2016): $\beta_p$ and $l_i$. Reference source
Also exported as vaft.formula.virial_bongard_from_S_alpha_mu.
virial_bp_li_lihat_from_S123 Deprecated — Deprecated historical name for the three-relation virial solve. Reference source
Also exported as vaft.formula.virial_bp_li_lihat_from_S123.
virial_closure_denominators — The denominator each virial closure divides by, for conditioning checks. Reference source
Also exported as vaft.formula.virial_closure_denominators.
virial_D0_boundary_from_bp_li_eK — Boundary Shafranov shift $D_0(b)$ from $\beta_p$, $l_i$ and elongation. Reference source
Also exported as vaft.formula.virial_D0_boundary_from_bp_li_eK.
virial_full_123_from_S_alpha_rt — Solve all three virial relations for $\beta_p$, $l_i$ and $\mu_i$. Reference source
Also exported as vaft.formula.virial_full_123_from_S_alpha_rt.
virial_identity_residuals — Residuals of the three virial identities at a given $(\beta_p, l_i, \mu_i)$. Reference source
Also exported as vaft.formula.virial_identity_residuals.
virial_kinetic_energy — Bulk kinetic energy of a sampled flow, $W_{kin} = \tfrac{1}{2}\sum n m v^2\,V$. Reference source
Also exported as vaft.formula.virial_kinetic_energy.
virial_lao_from_S_alpha_mu_rt — Large-aspect-ratio virial closure (Lao 1985): $\beta_p$ and $l_i$. Reference source
Also exported as vaft.formula.virial_lao_from_S_alpha_mu_rt.
virial_li_from_S_alpha_mu — Internal inductance from the Shafranov integrals, low-aspect-ratio closure. Reference source
Also exported as vaft.formula.virial_li_from_S_alpha_mu.
virial_li_from_S_alpha_rt — Internal inductance, Lao large-aspect-ratio virial closure. Reference source
Also exported as vaft.formula.virial_li_from_S_alpha_rt.
virial_li_from_volume — Internal inductance from a volume integral of $B_p^2$. Reference source
Also exported as vaft.formula.virial_li_from_volume.
virial_magnetic_energy — Magnetic energy of a sampled field, $W_{mag} = \sum B^2\,V/(2\mu_0)$. Reference source
Also exported as vaft.formula.virial_magnetic_energy.
virial_muihat_from_Bt_R0_dphi — Diamagnetic parameter $\hat\mu_i$ from the measured diamagnetic flux. Reference source
Also exported as vaft.formula.virial_muihat_from_Bt_R0_dphi.
virial_normalized_residual — Scale a virial identity residual so shots can be compared. Reference source
Also exported as vaft.formula.virial_normalized_residual.
virial_pair_12_from_S_mu_rt — Virial closure on $E_1$ and $E_2$, leaving $E_3$ free. Reference source
Also exported as vaft.formula.virial_pair_12_from_S_mu_rt.
virial_pair_13_from_S_alpha_mu — Virial closure on $E_1$ and $E_3$, leaving $E_2$ free. Reference source
Also exported as vaft.formula.virial_pair_13_from_S_alpha_mu.
virial_pair_23_from_S_alpha_mu_rt — Virial closure on $E_2$ and $E_3$, leaving $E_1$ free. Reference source
Also exported as vaft.formula.virial_pair_23_from_S_alpha_mu_rt.
virial_residual_rms — Aggregate the three normalised virial residuals into one number. Reference source
Also exported as vaft.formula.virial_residual_rms.
virial_S1_approx — Leading-order value of the first Shafranov integral, $S_1 = 2$. Reference source
Also exported as vaft.formula.virial_S1_approx.
virial_S2_approx_from_D0_a_R0 — Analytic approximation of the second Shafranov integral for an elongated boundary. Reference source
Also exported as vaft.formula.virial_S2_approx_from_D0_a_R0.
virial_S3_approx_from_eK_d — Analytic approximation of the third Shafranov integral for an elongated boundary. Reference source
Also exported as vaft.formula.virial_S3_approx_from_eK_d.
VIRIAL_SINGULAR_EPS
data
VIRIAL_SINGULAR_EPS = 1e-09
virial_stability_criterion Deprecated — Deprecated: the virial ratio minus an unsourced threshold 0.5; use virial_theorem. Reference source
Also exported as vaft.formula.virial_stability_criterion.
vaft.formula.waves
Cold-plasma waves: characteristic frequencies, Stix parameters, refractive indices, cutoffs and resonances.
cma_coordinates — CMA-diagram coordinates of a cold electron plasma. Reference source
Also exported as vaft.formula.cma_coordinates.
cold_plasma_refractive_index_squared — The two roots $n^2$ of the cold-plasma dispersion relation at angle $\theta$ to $\mathbf B_0$. Reference source
Also exported as vaft.formula.cold_plasma_refractive_index_squared.
dielectric_tensor — Cold-plasma dielectric tensor in the frame with $\mathbf B_0 \parallel \hat z$. Reference source
Also exported as vaft.formula.dielectric_tensor.
perpendicular_refractive_index_squared — Ordinary and extraordinary modes at perpendicular propagation. Reference source
Also exported as vaft.formula.perpendicular_refractive_index_squared.
plasma_frequency — Plasma frequency of one species. Reference source
Also exported as vaft.formula.plasma_frequency.
propagation_regime — Classify a refractive index squared: propagating, evanescent, cutoff or resonance. Reference source
Also exported as vaft.formula.propagation_regime.
stix_parameters — Stix parameters of a cold, multi-species, magnetised plasma. Reference source
Also exported as vaft.formula.stix_parameters.
StixParameters
class
source
StixParameters(R: np.ndarray, L: np.ndarray, S: np.ndarray, D: np.ndarray, P: np.ndarray)
The five Stix parameters of the cold-plasma dielectric tensor [-].
Also exported as vaft.formula.StixParameters.