Skip to main content

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.

The parallel_EMIC_mod sub-module implements the relativistic equations of motion for a single ion interacting with a parallel-propagating Electromagnetic Ion Cyclotron (EMIC) wave, where the wave normal angle is exactly zero. Because the wave propagates purely along the background magnetic field B₀, there is no perpendicular wave vector component, the Bessel function argument beta vanishes identically, and the coupling reduces to a simpler form involving only the wave magnetic field amplitude and a phase velocity term. This makes the module computationally lighter than EMIC_ion_mod and appropriate for simulations that assume field-aligned propagation. The nonlinear trapping functions in this module also use a different formulation for nonlinear_theta — one that directly involves Bw rather than Bessel-weighted electric field components — reflecting the simplified dispersion geometry.
import WPIT.WPI_mod.parallel_EMIC_mod as par_emic

# Or import individual functions
from WPIT.WPI_mod.parallel_EMIC_mod import (
    dzdt, dlamdadt,
    dppardt, dpperdt,
    dEkdt, dgammadt,
    dalphadt, daeqdt,
    detadt,
    nonlinear_H, nonlinear_S, nonlinear_theta,
)
Unlike EMIC_ion_mod, this module does not export wpi_params, dkpardt, or dwcdt, and it does not export nonlinear_C0, nonlinear_C1m, or nonlinear_C1p. The parallel geometry removes the need for Bessel-based coupling coefficients. nonlinear_theta uses a different signature here — it takes Bw, kappa, momenta, and particle properties rather than precomputed C coefficients.

dzdt

Returns the time rate of change of the field-line distance coordinate.
dz_dt = par_emic.dzdt(ppar_arg, gamma_arg, mi_arg)
ppar_arg
float
Ion momentum component parallel to B₀, in kg m s⁻¹.
gamma_arg
float
Relativistic Lorentz factor (dimensionless).
mi_arg
float
Ion rest mass, in kg.
dz_dt
float
Time derivative of the field-line coordinate dz/dt = ppar / (gamma * mi), in m s⁻¹.

dlamdadt

Returns the time rate of change of the magnetic latitude, accounting for dipole-field geometry via the sqrt(1 + 3*sin^2(lambda)) * cos(lambda) metric factor.
dlamda_dt = par_emic.dlamdadt(ppar_arg, lamda_arg, gamma_arg, m_arg, L_arg)
ppar_arg
float
Parallel ion momentum, in kg m s⁻¹.
lamda_arg
float
Magnetic latitude lambda, in radians.
gamma_arg
float
Lorentz factor (dimensionless).
m_arg
float
Ion rest mass, in kg.
L_arg
float
Magnetic L-shell value (dimensionless).
dlamda_dt
float
Time derivative of the magnetic latitude, in rad s⁻¹.

dppardt

Returns the time rate of change of the parallel momentum. For parallel propagation the wave coupling enters through the wave magnetic field Bw directly rather than through decomposed left/right components.
dppar_dt = par_emic.dppardt(
    pper_arg, eta_arg, wc_arg, Bw_arg,
    gamma_arg, dwcds_arg, q_arg, m_arg
)
pper_arg
float
Perpendicular momentum, in kg m s⁻¹.
eta_arg
float
Wave–particle phase angle, in radians.
wc_arg
float
Ion cyclotron frequency, in rad s⁻¹.
Bw_arg
float
Wave magnetic field amplitude, in T.
gamma_arg
float
Lorentz factor (dimensionless).
dwcds_arg
float
Spatial derivative of the cyclotron frequency along the field line, in rad m⁻¹ s⁻¹.
q_arg
float
Ion charge, in Coulombs.
m_arg
float
Ion rest mass, in kg.
dppar_dt
float
Time derivative of the parallel momentum dppar/dt, in kg m s⁻².

dpperdt

Returns the time rate of change of the perpendicular momentum. The wave term involves the difference between the particle’s parallel velocity and the wave phase velocity w/k.
dpper_dt = par_emic.dpperdt(
    ppar_arg, pper_arg, eta_arg, Bw_arg,
    gamma_arg, wmega_arg, kappa_arg,
    wc_arg, dwcds_arg, q_arg, m_arg
)
ppar_arg
float
Parallel momentum, in kg m s⁻¹.
pper_arg
float
Perpendicular momentum, in kg m s⁻¹.
eta_arg
float
Wave–particle phase angle, in radians.
Bw_arg
float
Wave magnetic field amplitude, in T.
gamma_arg
float
Lorentz factor (dimensionless).
wmega_arg
float
Wave angular frequency, in rad s⁻¹.
kappa_arg
float
Parallel wave number, in rad m⁻¹.
wc_arg
float
Ion cyclotron frequency, in rad s⁻¹.
dwcds_arg
float
Spatial derivative of the cyclotron frequency along the field line, in rad m⁻¹ s⁻¹.
q_arg
float
Ion charge, in Coulombs.
m_arg
float
Ion rest mass, in kg.
dpper_dt
float
Time derivative of the perpendicular momentum dpper/dt, in kg m s⁻².

dEkdt

Returns the time rate of change of the relativistic kinetic energy. For parallel EMIC waves the energy exchange rate depends on the phase velocity w/kappa and the perpendicular momentum.
dEk_dt = par_emic.dEkdt(
    pper_arg, eta_arg, gamma_arg,
    Bw_arg, kappa_arg, w_arg, q_arg, m_arg
)
pper_arg
float
Perpendicular momentum, in kg m s⁻¹.
eta_arg
float
Wave–particle phase angle, in radians.
gamma_arg
float
Lorentz factor (dimensionless).
Bw_arg
float
Wave magnetic field amplitude, in T.
kappa_arg
float
Parallel wave number, in rad m⁻¹.
w_arg
float
Wave angular frequency, in rad s⁻¹.
q_arg
float
Ion charge, in Coulombs.
m_arg
float
Ion rest mass, in kg.
dEk_dt
float
Time derivative of kinetic energy: dEk/dt = (1/(gamma*m)) * q * pper * Bw * (w/kappa) * sin(eta), in J s⁻¹.

dgammadt

Returns the time rate of change of the Lorentz factor.
dgamma_dt = par_emic.dgammadt(
    pper_arg, eta_arg, gamma_arg,
    Bw_arg, kappa_arg, w_arg, q_arg, m_arg
)
pper_arg
float
Perpendicular momentum, in kg m s⁻¹.
eta_arg
float
Wave–particle phase angle, in radians.
gamma_arg
float
Lorentz factor (dimensionless).
Bw_arg
float
Wave magnetic field amplitude, in T.
kappa_arg
float
Parallel wave number, in rad m⁻¹.
w_arg
float
Wave angular frequency, in rad s⁻¹.
q_arg
float
Ion charge, in Coulombs.
m_arg
float
Ion rest mass, in kg.
dgamma_dt
float
Time derivative of the Lorentz factor, in s⁻¹.

dalphadt

Returns the time rate of change of the local pitch angle, including both the wave-driven term and the adiabatic drift term due to the field gradient.
dalpha_dt = par_emic.dalphadt(
    ppar_arg, pper_arg, eta_arg, gamma_arg,
    wce_arg, dwcds_arg, w_wave_arg,
    kappa_arg, Bw_arg, m_arg, q_arg
)
ppar_arg
float
Parallel momentum, in kg m s⁻¹.
pper_arg
float
Perpendicular momentum, in kg m s⁻¹.
eta_arg
float
Wave–particle phase angle, in radians.
gamma_arg
float
Lorentz factor (dimensionless).
wce_arg
float
Ion cyclotron frequency, in rad s⁻¹.
dwcds_arg
float
Spatial derivative of the cyclotron frequency along the field line, in rad m⁻¹ s⁻¹.
w_wave_arg
float
Wave angular frequency, in rad s⁻¹.
kappa_arg
float
Parallel wave number, in rad m⁻¹.
Bw_arg
float
Wave magnetic field amplitude, in T.
m_arg
float
Ion rest mass, in kg.
q_arg
float
Ion charge, in Coulombs.
dalpha_dt
float
Time derivative of the local pitch angle, in rad s⁻¹.

daeqdt

Returns the time rate of change of the equatorial pitch angle for a parallel EMIC wave. The mapping from local to equatorial pitch angle change uses the ratio tan(aeq)/tan(alpha).
daeq_dt = par_emic.daeqdt(
    ppar_arg, pper_arg, eta_arg, gamma_arg,
    w_wave_arg, kappa_arg, Bw_arg,
    aeq_arg, alpha_arg, m_arg, q_arg
)
ppar_arg
float
Parallel momentum, in kg m s⁻¹.
pper_arg
float
Perpendicular momentum, in kg m s⁻¹.
eta_arg
float
Wave–particle phase angle, in radians.
gamma_arg
float
Lorentz factor (dimensionless).
w_wave_arg
float
Wave angular frequency, in rad s⁻¹.
kappa_arg
float
Parallel wave number, in rad m⁻¹.
Bw_arg
float
Wave magnetic field amplitude, in T.
aeq_arg
float
Equatorial pitch angle, in radians.
alpha_arg
float
Local pitch angle, in radians.
m_arg
float
Ion rest mass, in kg.
q_arg
float
Ion charge, in Coulombs.
daeq_dt
float
Time derivative of the equatorial pitch angle, in rad s⁻¹.

detadt

Returns the time rate of change of the wave–particle phase angle eta. Accepts a species flag s to switch the sign of the cyclotron term between ions and electrons.
deta_dt = par_emic.detadt(
    ppar_arg, pper_arg, eta_arg, Bw_arg,
    wmega_arg, kappa_arg, wc_arg,
    gamma_arg, q_arg, m_arg, s
)
ppar_arg
float
Parallel momentum, in kg m s⁻¹.
pper_arg
float
Perpendicular momentum, in kg m s⁻¹.
eta_arg
float
Wave–particle phase angle, in radians.
Bw_arg
float
Wave magnetic field amplitude, in T.
wmega_arg
float
Wave angular frequency, in rad s⁻¹.
kappa_arg
float
Parallel wave number, in rad m⁻¹.
wc_arg
float
Ion cyclotron frequency, in rad s⁻¹.
gamma_arg
float
Lorentz factor (dimensionless).
q_arg
float
Ion charge, in Coulombs.
m_arg
float
Ion rest mass, in kg.
s
str
Species selector. Use 'ion' for proton/helium/oxygen (cyclotron term sign +1) or 'electron' (cyclotron term sign -1).
deta_dt
float
Time derivative of the wave–particle phase, in rad s⁻¹.

Nonlinear trapping diagnostics

The three nonlinear functions compute the phase-trapping diagnostics for parallel EMIC waves. The nonlinear_theta function has a different signature from the oblique module: it directly computes the trapping frequency squared from the wave amplitude and momentum, without the Bessel-function decomposition used in EMIC_ion_mod.

nonlinear_H

Computes the nonlinear Hamiltonian H, which captures the departure from exact resonance due to field and wave inhomogeneity.
H = par_emic.nonlinear_H(
    pper_arg, ppar_arg, kappa_arg, gamma_arg,
    m_arg, wce_arg, dk_dt_arg, dwcdz_arg, dwdt_arg
)
pper_arg
float
Perpendicular momentum, in kg m s⁻¹.
ppar_arg
float
Parallel momentum, in kg m s⁻¹.
kappa_arg
float
Parallel wave number, in rad m⁻¹.
gamma_arg
float
Lorentz factor (dimensionless).
m_arg
float
Ion rest mass, in kg.
wce_arg
float
Ion cyclotron frequency, in rad s⁻¹.
dk_dt_arg
float
Time derivative of the parallel wave number, in rad m⁻¹ s⁻¹.
dwcdz_arg
float
Spatial gradient of the cyclotron frequency along the field line, in rad m⁻¹ s⁻¹.
dwdt_arg
float
Time derivative of the wave frequency (zero for monochromatic wave), in rad s⁻².
H
float
Nonlinear trapping Hamiltonian H. Pass together with wtsq to nonlinear_S.
Compared with EMIC_ion_mod.nonlinear_H, the sign on the cyclotron inhomogeneity term is negated: fac1 = -(1/gamma) * dwc_dt, reflecting the ion-resonance convention for parallel propagation.

nonlinear_S

Computes the dimensionless trapping parameter S.
S = par_emic.nonlinear_S(H_arg, wtsq_arg)
H_arg
float
The nonlinear Hamiltonian H from nonlinear_H.
wtsq_arg
float
The trapping frequency squared from nonlinear_theta (in rad² s⁻²).
S
float
Dimensionless trapping parameter S = H / wtsq. Phase trapping is indicated by |S| less than 1.

nonlinear_theta

Computes the nonlinear trapping coupling term and trapping frequency squared directly from the wave amplitude and particle momentum. No Bessel functions are required for parallel propagation.
theta, wtsq = par_emic.nonlinear_theta(
    pper_arg, ppar_arg, Bw_arg, kappa_arg,
    gamma_arg, m_arg, q_arg, wce_arg, w_arg
)
pper_arg
float
Perpendicular momentum, in kg m s⁻¹.
ppar_arg
float
Parallel momentum, in kg m s⁻¹.
Bw_arg
float
Wave magnetic field amplitude, in T.
kappa_arg
float
Parallel wave number, in rad m⁻¹.
gamma_arg
float
Lorentz factor (dimensionless).
m_arg
float
Ion rest mass, in kg.
q_arg
float
Ion charge, in Coulombs.
wce_arg
float
Ion cyclotron frequency, in rad s⁻¹.
w_arg
float
Wave angular frequency, in rad s⁻¹.
theta
float
Nonlinear coupling term theta (SI units). Combines the wave-magnetic force and relativistic correction.
wtsq
float
Trapping frequency squared |theta| (in rad² s⁻²), for use as wtsq_arg in nonlinear_S.

Comparison with oblique EMIC_ion_mod

The table below summarises the key differences between the two EMIC sub-modules.
Featureparallel_EMIC_modEMIC_ion_mod
Wave normal angleZero (field-aligned)Arbitrary oblique angle
Bessel functionsNot neededJm, Jm±1 via beta
wpi_paramsNot availableRequired per step
Coupling paramsDirect Bw, w/k termsC0, C1p, C1m coefficients
dkpardtNot availableAvailable
dwcdtNot availableAvailable
detadt species flags='ion' or 'electron'Not present

Complete integration step example

import numpy as np
import WPIT.WPI_mod.parallel_EMIC_mod as par_emic
from WPIT.Environment_mod import const

# --- Ion species: proton ---
mi = const.mH
qi = const.qi

# --- State vector at time t ---
ppar   = 1.1e-19     # parallel momentum [kg m/s]
pper   = 2.8e-19     # perpendicular momentum [kg m/s]
lamda  = np.deg2rad(4.0)
eta    = 0.5         # wave-particle phase [rad]
aeq    = np.deg2rad(55.0)
alpha  = np.deg2rad(50.0)   # local pitch angle [rad]
L_shell = 4.0

# --- Background field ---
Bmag   = 160e-9      # |B0| in T
wc     = qi * Bmag / mi          # non-relativistic cyclotron frequency
dwcds  = 6.0                     # d(wc)/dz [rad/m/s]

# --- Wave parameters (parallel propagation) ---
Bw      = 6e-9       # wave magnetic field [T]
w_wave  = 0.25 * wc  # wave frequency [rad/s]
kappa   = 2.5e-5     # wave number [rad/m]

# --- Lorentz factor ---
p_tot = np.sqrt(ppar**2 + pper**2)
gamma = np.sqrt(1 + (p_tot / (mi * const.c_light))**2)

# --- Equations of motion ---
dz     = par_emic.dzdt(ppar, gamma, mi)
dlamda = par_emic.dlamdadt(ppar, lamda, gamma, mi, L_shell)
dppar  = par_emic.dppardt(pper, eta, wc, Bw, gamma, dwcds, qi, mi)
dpper  = par_emic.dpperdt(ppar, pper, eta, Bw, gamma, w_wave, kappa, wc, dwcds, qi, mi)
dEk    = par_emic.dEkdt(pper, eta, gamma, Bw, kappa, w_wave, qi, mi)
dgam   = par_emic.dgammadt(pper, eta, gamma, Bw, kappa, w_wave, qi, mi)
dalpha_dt = par_emic.dalphadt(ppar, pper, eta, gamma, wc, dwcds, w_wave, kappa, Bw, mi, qi)
daeq   = par_emic.daeqdt(ppar, pper, eta, gamma, w_wave, kappa, Bw, aeq, alpha, mi, qi)
deta   = par_emic.detadt(ppar, pper, eta, Bw, w_wave, kappa, wc, gamma, qi, mi, 'ion')

# --- Nonlinear trapping ---
theta_val, wtsq = par_emic.nonlinear_theta(pper, ppar, Bw, kappa, gamma, mi, qi, wc, w_wave)
H = par_emic.nonlinear_H(pper, ppar, kappa, gamma, mi, wc, 0.0, dwcds, 0.0)
S = par_emic.nonlinear_S(H, wtsq)

print(f"deta/dt = {deta:.4e} rad/s")
print(f"S = {S:.4f}  ({'trapped' if abs(S) < 1 else 'librating'})")

Build docs developers (and LLMs) love