This repository was archived by the owner on Mar 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathnrnunits_modern.h
More file actions
36 lines (29 loc) · 1.45 KB
/
nrnunits_modern.h
File metadata and controls
36 lines (29 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
# =============================================================================
# Copyright (c) 2016 - 2021 Blue Brain Project/EPFL
#
# See top-level LICENSE file for details.
# =============================================================================
*/
#pragma once
/**
NMODL translated MOD files get unit constants typically from
share/lib/nrnunits.lib.in. But there were other source files that
hardcode some of the constants. Here we gather a few modern units into
a single place (but, unfortunately, also in nrnunits.lib.in). Legacy units
cannot be gathered here because they can differ slightly from place to place.
These come from https://physics.nist.gov/cuu/Constants/index.html.
Termed the "2018 CODATA recommended values", they became available
on 20 May 2019 and replace the 2014 CODATA set.
See oc/hoc_init.c, nrnoc/eion.c, nrniv/kschan.h
**/
#define _electron_charge_codata2018 1.602176634e-19 /* coulomb exact*/
#define _avogadro_number_codata2018 6.02214076e+23 /* exact */
#define _boltzmann_codata2018 1.380649e-23 /* joule/K exact */
#define _faraday_codata2018 \
(_electron_charge_codata2018 * _avogadro_number_codata2018) /* 96485.33212... coulomb/mol */
#define _gasconstant_codata2018 \
(_boltzmann_codata2018 * _avogadro_number_codata2018) /* 8.314462618... joule/mol-K */
/* e/k in K/millivolt */
#define _e_over_k_codata2018 \
(.001 * _electron_charge_codata2018 / _boltzmann_codata2018) /* 11.604518... K/mV */