Constants (plasmapy.constants)

The constants module contains many physical and mathematical constants that are commonly used in the plasma sciences.

Mathematical constants (such as pi) are provided as float objects.

Physical constants are imported directly from Astropy’s constants subpackage as instances of the Constant class (which is a subclass of Quantity). We recommend reviewing the documentation for Astropy’s constants subpackage for more details (including Astropy’s strategy for versioning constants). Physical constants by default are provided in SI units.

Getting Started

Constants in SI units may be imported directly from PlasmaPy’s constants subpackage. These objects may be treated very much like Quantity instances.

Suppose we want to calculate the fine structure constant,

\[\alpha = \frac{1}{4 \pi \epsilon_0} \frac{e^2}{\hbar c},\]

using constants.

>>> from plasmapy.constants import eps0, e, hbar, c, pi as π
>>> α = (e ** 2 / (4 * π * eps0 * hbar * c)).si
>>> α ** -1
<Quantity 137.03599911>

Warning

The values of constants that are not defined exactly will change slightly as improved measurements become available.

Reference/API

plasmapy.constants Package

Contains physical and mathematical constants commonly used in plasma physics.

The following constants are available:

Name Value Units Description
pi 3.141592653589793   Ratio of circumference to diameter of circle
G 6.67408e-11 m3 / (kg s2) Gravitational constant
L_sun 3.828e+26 W Nominal solar luminosity
M_earth 5.97236473042e+24 kg Earth mass
M_sun 1.98847541534e+30 kg Solar mass
N_A 6.022140857e+23 1 / (mol) Avogadro’s number
R 8.3144598 J / (K mol) Gas constant
R_earth 6378100 m Nominal Earth equatorial radius
R_sun 695700000 m Nominal solar radius
Ryd 10973731.5685 1 / (m) Rydberg constant
a0 5.2917721067e-11 m Bohr radius
atm 101325 Pa Standard atmosphere
au 149597870700 m Astronomical Unit
c 299792458 m / (s) Speed of light in vacuum
e 1.6021766208e-19 C Electron charge
eps0 8.854187817e-12 F/m Electric constant
g0 9.80665 m / s2 Standard acceleration of gravity
h 6.62607004e-34 J s Planck constant
hbar 1.0545718e-34 J s Reduced Planck constant
k_B 1.38064852e-23 J / (K) Boltzmann constant
kpc 3.08567758147e+19 m Kiloparsec
m_e 9.10938356e-31 kg Electron mass
m_n 1.674927471e-27 kg Neutron mass
m_p 1.672621898e-27 kg Proton mass
mu0 1.25663706144e-06 N/A2 Magnetic constant
muB 9.274009994e-24 J/T Bohr magneton
pc 3.08567758147e+16 m Parsec
sigma_T 6.6524587158e-29 m2 Thomson scattering cross-section
sigma_sb 5.670367e-08 W / (K4 m2) Stefan-Boltzmann constant
u 1.66053904e-27 kg Atomic mass