API Reference

Dimensionless numbers

PlasmaFormulary.plasma_betaFunction
plasma_beta(T, n, B)

Compute the plamsa beta (β), the ratio of thermal pressure to magnetic pressure.

Arguments

  • T: The temperature of the plasma.
  • n: The particle density of the plasma.
  • B: The magnetic field in the plasma.

Example

julia> plasma_beta(1e6u"K", 1e19u"m^-3", 0.2u"T")
0.008674873511172188

References

source

Frequencies

PlasmaFormulary.plasma_frequencyFunction
plasma_frequency(n::NumberDensity, [q::Charge, mass::Mass])
plasma_frequency(n::NumberDensity, p::ParticleLike; kw...)

Calculate the plasma frequency of a species.

\[ω_p = \sqrt{\frac{n q^2}{m ε₀}}\]

The plasma frequency is a characteristic frequency of the plasma. More often, it refers to the frequency at which electrons oscillate in the plasma.

Examples

julia> plasma_frequency(1e19u"m^-3")  # plasma frequency
1.7839863654934653e11 rad s⁻¹

julia> plasma_frequency(1e19u"m^-3", :p)  # proton plasma frequency
4.1632945624883513e9 rad s⁻¹

References

source
PlasmaFormulary.gyrofrequencyFunction
gyrofrequency(B::BField, p::ParticleLike; kw...)
gyrofrequency(B::BField, mass::Mass, q::Charge)

Calculate the gyrofrequency (or cyclotron frequency) of a charged particle's circular motion in a magnetic field. The gyrofrequency is the angular frequency of a charged particle's gyromotion around magnetic field lines.

References:

Examples

julia> gyrofrequency(0.01u"T", :p)  # proton gyrofrequency
957883.3292211705 rad s⁻¹

julia> uconvert(u"Hz", gyrofrequency(0.1u"T", :e), Periodic())  # electron gyrofrequency as frequency
2.799248987233304e9 Hz

julia> gyrofrequency(250u"Gauss", "Fe"; z=13)  # Fe2+ ion gyrofrequency
560682.3520611608 rad s⁻¹
source

Lengths

PlasmaFormulary.inertial_lengthFunction
inertial_length(n::NumberDensity, q::Charge, mass::Mass)
inertial_length(n::NumberDensity, p::ParticleLike; kw...)

Calculate the inertial length, the characteristic length scale for a particle to be accelerated in a plasma:

\[dᵢ = \frac{c}{ω_p}\]

where $ω_p$ is the plasma frequency.

The Hall effect becomes important on length scales shorter than the ion inertial length.

See also: plasma_frequency.

References: PlasmaPy API Documentation

source
PlasmaFormulary.Debye_lengthFunction
Debye_length(n::NumberDensity, T::EnergyOrTemp)

Calculate the Debye length, exponential scale length for charge screening in an electron plasma with stationary ions:

\[λ_D = \sqrt{\frac{ε₀ k_B T}{n q^2}}\]

where $T$ is the electron temperature, $n$ is the electron density, and $q$ is the elementary charge.

source

Velocites

PlasmaFormulary.diamagnetic_driftFunction
diamagnetic_drift(∇p, B::BFields, n, q)

Calculate the diamagnetic drift velocity given by:

\[𝐯 = - (∇p × 𝐁) / (q n |𝐁|^2)\]

where $∇p$ is the pressure gradient.

source
PlasmaFormulary.ExB_driftFunction
ExB_drift(𝐄::EFields, 𝐁::BFields)

Calculate the $E × 𝐁$ drift velocity given by:

\[𝐯 = (𝐄 × 𝐁) / |𝐁|^2\]

source
PlasmaFormulary.force_driftFunction
force_drift(𝐅, 𝐁::BFields, q)

Calculate the general force drift for a particle in a magnetic field given by:

\[𝐯 = (𝐅 × 𝐁) / (q |𝐁|^2)\]

source

Speeds

PlasmaFormulary.ion_sound_speedFunction
ion_sound_speed(T_e, T_i, m_i, Z; γ_e=1, γ_i=3, n_e=nothing, k=nothing)

Calculate the ion sound speed for an electron-ion plasma given by:

\[V_S = \sqrt{\frac{γ_e Z k_B T_e + γ_i k_B T_i}{m_i (1 + k^2 λ_{D}^2)}}\]

If both n_e and k are given, includes dispersive correction.

Arguments

  • T_e: Electron temperature (K or energy per particle)
  • T_i: Ion temperature (K or energy per particle)
  • m_i: Ion mass
  • Z: Ion charge state (default: 1)
  • γ_e: Electron adiabatic index (default: 1)
  • γ_i: Ion adiabatic index (default: 3)
  • n_e: Electron number density (optional)
  • k: Wavenumber (optional)
source
PlasmaFormulary.thermal_speedFunction
thermal_speed(T::EnergyOrTemp, mass::Mass, method::ThermalVelocityMethod = MostProbable(), ndim = 3)

Calculate the speed of thermal motion for particles with a Maxwellian distribution.

\[v_{th} = C_o \sqrt{\frac{k_B T}{m}}\]

where $T$ is the temperature associated with the distribution, $m$ is the particle's mass, and $C_o$ is a constant of proportionality. ```

source

Current density

PlasmaFormulary.Alfven_current_densityFunction
Alfven_current_density(Va::Velocity, n::NumberDensity)
Alfven_current_density(B::BFieldOrBFields, n::NumberDensity)
Alfven_current_density(B::BFieldOrBFields, dᵢ::Length)

Calculate the Alfvén current density $J_A$, a natural scaling for current density:

\[J_A = e n V_A = \frac{B}{μ₀ dᵢ}\]

where $V_A$ is the Alfven speed, $dᵢ$ is ion inertial length.

See also: Alfven_speed, inertial_length.

source

Aliases

PlasmaFormulary.AliasesModule

This module provides aliases of the most common plasma functionality for user convenience.

Aliases are denoted with a trailing underscore (e.g., alias_).

source

Constants

PlasmaFormulary.thermal_velocity_coefficientsFunction
thermal_velocity_coefficients(method::ThermalVelocityMethod, ndim::Int)

Get the thermal speed coefficient corresponding to the desired thermal speed definition.

Arguments

  • method::ThermalVelocityMethod: Method to be used for calculating the thermal speed. Valid values are MostProbable(), RMS(), MeanMagnitude(), and NRL().
  • ndim::Val{Int}: Dimensionality (1D, 2D, 3D) of space in which to calculate thermal speed. Valid values are Val(1), Val(2), or Val{3}.
source

Otherwise undocumented functions

This section will be removed once the documentation is complete.

PlasmaFormulary.thermal_pressureMethod
thermal_pressure(T, n)

Calculate the thermal pressure for a Maxwellian distribution.

Arguments

  • T: The particle temperature or energy.
  • n: The particle number density.
source