Constants#

Physical, mathematical, computational, isotope, and material constants.

Defines the following constants:
Mathematical

Pi, Pi2, Pi3, TwoPi, Sqrt2, pi, pi2, pi3, Twopi

Physical

Gravity, T0, P0, T25, sigma, R, R_air, R_H2O, Na, REarth

Isotope

R13VPDB, R18VSMOW, R2VSMOW

Computational

tiny, huge, eps

Material

mmol_co2, mmol_h2o, mmol_air, density_quartz, cheat_quartz, cheat_water, cheat_air, latentheat_vaporization

This module was written by Matthias Cuntz while at Department of Computational Hydrosystems, Helmholtz Centre for Environmental Research - UFZ, Leipzig, Germany, and continued while at Institut National de Recherche pour l’Agriculture, l’Alimentation et l’Environnement (INRAE), Nancy, France.

copyright:

Copyright 2012-2021 Matthias Cuntz, see AUTHORS.rst for details.

license:

MIT License, see LICENSE for details.

Constants:

Pi

Mathematical constant \(\pi\)

Pi2

Mathematical constant \(\pi/2\)

Pi3

Mathematical constant \(\pi/3\)

TwoPi

Mathematical constant \(2\pi\)

pi

Mathematical constant \(\pi\)

pi2

Mathematical constant \(\pi/2\)

pi3

Mathematical constant \(\pi/3\)

Twopi

Mathematical constant \(2\pi\)

Sqrt2

Mathematical constant \(\sqrt{2}\)

sqrt2

Mathematical constant \(\sqrt{2}\)

gravity

Standard average Earth's gravity (\(m^2 s^{-1}\))

T0

0 degree Celsius in Kelvin.

P0

Standard pressure (Pa)

T25

Standard ambient temperature of 25 \(^\circ C\) in Kelvin [K]

sigma

Stefan-Boltzmann constant (\(W m^{-2} K^{-4}\))

R

Ideal gas constant R = Na*kB (\(J K^{-1} mol^{-1}\))

Rair

Specific gas constant of dry air Rair = R/molmass_air (\(J K^{-1} kg^{-1}\))

Rh2o

Gas constant of water vapour Rh2o = R/molmass_h2o (\(J K^{-1} kg^{-1}\))

Na

Avogadro number (\(mol^{-1}\))

kB

Boltzmann constant (\(J K^{-1}\))

REarth

Radius of the Earth (m)

mmol_co2

Molar mass of \(CO_2\) (\(g mol^{-1}\))

molmass_co2

Molar mass of \(CO_2\) (\(kg mol^{-1}\))

mmol_h2o

Molar mass of water (\(g mol^{-1}\))

molmass_h2o

Molar mass of water (\(kg mol^{-1}\))

mmol_air

Molar mass of dry air of standard atmosphere (\(g mol^{-1}\))

molmass_air

Molar mass of dry air (\(kg mol^{-1}\))

density_quartz

Density of quartz (\(g cm^{-3}\))

cheat_quartz

Heat capacity of quartz (\(J kg^-1 K^-1\))

cheat_water

Heat capacity of water (\(J kg^{-1} K^{-1}\))

cheat_air

Heat capacity of air (\(J kg^{-1} K^{-1}\))

latentheat_vaporization

Latent heat of vaporization of water (\(J kg^{-1}\))

R13VPDB

\(^{13}C\) isotope ratio of VPDB

R18VSMOW

\(^{18}O\) isotope ratio of VSMOW

R2VSMOW

Deuterium= \(^{2}H\) isotope ratio of VSMOW

tiny

The smallest positive floating point number with full precision.

huge

The largest representable floating point number.

eps

Numerical precision of floats.

History
  • Written Jan 2012 by Matthias Cuntz (mc (at) macu (dot) de)

  • Ported to Python 3, Feb 2013, Matthias Cuntz

  • Added dielectric constant for water, Mar 2014, Arndt Piayda

  • Added heat capacities for air, water and quartz as well as density of quartz, Sep 2014, Arndt Piayda

  • Added Pi3=pi/3, R13VPDB, R18VSMOW, R2VSMOW, Mar 2015, Matthias Cuntz

  • Renamed heat capacities, molar masses, density of quartz, Mar 2015, Matthias Cuntz

  • Moved calculation of dielectric constant of water to own routine, Mar 2015, Matthias Cuntz

  • Added computational constants such as tiny=np.finfo(np.float).tiny, Nov 2016, Matthias Cuntz

  • Added gas constants for dry air and water, May 2017, RL

  • Using numpy docstring format, May 2020, Matthias Cuntz

  • Added lowercase version of pi constants, May 2020, Matthias Cuntz

  • Updated all constants related to gases for redefinition of SI units of 2019, Jan 2023, Matthias Cuntz

  • Renamed some constant for greater consistency, Jan 2023, Matthias Cuntz

Na = 6.02214076e+23#

Avogadro number (\(mol^{-1}\))

P0 = 101325.0#

Standard pressure (Pa)

Pi = 3.141592653589793#

Mathematical constant \(\pi\)

Pi2 = 1.5707963267948966#

Mathematical constant \(\pi/2\)

Pi3 = 1.0471975511965979#

Mathematical constant \(\pi/3\)

R = 8.31446261815324#

Ideal gas constant R = Na*kB (\(J K^{-1} mol^{-1}\))

R13VPDB = 0.0112372#

\(^{13}C\) isotope ratio of VPDB

R18VSMOW = 0.0020052#

\(^{18}O\) isotope ratio of VSMOW

R2VSMOW = 0.00015576#

Deuterium= \(^{2}H\) isotope ratio of VSMOW

REarth = 6371009.0#

Radius of the Earth (m)

Rair = 287.05799595894405#

Specific gas constant of dry air Rair = R/molmass_air (\(J K^{-1} kg^{-1}\))

Rh2o = 461.52280831345604#

Gas constant of water vapour Rh2o = R/molmass_h2o (\(J K^{-1} kg^{-1}\))

Sqrt2 = 1.4142135623730951#

Mathematical constant \(\sqrt{2}\)

T0 = 273.15#

0 degree Celsius in Kelvin. Conversion constant from Celsius to Kelvin.

T25 = 298.15#

Standard ambient temperature of 25 \(^\circ C\) in Kelvin [K]

TwoPi = 6.283185307179586#

Mathematical constant \(2\pi\)

Twopi = 6.283185307179586#

Mathematical constant \(2\pi\)

cheat_air = 1010.0#

Heat capacity of air (\(J kg^{-1} K^{-1}\))

cheat_quartz = 800.0#

Heat capacity of quartz (\(J kg^-1 K^-1\))

cheat_water = 4180.0#

Heat capacity of water (\(J kg^{-1} K^{-1}\))

density_quartz = 2.65#

Density of quartz (\(g cm^{-3}\))

eps = np.float64(2.220446049250313e-16)#

Numerical precision of floats. The difference between 1.0 and the next smallest representable float larger than 1.0. For example, for 64-bit binary floats in the IEEE-754 standard, \(eps = 2^{-52}\), approximately 2.22e-16.

gravity = 9.80665#

Standard average Earth’s gravity (\(m^2 s^{-1}\))

huge = np.float64(1.7976931348623157e+308)#

The largest representable floating point number.

latentheat_vaporization = 2450000.0#

Latent heat of vaporization of water (\(J kg^{-1}\))

mmol_air = 28.9644#

Molar mass of dry air of standard atmosphere (\(g mol^{-1}\))

mmol_co2 = 44.009#

Molar mass of \(CO_2\) (\(g mol^{-1}\))

mmol_h2o = 18.01528#

Molar mass of water (\(g mol^{-1}\))

molmass_air = 0.0289644#

Molar mass of dry air (\(kg mol^{-1}\))

molmass_co2 = 0.044009#

Molar mass of \(CO_2\) (\(kg mol^{-1}\))

molmass_h2o = 0.01801528#

Molar mass of water (\(kg mol^{-1}\))

pi = 3.141592653589793#

Mathematical constant \(\pi\)

pi2 = 1.5707963267948966#

Mathematical constant \(\pi/2\)

pi3 = 1.0471975511965979#

Mathematical constant \(\pi/3\)

sigma = 5.67e-08#

Stefan-Boltzmann constant (\(W m^{-2} K^{-4}\))

sqrt2 = 1.4142135623730951#

Mathematical constant \(\sqrt{2}\)

tiny = np.float64(2.2250738585072014e-308)#

The smallest positive floating point number with full precision.