NAME
Physics::CPD - Computational Plasma Dynamics: fundamental magnetised-plasma parameters
SYNOPSIS
use Physics::CPD;
my $plasma = Physics::CPD->new(
electron_density => 8e19, # m^-3
electron_temperature => 4000, # eV
ion_temperature => 2000, # eV
magnetic_field => 2.5, # T
ion_species => 'H',
);
printf "Debye length = %.3e m\n", $plasma->debye_length;
printf "plasma beta = %.2f %%\n", 100 * $plasma->plasma_beta;
print $plasma->report;
DESCRIPTION
Physics::CPD is a lightweight, pure-Perl engine for computational plasma dynamics. It models a quasineutral, magnetised plasma from a small set of state variables (density, electron/ion temperature, magnetic field and ion species) and derives the standard characteristic frequencies, lengths, speeds, pressures and collisional parameters used throughout magnetic-confinement fusion and space-plasma physics.
Temperatures are supplied in electron-volts (eV), the customary plasma unit; all other quantities use SI. The class is built with Moo so every state variable is a read/write accessor and derived quantities are ordinary methods.
It is the computational base for Physics::CPD::Stellarator, which adds stellarator geometry and Wendelstein 7-X modelling.
ATTRIBUTES
- electron_density (n_e, m^-3, default 1e20)
- electron_temperature (T_e, eV, default 1000)
- ion_temperature (T_i, eV, defaults to T_e)
- magnetic_field (B, tesla, default 1)
- ion_species (chemical symbol; H, D, T, He, He3, C, O, ..., default 'H')
- ion_mass (kg, derived from the species unless overridden)
- ion_charge (Z, derived from the species unless overridden)
METHODS
Frequencies (rad/s, with _hz variants): electron_plasma_frequency, ion_plasma_frequency, electron_cyclotron_frequency, ion_cyclotron_frequency.
Lengths and speeds: debye_length, electron_gyroradius, ion_gyroradius, electron_thermal_velocity, ion_thermal_velocity, alfven_velocity, ion_sound_speed.
Pressures and energetics: plasma_pressure, magnetic_pressure, plasma_beta.
Collisional transport (NRL Plasma Formulary): coulomb_logarithm, collision_frequency, mean_free_path, spitzer_resistivity.
Other: ion_density, mass_density, plasma_parameter, as_hash, report.
SEE ALSO
AUTHOR
Generated for the Physics-Stellarator project.
LICENSE
Copyright (C) 2026 the Physics-Stellarator authors.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. See https://www.gnu.org/licenses/gpl-3.0.html.