DispersionComparisonResult of confirming a theoretical dispersion relation against PlasmaBO.jl.
Fields:
mode::Symbol: wave mode label (e.g., :alfven, :whistler, :kaw, :langmuir)
ks::Vector{Float64}: wavevector magnitudes (or k_perp for KAW sweeps)
θ::Float64: propagation angle relative to \(\mathbf{B}_0\) [rad]
k_label::String: axis label for the swept wavevector coordinate (supports LaTeX $...$)
ω_theory::Vector{ComplexF64}: theoretical complex frequency \(\omega_{\text{theory}}(k)\)
ω_numerical::Vector{ComplexF64}: primary matched/tracked kinetic root from PlasmaBO
rel_error::Vector{Float64}: relative real-frequency discrepancy \(|\Re\omega_{\text{th}} - \Re\omega_{\text{num}}| / |\Re\omega_{\text{num}}|\)
damping_ratio::Vector{Float64}: kinetic damping/growth ratio \(|\Im\omega_{\text{num}}| / |\Re\omega_{\text{num}}|\)
ω_scale::Float64: normalization frequency (e.g. \(\Omega_i\) or \(\omega_{pe}\)) for plotting
ω_label::String: frequency axis label (supports LaTeX $...$)
primary_label::String: legend label for the primary PlasmaBO branch
extra_branches: optional additional tracked kinetic branches (; label, ω) (e.g. Whistler R-branch alongside EMIC L-branch)
PlasmaParams{T<:AbstractFloat}Uniform magnetized plasma with background magnetic field \(\mathbf{B}_0 = B_0 \hat{\mathbf{z}}\). Works seamlessly in either dimensionless normalized units (normalized_plasma) or SI units (si_plasma).
PlasmaParams(p::PlasmaPopulations.Plasma; γ=5/3)Convert a physical SI PlasmaPopulations.Plasma into a PlasmaParams for analytical theory calculations, transport ratios, and animations.
Species{T<:AbstractFloat}A single charged particle species in a magnetized plasma.
Fields:
name: species label (e.g. :electron, :proton)
m: particle mass
q: signed particle charge (< 0 for electrons, > 0 for ions)
n: equilibrium number density
T_par: parallel temperature (in Kelvin for SI, or energy units when kB == 1)
T_perp: perpendicular temperature
WaveSolution{T<:AbstractFloat}Linear (or exact circularly polarized) plane-wave eigenmode solution \(\delta A(\mathbf{r}, t) = \Re[\tilde{A} \exp(i(\mathbf{k}\cdot\mathbf{r} - \omega t))]\) in a uniform plasma with \(\mathbf{B}_0 = B_0 \hat{\mathbf{z}}\).
sourceAlfvén ratio \(R_A = \mu_0 \rho_0 |\delta\mathbf{v}|^2 / |\delta\mathbf{B}|^2\).
sourceAlfvén speed \(v_A = B_0 / \sqrt{\mu_0 \rho_0}\).
sourcebernstein_dielectric(plasma::PlasmaParams, ω::Real, k_perp::Real;
species::Symbol=:electron, n_max::Int=25)Exact perpendicular electrostatic Bernstein dispersion function (\(k_\parallel = 0\)): \(\epsilon(\omega, k_\perp) = 1 - \sum_s \frac{2\omega_{ps}^2}{\lambda_s \Omega_s^2} \sum_{n=1}^{n_{\max}} \frac{n^2 \Omega_s^2}{\omega^2 - n^2 \Omega_s^2} \Gamma_n(\lambda_s)\).
sourcebernstein_wave(plasma::PlasmaParams, k_perp::Real;
species::Symbol=:electron, harmonic::Int=1, n_max::Int=25, amp::Real=0.15)Solve for the harmonic-th perpendicular electrostatic Bernstein wave (EBW or IBW) in the frequency band \((n\Omega_s, (n+1)\Omega_s)\).
circular_alfven_wave(plasma::PlasmaParams, k::Real; hand::Symbol=:right, amp::Real=0.2)Construct an exact arbitrary-amplitude circularly polarized Alfvén wave (CPAW) propagating along \(+\mathbf{B}_0\) with \(|\mathbf{B}| = \text{const}\). hand can be :right (electron gyration sense) or :left (ion gyration sense).
cold_cutoffs(plasma::PlasmaParams)Compute the three cold-plasma cutoff frequencies (; ω_pe, ω_R, ω_L) for an electron-ion plasma (solving P = 0, R = 0, L = 0).
Cold-plasma relative dielectric tensor \(\boldsymbol{\epsilon}_R(\omega)\) in Stix form.
sourcecold_plasma_eigenmode(plasma::PlasmaParams, ω::Real, θ::Real, n2::Real; mode::Symbol=:cold_plasma, amp::Real=0.15)Given a propagating branch \(n^2 > 0\), construct the full WaveSolution by finding the exact complex electric-field eigenvector from the nullspace of the Stix wave matrix.
cold_plasma_n2(plasma::PlasmaParams, ω::Real, θ::Real)Solve the cold-plasma dispersion relation \(A n^4 - B n^2 + C = 0\) at frequency ω and propagation angle θ. Returns (n2_plus, n2_minus) corresponding to \((B \pm F)/(2A)\).
cold_resonances(plasma::PlasmaParams)Compute principal cold-plasma resonance frequencies (; Ω_i, Ω_e, ω_LH, ω_UH).
confirm_alfven(plasma, ks; θ=0.0, alg=BOHH(N=3, J=6))Confirm the Ideal MHD Shear Alfvén dispersion \(\omega = k_\parallel v_A\) against PlasmaBO. Tracks both the left-hand EMIC (L) and right-hand Whistler (R) kinetic branches backward from high \(k d_i\) where they are cleanly separated, revealing Hall splitting as \(k d_i \sim 1\).
confirm_dispersion(theory_ω_fn, plasma, ks; θ=0.0, alg=BOHH(N=4, J=8),
mode=:custom, k_label="k", ω_scale=1.0, ω_label="ω",
k_vectors=nothing, Ω_ref=nothing, region_box=nothing,
track_seed=nothing, max_damping=0.6,
primary_label="PlasmaBO (BOHH)", extra_seeds=())Confirm a theoretical dispersion function theory_ω_fn(k) -> Complex against the full hot magnetized kinetic solver PlasmaBO.solve(..., alg).
region_box: optional (lowerleft, upperright) tuple in Ω_ref-normalized units to exclude spurious heavily damped Hermite poles when building the PlasmaDispersionBase survey.
track_seed: optional (ω_seed_phys, seed_idx) tuple to trace a single continuous branch across ks using PlasmaDispersionBase.track.
extra_seeds: optional collection of (label, ω_seed_phys, seed_idx) tuples to track additional physical branches from the same SurveySolution.
confirm_ion_acoustic(plasma, ks; alg=BOHH(N=2, J=8))Confirm the fluid Ion-Acoustic dispersion against full Vlasov kinetic PlasmaBO.
confirm_kaw(plasma, k_par, k_perps; model=:bessel, alg=BOHH(N=5, J=6))Confirm the Kinetic Alfvén Wave (KAW) dispersion against PlasmaBO across perpendicular wavenumbers k_perps at fixed k_par, revealing kinetic Landau damping and finite-β corrections.
confirm_langmuir(plasma, kλDs; alg=BOHH(N=2, J=8))Confirm the warm-fluid Bohm-Gross dispersion \(\omega^2 = \omega_{pe}^2 + 3 k^2 v_{th,e}^2\) against full Vlasov kinetic PlasmaBO across \(k \lambda_{De}\), revealing the onset of collisionless Landau damping.
confirm_whistler(plasma, ks; θ=0.0, model=:cold, alg=BOHH(N=4, J=8))Confirm the Cold/Hall Whistler wave dispersion against PlasmaBO. Demonstrates agreement in the fluid whistler band and onset of electron cyclotron damping as \(\omega \to |\Omega_e|\).
Signed cyclotron frequency \(\Omega_s = q_s B_0 / m_s\) (negative for electrons).
sourceTemporal growth/damping rate \(\gamma = \Im(\omega)\) (negative = damped).
sourceDebye length \(\lambda_{Ds} = \sqrt{\varepsilon_0 k_B T_{\parallel s} / (n_s q_s^2)}\).
sourceelectrostatic_dielectric(plasma::PlasmaParams, ω::Number, k::Real; species_list=plasma.species)Unmagnetized Vlasov electrostatic dielectric function: \(\epsilon(\omega, k) = 1 + \sum_s \frac{1}{k^2 \lambda_{Ds}^2} [1 + \zeta_s Z(\zeta_s)]\), where \(\zeta_s = \omega / (|k| v_{th,s})\) and \(v_{th,s} = \sqrt{2 k_B T_{\parallel s} / m_s}\).
sourceElectrostatic fraction \(|\hat{\mathbf{k}}\cdot\delta\mathbf{E}| / |\delta\mathbf{E}| \in [0, 1]\).
sourceevaluate_fields(sol::WaveSolution, r, t; include_damping=true)Evaluate real-valued wave perturbations (E, B, v, n, p) at position r (3-vector) and time t. Set include_damping=false to visualize the undamped eigenmode structure with \(\Re(\omega)\) only.
faraday_rotation_fields(plasma::PlasmaParams, ω::Real, z::AbstractVector, t::Real; E0=1.0)Superposition of equal-amplitude R- and L-mode waves at frequency \(\omega > \omega_R\) propagating along \(+\mathbf{B}_0\): demonstrates Faraday rotation of the linear polarization plane with rotation rate \(d\phi/dz = (k_L - k_R)/2\). Returns (; Ex, Ey, kR, kL, rotation_rate).
Construct a Fast Magnetosonic wave (δp and δB_z in phase).
friedrich_group_velocities(vA, vs, θ)Return (; vg_fast, vg_alfven, vg_slow) as 2-vectors (v_gx, v_gz) in the \((x, z)\) plane using the exact angular derivative \(\mathbf{v}_g = v_{\mathrm{ph}}\hat{\mathbf{k}} + \frac{\partial v_{\mathrm{ph}}}{\partial \theta}\hat{\boldsymbol{\theta}}\).
friedrich_phase_speeds(vA, vs, θ)Return (; v_fast, v_alfven, v_slow) ideal MHD phase speeds at propagation angle θ relative to \(\mathbf{B}_0\).
hall_mhd_dispersion(plasma::PlasmaParams, k_par::Real; branch::Symbol=:whistler)Exact parallel Hall-MHD dispersion relation: \(\omega / (k_\parallel v_A) = \sqrt{1 + (k_\parallel d_i / 2)^2} \pm k_\parallel d_i / 2\). branch = :whistler (+, right-hand) or :emic / :ion_cyclotron (-, left-hand).
inertial_alfven_wave(plasma::PlasmaParams, k_par::Real, k_perp::Real; amp::Real=0.15)Construct an Inertial Alfvén Wave (IAW) in the cold-electron regime \(\beta_e \ll m_e / m_i\): \(\omega^2 = k_\parallel^2 v_A^2 / (1 + k_\perp^2 d_e^2)\).
sourceInertial length (skin depth) \(d_s = c / \omega_{ps}\).
sourceion_acoustic_wave(plasma::PlasmaParams, k::Real; model::Symbol=:vlasov, amp::Real=0.15)Construct an electrostatic Ion-Acoustic Wave along \(\hat{\mathbf{x}}\).
model = :vlasov: solves the 1D two-species Vlasov electrostatic dispersion relation.
model = :fluid: warm-fluid dispersion \(\omega^2 = k^2 c_s^2 / (1 + k^2 \lambda_{De}^2) + 3 k^2 v_{th,i,1D}^2\).
ion_cyclotron_wave(plasma::PlasmaParams, k::Real; model::Symbol=:hall, amp::Real=0.15)Construct a left-hand polarized Alfvén–Ion Cyclotron Wave (EMIC) propagating along \(\mathbf{B}_0\).
sourcekaw_particle_trajectories(sol::WaveSolution, z0s, vz0s, ts; q_over_m=nothing)Integrate 1D parallel electron motion \(\ddot{z} = (q/m) E_z(z, t)\) in the wave's parallel electric field using 4th-order Runge-Kutta. For ideal SAW (\(E_z = 0\)) particles stream freely; for KAW (\(E_z \neq 0\)) resonant particles near \(v_z \approx \omega / k_\parallel\) become trapped in the wave potential troughs.
Returns (; z, vz) matrices of size (length(z0s), length(ts)).
kinetic_alfven_wave(plasma::PlasmaParams, k_par::Real, k_perp::Real;
model::Symbol=:bessel, amp::Real=0.15)Construct a Kinetic Alfvén Wave (KAW) in the warm-electron regime \(\beta_e \gg m_e / m_i\).
model = :bessel: gyrokinetic modified-Bessel dispersion (Johnson & Cheng 1997) \(\omega^2 = k_\parallel^2 v_A^2 \left[\frac{b_i}{1 - I_0(b_i)e^{-b_i}} + \frac{T_e}{T_i} b_i\right]\) with \(b_i = k_\perp^2 r_{iL}^2\).
model = :twofluid: Padé / two-fluid approximation \(\omega^2 = k_\parallel^2 v_A^2 [1 + k_\perp^2 (r_{iL}^2 + r_{fL}^2)]\).
Computes the finite parallel electric field \(\delta E_z\), modified \(|\delta E_\perp / \delta B_\perp|\), and Boltzmann density perturbation \(\delta n\).
sourcelandau_phase_space(sol::WaveSolution, x0s, v0s, ts; q_over_m=nothing, include_damping=true)Integrate test-particle trajectories \(\ddot{x} = (q/m) E_x(x, t)\) in an electrostatic wave to illustrate Landau damping and cat's-eye phase-space trapping around \(v_\phi = \Re(\omega)/k\).
sourcelangmuir_wave(plasma::PlasmaParams, k::Real; model::Symbol=:vlasov, amp::Real=0.15)Construct a Langmuir (electron plasma) wave along \(\hat{\mathbf{x}}\).
model = :vlasov: solves the 1D Vlasov electrostatic dispersion relation for complex \(\omega = \omega_r + i\gamma\).
model = :bohm_gross: warm-fluid Bohm-Gross approximation \(\omega_r = \sqrt{\omega_{pe}^2 + 3 k^2 v_{th,1D}^2}\) with asymptotic weak Landau damping rate.
Thermal Larmor radius \(r_{Ls} = \sqrt{k_B T_{\perp s} / m_s} / |\Omega_s|\).
sourceLower hybrid electrostatic wave (\(\mathbf{k} \perp \mathbf{B}_0\), \(\omega \approx \omega_{LH}\)).
sourceMagnetic compressibility \(C_B = |\delta B_z|^2 / |\delta\mathbf{B}|^2\).
sourceTotal mass density \(\rho_0 = \sum_s n_s m_s\).
sourcenormalized_plasma(; mi_me=1836.0, β_i=0.1, β_e=0.1, vA_c=0.01,
anisotropy_i=1.0, anisotropy_e=1.0, γ=5/3)Construct a two-species (proton + electron) plasma in standard Alfvén-normalized units: \(m_i = q_i = n_0 = B_0 = \mu_0 = k_B = 1\), so that \(v_A = 1\), \(\Omega_i = 1\), and \(d_i = 1\).
Plasma beta is defined as \(\beta_s = 2\mu_0 n_s k_B T_{\parallel s} / B_0^2\), and anisotropy_s = T_perp / T_par.
Ordinary (O-mode) electromagnetic wave propagating perpendicular to \(\mathbf{B}_0\) (\(n^2 = P\)).
sourceReal phase speed \(v_{\mathrm{ph}} = \Re(\omega) / |\mathbf{k}|\).
sourceTotal plasma beta \(\beta = \sum_s \beta_s\).
sourceSpecies parallel plasma beta \(\beta_s = 2\mu_0 n_s k_B T_{\parallel s} / B_0^2\).
sourceplasma_dispersion_Z(ζ::Number)Fried-Conte plasma dispersion function \(Z(\zeta) = \frac{1}{\sqrt{\pi}} \int_{-\infty}^{\infty} \frac{e^{-t^2}}{t - \zeta}\,dt = i\sqrt{\pi}\,\mathrm{erfcx}(-i\zeta)\), valid across the entire complex plane.
sourceDerivative of the plasma dispersion function: \(Z'(\zeta) = -2[1 + \zeta Z(\zeta)]\).
sourcePlasma frequency \(\omega_{ps} = \sqrt{n_s q_s^2 / (\varepsilon_0 m_s)}\).
sourcepolarization_B(sol::WaveSolution)Magnetic-field polarization (Gary 1993) \(P_B = i b_s / b_A\), where \(\hat{\mathbf{A}} = \hat{\mathbf{k}}\times\hat{\mathbf{z}}\) (out of \((\mathbf{k}, \mathbf{B}_0)\) plane) and \(\hat{\mathbf{S}} = \hat{\mathbf{A}}\times\hat{\mathbf{k}}\) (in-plane, \(\perp \mathbf{k}\)).
sourcepolarization_E(sol::WaveSolution)Electric-field polarization in the plane perpendicular to \(\mathbf{B}_0\): \(P_E = i \delta E_x / \delta E_y\).
\(\Re(P_E) > 0\): right-hand polarized (electron gyration sense).
\(\Re(P_E) < 0\): left-hand polarized (ion gyration sense).
\(P_E = +1\) / \(-1\): right / left circular polarization.
Time-averaged Poynting flux \(\langle\mathbf{S}\rangle = \frac{1}{2\mu_0}\Re(\delta\mathbf{E} \times \delta\mathbf{B}^*)\).
sourcePropagation angle \(\theta\) between \(\mathbf{k}\) and \(\mathbf{B}_0 = B_0 \hat{\mathbf{z}}\) in radians.
sourcesaw_phase_mixing(x, t; kz=1.0, vA_profile = x -> 1.0 + 0.4 * tanh(x),
B0_profile = x -> exp(-x^2 / 4))Exact 1D non-uniform slab Shear Alfvén Wave continuous-spectrum solution: \(B_{1y}(x, t) = \hat{B}_{1y}(x, 0) \cos[\omega_A(x) t]\) where \(\omega_A(x) = k_z v_A(x)\). Demonstrates phase mixing where \(|k_x(x, t)| \simeq |\omega_A'(x)| t\) grows linearly in time.
sourceshear_alfven_wave(plasma::PlasmaParams, k::Real, θ::Real=0.0; amp::Real=0.15)Construct a linearly polarized Shear Alfvén Wave (SAW) with \(\mathbf{k} = k(\sin\theta, 0, \cos\theta)\), \(\omega = |k_\parallel| v_A\), transverse \(\delta v_y, \delta B_y, \delta E_x\), and zero compression.
sourcesi_plasma(; B0=1e-8, n0=5e6, Ti_eV=10.0, Te_eV=10.0, mi_me=MP_SI/ME_SI,
anisotropy_i=1.0, anisotropy_e=1.0, γ=5/3)Construct a proton-electron plasma in SI units (defaults approximate solar wind at 1 AU: \(B_0 = 10\,\mathrm{nT}\), \(n_0 = 5\,\mathrm{cm}^{-3}\), \(T = 10\,\mathrm{eV}\)).
sourceConstruct a Slow Magnetosonic wave (δp and δB_z anti-phase).
MHD adiabatic sound speed \(v_s = \sqrt{\gamma p_0 / \rho_0}\).
sourcestix_parameters(plasma::PlasmaParams, ω::Number)Compute Stix cold-plasma parameters (; R, L, P, S, D) at frequency ω. Uses signed cyclotron frequencies \(\Omega_s = q_s B_0 / m_s\) so that \(R = 1 - \sum_s \frac{\omega_{ps}^2}{\omega(\omega + \Omega_s)}\) (resonant at \(|\Omega_e|\)) and \(L = 1 - \sum_s \frac{\omega_{ps}^2}{\omega(\omega - \Omega_s)}\) (resonant at \(|\Omega_i|\)).
Total equilibrium thermal pressure \(p_0 = \sum_s n_s k_B T_{\parallel s}\).
sourcethermal_speed(s::Species, p::PlasmaParams; perp=false)Kinetic thermal speed \(v_{th,s} = \sqrt{2 k_B T_s / m_s}\) (Stix / Gary convention). Use thermal_speed_1d for the RMS speed \(\sqrt{k_B T_s / m_s}\).
1D RMS thermal speed \(\sqrt{k_B T_s / m_s}\).
sourceto_bo_plasma(p::PlasmaParams; Ω_ref=nothing)Convert a PlasmaParams into a (norm_plasma::NormalizedPlasma, scales) pair suitable for PlasmaDispersionBase.DispersionProblem and PlasmaBO.solve(..., BOHH()).
In PlasmaDispersionBase, NormalizedPlasma uses frequency unit Ω_ref and wavevector unit Ω_ref / c, so k_bo = k * p.c / Ω_ref and ω_phys = ω_bo * Ω_ref.
Upper hybrid electrostatic oscillation (\(\mathbf{k} \perp \mathbf{B}_0\), \(\omega^2 = \omega_{UH}^2 + k^2 v_{th,e}^2\)).
sourceReturn a boolean mask of k points where theoretical and kinetic real frequencies agree within tol.
whistler_wave(plasma::PlasmaParams, k::Real, θ::Real=0.0; model::Symbol=:hall, amp::Real=0.15)Construct a right-hand polarized Whistler wave.
model = :hall: exact Hall-MHD whistler (for θ = 0) or oblique EMHD whistler \(\omega = \Omega_e (k d_e)^2 \cos\theta / (1 + k^2 d_e^2)\) when k * d_i >> 1.
model = :cold: solves the full cold-plasma dispersion relation for the whistler branch below the electron cyclotron resonance cone \(\omega < |\Omega_e| \cos\theta\).
Extraordinary (X-mode) electromagnetic wave propagating perpendicular to \(\mathbf{B}_0\) (\(n^2 = RL/S\)).
source