Physical Constants¶
Constant contents¶
Constant introduction¶
In order to avoid confusing numerical differences when using multiprecision arithmetic, physical constants are template functions which return a value given a user-specified floating-point type. Physical constants are promoted to higher precision by adding zeros in the base-10 representation. The constants are in the namespace o2scl_const. The numerical values are periodically updated with CODATA, the Particle Data Book, and other databases. A handful of constants have a short name for their values in double precision, see below.
The find_constants class contains a
simple constant database which can be searched at compiled time
and also provides the constant database to acol -constants
(see The acol Command Line Utility).
These physical constants can also be used to create unit conversion factors, described in Unit Conversions.
Namespace o2scl_const¶
-
namespace o2scl_const¶
Constants.
Previous versions contained constants from [Luzum11] and [Mohr12] .
CODATA 2022 values are from physics.nist.gov/constants. IAU 2015 values are the nominal values from arXiv:1510.07674 and arXiv:1605.09788 .
Unit prefixes
-
const double quetta = 1e30¶
-
const double ronna = 1e27¶
-
const double yotta = 1e24¶
-
const double zetta = 1e21¶
-
const double exa = 1e18¶
-
const double peta = 1e15¶
-
const double tera = 1e12¶
-
const double giga = 1e9¶
-
const double mega = 1e6¶
-
const double kilo = 1e3¶
-
const double milli = 1e-3¶
-
const double micro = 1e-6¶
-
const double nano = 1e-9¶
-
const double pico = 1e-12¶
-
const double femto = 1e-15¶
-
const double atto = 1e-18¶
-
const double zepto = 1e-21¶
-
const double yocto = 1e-24¶
-
const double ronto = 1e-27¶
-
const double quecto = 1e-30¶
Unit systems
-
static const size_t o2scl_mks = 1¶
MKS units.
-
static const size_t o2scl_cgs = 2¶
CGS units.
Mathematical constants
Physical constants
-
template<class fp_t>
fp_t hbar_f(size_t system = o2scl_mks)¶ Reduced Planck constant (derived; exact)
-
template<class fp_t>
fp_t hbarc_f(size_t system = o2scl_mks)¶ Reduced Planck’s constant times speed of light \( \hbar c \) (derived; exact)
-
template<class fp_t>
fp_t gravitational_constant_f(size_t system = o2scl_mks)¶ Gravitational constant (CODATA 2022 value)
-
template<class fp_t>
fp_t hc_mev_fm_f()¶ Reduced Planck constant times speed of light in \( \mathrm{MeV}~\mathrm{fm} \) (derived; exact)
-
template<class fp_t>
fp_t stefan_boltz_cons_f(size_t system = o2scl_mks)¶ Stefan-Boltzmann constant ( \( \mathrm{kg} / \mathrm{K}^4 \mathrm{s}^3 \) in MKS and \( \mathrm{g} / \mathrm{K}^4 \mathrm{s}^3 \) in CGS; derived; exact)
-
template<class fp_t>
fp_t gfermi_gev2_f()¶ Fermi coupling constant in \( \mathrm{GeV}^{-2} \) (PDG 2024 value)
-
template<class fp_t>
fp_t gfermi_f(size_t system = o2scl_mks)¶ Fermi coupling constant in ( \( \mathrm{s}^4 / \mathrm{m}^4 \mathrm{kg}^2 \) in MKS and \( \mathrm{s}^4 / \mathrm{cm}^4 \mathrm{g}^2 \) in CGS; derived from gfermi_gev2_f())
Astrophysical constants
-
template<class fp_t>
fp_t astronomical_unit_f(size_t system = o2scl_mks)¶ Astronomical unit (IAU 2009 value; now exact)
-
template<class fp_t>
fp_t grav_accel_f(size_t system = o2scl_mks)¶ Acccleration due to gravity ( \( \mathrm{m} / \mathrm{s}^2 \) in MKS and \( \mathrm{cm} / \mathrm{s}^2 \) in CGS ) (CODATA 2018; now exact)
-
template<class fp_t>
fp_t sidereal_year_f(size_t system = o2scl_mks)¶ Sidereal year in s (PDG 2024 value)
Particle masses
-
template<class fp_t>
fp_t mass_neutron_f(size_t system = o2scl_mks)¶ Neutron mass (CODATA 2022 value)
Nuclear masses
-
template<class fp_t>
fp_t mass_deuteron_f(size_t system = o2scl_mks)¶ Deuteron mass (CODATA 2022 value)
Chemical constants
-
template<class fp_t>
fp_t rydberg_f(size_t system = o2scl_mks)¶ Rydberg constant ( \( \mathrm{kg} \mathrm{m}^2 / \mathrm{s}^2 \) in MKS and \( \mathrm{g} \mathrm{cm}^2 / \mathrm{s}^2 \) in CGS; CODATA 2022 value)
This is referred to as the “Rydberg constant” by GSL and is equal to \( h c R_{\infty} \). The value \( R_{\infty} \) is the inverse Rydberg wavelength (also sometimes referred to as the Rydberg constant).
-
const double quetta = 1e30¶