Documentation Index
Fetch the complete documentation index at: https://mintlify.com/stourgai/WPIT/llms.txt
Use this file to discover all available pages before exploring further.
WPI_mod is the dynamical heart of WPIT. It implements the relativistic, gyro-averaged equations of motion that govern how a charged particle’s momentum and position change as it moves along a magnetic field line and interacts with a propagating electromagnetic wave. The module is organized into three sub-modules, each targeting a specific wave-particle pair, but all three share the same conceptual framework.
The Test-Particle Method
In the test-particle approach, individual particles are treated as point charges moving under the combined influence of the background geomagnetic field and the wave fields. The word “test” means that the particle does not feed back on the wave — the wave fields are prescribed, and the particle responds to them. This is valid when the wave amplitude is small compared to the background field, or when the goal is to characterize single-particle dynamics before constructing a statistical ensemble. The gyro-averaging approximation integrates out the rapid cyclotron motion, retaining only the slower bounce and drift timescales. The result is a set of coupled ODEs in the bounce-averaged coordinates (field-line positionz, magnetic latitude λ, parallel momentum p‖, perpendicular momentum p⊥, phase angle η, kinetic energy Ek, local pitch angle α, equatorial pitch angle αeq, and Lorentz factor γ) that can be integrated with a standard ODE solver (e.g., scipy.integrate.odeint).
Sub-Modules
whistler_electron_mod
Electrons interacting with obliquely propagating whistler-mode (chorus) waves. Supports arbitrary wave normal angle θ and resonance harmonic m_res.
EMIC_ion_mod
Ions (H⁺, He⁺, O⁺) interacting with obliquely propagating EMIC waves. Includes an additional wave propagation equation
dkpardt and the time derivative of the cyclotron frequency dwcdt.parallel_EMIC_mod
Simplified EMIC-ion interaction for strictly parallel-propagating EMIC waves (wave normal angle = 0). Fewer free parameters, faster to evaluate.
Equations of Motion
All three sub-modules expose the same family of ODE right-hand-side functions. The table below describes each one; thewhistler_electron_mod variants are shown — the EMIC sub-modules have analogous forms with species-appropriate mass and charge.
Position and Latitude
dzdt(ppar, gamma, m)
Rate of change of the position along the field line (field-line coordinate z in meters):
dlamdadt(ppar, lamda, gamma, L)
Rate of change of magnetic latitude:
Momentum Evolution
dppardt(pper, eta, wtau_sq, kz, gamma, wce, dwds)
Rate of change of parallel momentum. The first term is the wave-driven acceleration; the second is the mirror force:
dpperdt(ppar, pper, eta, w1, w2, beta, gamma, R1, R2, m_res, wce, dwds)
Rate of change of perpendicular momentum, driven by the wave’s right- and left-hand polarization components (w1, w2) weighted by Bessel functions Jₘ₋₁ and Jₘ₊₁ of the FLR parameter β:
Energy and Phase
dEkdt(pper, ppar, eta, m_res, Exw, Eyw, Ezw, beta, gamma)
Rate of change of kinetic energy. Uses the left- and right-hand electric field components EwL = (Ex − Ey)/2, EwR = (Ex + Ey)/2, and the longitudinal component Ez, all weighted by Bessel functions:
dgammadt(pper, ppar, eta, m_res, Exw, Eyw, Ezw, beta, gamma)
Rate of change of the Lorentz factor γ. Identical structure to dEkdt but divided by an additional factor of me c²:
detadt(ppar, m_res, wce, w_wave, gamma, kz)
Rate of change of the wave-particle phase angle η — the key quantity that determines whether the interaction is accelerating or decelerating:
Pitch Angle
dalphadt(pper, ppar, eta, w1, w2, R1, R2, wtau_sq, kz, beta, m_res, gamma, wce, dwhds)
Rate of change of the local pitch angle α, derived from the momentum equations:
daeqdt(ppar, pper, alpha, aeq, eta, w1, R1, w2, R2, gamma, beta, wtausq, kz, m_res)
Rate of change of the equatorial pitch angle αeq, accounting for the adiabatic invariant relationship between local and equatorial pitch angles:
Pre-computation Helper: wpi_params
Before calling the ODE functions at each integration step, call wpi.wpi_params once to compute the derived wave parameters. This returns the Lorentz factor γ, the wave amplitude parameters w1 and w2, the nonlinear trapping frequency squared ω̃τ², and the polarization ratios R1 and R2:
dEkdt, dpperdt, etc.
Nonlinearity Parameters
Whether a wave-particle interaction is in the linear (diffusive) or nonlinear (trapping) regime is determined by comparing the nonlinear trapping frequency ω̃τ to the rate at which the resonance condition drifts. WPIT provides five functions to characterize this:wpi.nonlinear_S(H, wtsq) — Nonlinearity Parameter S
wpi.nonlinear_H(pper, ppar, kpar, gamma, m_res, m, wce, dkpar_dt, dwcdz, dwdt) — Inhomogeneity Factor H
H captures the spatial inhomogeneity of the resonance condition — i.e., how quickly the resonant velocity changes along the field line:
wpi.nonlinear_C0(ppar, m_res, wce, kz, gamma, Ezw) — Parallel Phase Trapping Parameter C0
C0 quantifies the contribution of the parallel electric field Ez to the phase-trapping force:
wpi.nonlinear_C1m(pper, ppar, w1, Exw, Eyw, m_res, wce, kz, gamma) — Left-Hand Coupling C1⁻
wpi.nonlinear_C1p(pper, ppar, w2, Exw, Eyw, m_res, wce, kz, gamma) — Left-Polarization Coupling C1⁺
Analogous to C1⁻ but using the left-hand polarization component EwL = (Ex − Ey)/2 and the wave amplitude parameter w2.
wpi.nonlinear_theta(C0, C1p, C1m, m_res, beta) — Combined Phase Angle Parameter
Combines C0, C1⁺, and C1⁻ weighted by Bessel functions to produce the effective driving amplitude and its magnitude (= ω̃τ²):
Linear vs. Nonlinear Interaction Regime
Linear vs. Nonlinear Interaction Regime
The linear regime (|S| ≫ 1) corresponds to quasi-linear diffusion: the particle samples many wave cycles before the resonance condition drifts significantly, and the net effect is well described by diffusion coefficients in pitch-angle/energy space.The nonlinear regime (|S| ≲ 1) corresponds to phase trapping: the particle is trapped in the wave potential well and can undergo large, coherent changes in energy and pitch angle during a single wave-packet encounter. Chorus wave elements with amplitudes above ~100 pT at L ≈ 5 can push electrons into the nonlinear regime.WPIT computes S at each integration step so that you can monitor which regime the particle occupies throughout its trajectory.
Typical Integration Loop
A minimal integration usingwhistler_electron_mod looks like:
WPIT provides the individual ODE right-hand-side functions but does not ship a pre-built integration driver. The
Module_descriptions/whistler_electron_mod_description.ipynb notebook shows a complete integration loop using scipy.integrate.odeint.