ARTS 2.5.11 (git: 725533f0)
arts_constants.h
Go to the documentation of this file.
1
36#ifndef CONSTANTS_IN_ARTS_H
37#define CONSTANTS_IN_ARTS_H
38
39#include <numbers>
40
41#include "arts_constexpr_math.h"
42#include "matpack_concepts.h"
43
45namespace Constant {
57inline constexpr Numeric pi = std::numbers::pi;
58
60inline constexpr Numeric inv_pi = std::numbers::inv_pi;
61
63inline constexpr Numeric two_pi = 2 * pi;
64
66inline constexpr Numeric inv_two_pi = 0.5 * inv_pi;
67
69inline constexpr Numeric sqrt_pi = 1.0/std::numbers::inv_sqrtpi;
70
72inline constexpr Numeric inv_sqrt_pi = std::numbers::inv_sqrtpi;
73
75inline constexpr Numeric euler = std::numbers::e;
76
78inline constexpr Numeric inv_euler = 1.0 / euler;
79
81inline constexpr Numeric log10_euler = std::numbers::log10e;
82
84inline constexpr Numeric ln_10 = std::numbers::ln10;
85
87inline constexpr Numeric sqrt_2 = std::numbers::sqrt2;
88
90inline constexpr Numeric inv_sqrt_2 = 1.0 / sqrt_2;
91
93inline constexpr Numeric ln_2 = std::numbers::ln2;
94
96inline constexpr Numeric inv_ln_2 = 1.0 / ln_2;
97
99inline constexpr Numeric sqrt_ln_2 =
100 0.8325546111576977563531646448952010476305888522644407291668291172340794351973;
101
103inline constexpr Numeric inv_sqrt_ln_2 =
104 1.201122408786449794857803286095221722566764028068699423868879896733837175546;
105
110inline constexpr Numeric Delta_nu_Cs = 9192631770;
111
116inline constexpr Numeric speed_of_light = 299792458;
117
119inline constexpr Numeric c = speed_of_light;
120
125inline constexpr Numeric planck_constant = 6.62607015e-34;
126
128inline constexpr Numeric h = planck_constant;
129
131inline constexpr Numeric reduced_planck_constant = h * inv_two_pi;
132
134inline constexpr Numeric h_bar = reduced_planck_constant;
135
140inline constexpr Numeric elementary_charge = 1.602176634e-19;
141
143inline constexpr Numeric e = elementary_charge;
144
149inline constexpr Numeric boltzmann_constant = 1.380649e-23;
150
152inline constexpr Numeric k = boltzmann_constant;
153
158inline constexpr Numeric avogadro_constant = 6.02214076e23;
159
161inline constexpr Numeric NA = avogadro_constant;
162
167inline constexpr Numeric K_cd = 683;
168
174inline constexpr Numeric fine_structure_constant = 7.2973525693e-3;
175
177inline constexpr Numeric alpha = fine_structure_constant;
178
184inline constexpr Numeric rydberg_constant = 10973731.568160;
185
187inline constexpr Numeric R_inf = rydberg_constant;
188
190inline constexpr Numeric magnetic_constant = 2 * h * alpha / (c * Math::pow2(e));
191
193inline constexpr Numeric mu_0 = magnetic_constant;
194
196inline constexpr Numeric vacuum_permittivity = Math::pow2(e) / (2 * h * c * alpha);
197
199inline constexpr Numeric epsilon_0 = vacuum_permittivity;
200
202inline constexpr Numeric electron_mass = 2 * h * R_inf / (c * Math::pow2(alpha));
203
205inline constexpr Numeric m_e = electron_mass;
206
212inline constexpr Numeric unified_atomic_mass_unit = 1.66053906660e-27;
213
215inline constexpr Numeric m_u = unified_atomic_mass_unit;
216
222inline constexpr Numeric mass_ratio_electrons_per_proton = 1'836.152'673'43;
223
225inline constexpr Numeric proton_mass =
227
233inline constexpr Numeric mass_ratio_electrons_per_neutron = 1'838.683'661'73;
234
236inline constexpr Numeric neutron_mass =
238
240inline constexpr Numeric bohr_magneton = e * h_bar / (2 * m_e);
241
243inline constexpr Numeric ideal_gas_constant = k * NA;
244
246inline constexpr Numeric R = ideal_gas_constant;
247
249inline constexpr Numeric doppler_broadening_const_squared = 2'000 * R / Math::pow2(c);
250
252inline constexpr Numeric one_degree_in_radians = pi / 180;
253
255inline constexpr Numeric stefan_boltzmann_constant =
257
259inline constexpr Numeric sigma = stefan_boltzmann_constant;
260
266inline constexpr Numeric density_of_ice_at_0c = 0.9167e3;
267
273inline constexpr Numeric denity_of_water_at_4c = 1e3;
274
279inline constexpr Numeric cosmic_microwave_background_temperature = 2.735;
280
285inline constexpr Numeric earth_radius = 6.3781e6;
286
291inline constexpr Numeric temperature_at_0c = 273.15;
292}; // namespace Constant
293
294#endif
Simple constexpr math that we can make use of in Arts.
Namespace containing several constants, physical and mathematical.
constexpr Numeric unified_atomic_mass_unit
Unified atomic mass unit [kg] From: https://physics.nist.gov/cgi-bin/cuu/Value?ukg Date: 2020-02-18 R...
constexpr Numeric R_inf
Rydberg constant convenience name [1/m].
constexpr Numeric log10_euler
Ten's logarithm of Euler's number.
constexpr Numeric bohr_magneton
Bohr magneton [J/T].
constexpr Numeric one_degree_in_radians
One degree in radians.
constexpr Numeric inv_two_pi
Inverse of two pi.
constexpr Numeric inv_sqrt_pi
Inverse of the square root of pi.
constexpr Numeric m_e
Mass of resting electron convenience name [kg].
constexpr Numeric Delta_nu_Cs
Cesium-133 Unperturbed ground-state hyperfine transition frequency [Hz] From: https://en....
constexpr Numeric cosmic_microwave_background_temperature
Global constant, Planck temperature for cosmic background radiation [K].
constexpr Numeric fine_structure_constant
Fine structure constant [-] From: https://physics.nist.gov/cgi-bin/cuu/Value?alph Date: 2019-06-18 Re...
constexpr Numeric h_bar
Reduced planck constant convenience name [J s].
constexpr Numeric doppler_broadening_const_squared
Doppler broadening constant squared [kg/T]^2.
constexpr Numeric boltzmann_constant
Boltzmann constant [J/K] From: https://en.wikipedia.org/wiki/2019_redefinition_of_SI_base_units Date:...
constexpr Numeric sqrt_ln_2
Square root of natural logarithm of 2.
constexpr Numeric pi
The following mathematical constants are generated in python Decimal package by the code:
constexpr Numeric vacuum_permittivity
Vacuum permittivity [F/m].
constexpr Numeric euler
Euler's number.
constexpr Numeric electron_mass
Mass of resting electron [kg].
constexpr Numeric stefan_boltzmann_constant
Stefan-Boltzmann constant [W/(K^4*m^2)].
constexpr Numeric ln_2
Natural logarithm of 2.
constexpr Numeric inv_ln_2
Inverse of the natural logarithm of 2.
constexpr Numeric ideal_gas_constant
Ideal gas constant [J/mol K].
constexpr Numeric neutron_mass
Mass of a neutron [kg].
constexpr Numeric ln_10
Natural logarithm of 10.
constexpr Numeric two_pi
Two times pi.
constexpr Numeric inv_sqrt_ln_2
Inverse of the square root of the natural logarithm of 2.
constexpr Numeric R
Ideal gas constant convenience name [J/mol K].
constexpr Numeric K_cd
Luminous efficacy of monochromatic 540 THz radiation [lm / W] From: https://en.wikipedia....
constexpr Numeric k
Boltzmann constant convenience name [J/K].
constexpr Numeric mass_ratio_electrons_per_neutron
Mass ratio of electrons to protons [-] From: https://physics.nist.gov/cgi-bin/cuu/Value?...
constexpr Numeric speed_of_light
Speed of light [m/s] From: https://en.wikipedia.org/wiki/2019_redefinition_of_SI_base_units Date: 201...
constexpr Numeric reduced_planck_constant
Reduced planck constant [J s].
constexpr Numeric rydberg_constant
Rydberg constant [1/m] From: https://physics.nist.gov/cgi-bin/cuu/Value?ryd Date: 2016-06-18 Reported...
constexpr Numeric inv_euler
Inverse of Euler's number.
constexpr Numeric earth_radius
Global constant, the radius of the Earth [m].
constexpr Numeric inv_sqrt_2
Inverse of the square root of 2.
constexpr Numeric planck_constant
Planck constant [J s] From: https://en.wikipedia.org/wiki/2019_redefinition_of_SI_base_units Date: 20...
constexpr Numeric NA
Avogadro constant convenience name [1/mol].
constexpr Numeric sigma
Stefan-Boltzmann constant convenience name [W/(K^4*m^2)].
constexpr Numeric sqrt_pi
Square root of pi.
constexpr Numeric c
Speed of light convenience name [m/s].
constexpr Numeric magnetic_constant
Magnetic constant [H/m].
constexpr Numeric avogadro_constant
Avogadro constant [1/mol] From: https://en.wikipedia.org/wiki/2019_redefinition_of_SI_base_units Date...
constexpr Numeric e
Elementary charge convenience name [C].
constexpr Numeric temperature_at_0c
Global constant, Temperature in Celsius of 0 Kelvin.
constexpr Numeric inv_pi
Inverse of pi.
constexpr Numeric elementary_charge
Elementary charge [C] From: https://en.wikipedia.org/wiki/2019_redefinition_of_SI_base_units Date: 20...
constexpr Numeric h
Planck constant convenience name [J s].
constexpr Numeric proton_mass
Mass of a proton [kg].
constexpr Numeric density_of_ice_at_0c
Global constant, Density of water ice at 0C [kg/m3] source: http://en.wikipedia.org/wiki/Ice.
constexpr Numeric mass_ratio_electrons_per_proton
Mass ratio of electrons to protons [-] From: https://physics.nist.gov/cgi-bin/cuu/Value?...
constexpr Numeric alpha
Fine structure constant convenience name [-].
constexpr Numeric mu_0
Magnetic constant convenience name [H/m].
constexpr Numeric sqrt_2
Square root of 2.
constexpr Numeric denity_of_water_at_4c
Global constant, Density of liquid water +4C [kg/m3] source: http://en.wikipedia.org/wiki/Water.
constexpr Numeric epsilon_0
Vacuum permittivity convenience name [F/m].
constexpr Numeric m_u
Unified atomic mass unit convenience name [kg].
constexpr auto pow3(auto x) noexcept
power of three
constexpr auto pow4(auto x) noexcept
power of four
constexpr auto pow2(auto x) noexcept
power of two