Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.5 KB

index.rst

File metadata and controls

47 lines (34 loc) · 1.5 KB

Constants (plasmapy.constants)

The ~plasmapy.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 ~astropy.constants subpackage as instances of the ~astropy.constants.Constant class (which is a subclass of ~astropy.units.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 ~plasmapy.constants subpackage. These objects may be treated very much like ~astropy.units.Quantity instances.

Suppose we want to calculate the fine structure constant,

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

using ~plasmapy.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