NEURON
nrnunits_modern.h
Go to the documentation of this file.
1 #ifndef nrnunits_modern_h
2 #define nrnunits_modern_h
3 
4 /**
5  NMODL translated MOD files get unit constants typically from
6  share/lib/nrnunits.lib.in. But there were other source files that
7  hardcode some of the constants. Here we gather a few modern units into
8  a single place (but, unfortunately, also in nrnunits.lib.in). Legacy units
9  cannot be gathered here because they can differ slightly from place to place.
10 
11  These come from https://physics.nist.gov/cuu/Constants/index.html.
12  Termed the "2018 CODATA recommended values", they became available
13  on 20 May 2019 and replace the 2014 CODATA set.
14 
15  See oc/hoc_init.c, nrnoc/eion.c, nrniv/kschan.h
16 **/
17 
18 
19 #define _electron_charge_codata2018 1.602176634e-19 /* coulomb exact*/
20 #define _avogadro_number_codata2018 6.02214076e+23 /* exact */
21 #define _boltzmann_codata2018 1.380649e-23 /* joule/K exact */
22 #define _faraday_codata2018 (_electron_charge_codata2018*_avogadro_number_codata2018) /* 96485.33212... coulomb/mol */
23 #define _gasconstant_codata2018 (_boltzmann_codata2018*_avogadro_number_codata2018) /* 8.314462618... joule/mol-K */
24 
25 /* e/k in K/millivolt */
26 #define _e_over_k_codata2018 (.001*_electron_charge_codata2018/_boltzmann_codata2018) /* 11.604518... K/mV */
27 
28 #endif /* nrnunits_modern_h */