Values for Gas and Faraday constants

Anything that doesn't fit elsewhere.
Post Reply
bcumming
Posts: 5
Joined: Tue Nov 07, 2017 12:42 pm

Values for Gas and Faraday constants

Post by bcumming »

I have a question about the values used for the gas constant R
and Faraday's constant in NEURON. Specifically, NEURON uses what
appear to be incorrect values:

Code: Select all

                                                             
           --------------------------------
            R               Faraday
-------------------------------------------
correct     8.3144598(48)   96485.33289(59)
neuron      8.3134          96485.309
-------------------------------------------
https://physics.nist.gov/cgi-bin/cuu/Value?f
https://physics.nist.gov/cgi-bin/cuu/Value?r
src/nrnoc/eion.c:188

Is there a reason why these specific values have been used?

The reversal potentials that NEURON calculates using the Nernst
equation have errors as a result in the 4th digit, for example
the potassium and sodium species using the default concentrations
and temperature:

Code: Select all

        --------------------------------------
        ek                   ena
----------------------------------------------
nernst  -74.17164678271602   63.55148117386006
NEURON  -74.162211           63.543396
----------------------------------------------
The values for the reversal potentials are not wrong by much,
to the point where it probably doesn't have a significant impact
on people's models, but it makes validation a challenge!

Cheers,

Ben.
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: Values for Gas and Faraday constants

Post by hines »

Thanks. I've made the relevant changes in src/oc/init.c, src/nrnoc/eion.c and share/lib/nrnunits.lib .
I have not pushed to github yet as I'm still thinking about the consequence of changing double precision consistency with respect to
legacy models. I looked in the current linux units database and see the fragment

Code: Select all

faraday                 N_A e mol     # Charge that must flow to deposit or
faraday_phys            96521.9 C     #   liberate one gram equivalent of any
faraday_chem            96495.7 C     #   element.  (The chemical and physical
                                      #   values are off slightly from what is
                                      #   obtained by multiplying by amu_chem
                                      #   or amu_phys.  These values are from
                                      #   a 1991 NIST publication.)  Note that
                                      #   there is a Faraday constant which is
                                      #   equal to N_A e and hence has units of
                                      #   C/mol.
I'm trying to decide if there needs to be a new flag variable for the interpreter in order to revert to the older values in order to make it easier to diagnose differences.
bcumming
Posts: 5
Joined: Tue Nov 07, 2017 12:42 pm

Re: Values for Gas and Faraday constants

Post by bcumming »

Hello Michael,

I did some more digging on the NIST site, and the values of these constants has changed over time.

Code: Select all

        R           F   
2014    8.3144598   96485.33289
2010    8.3144621   96485.3365
2002    8.314472    96485.3383
1998    8.314472    96485.3415
1986    8.314510    96485.309
1973    8.31441     96486.95
The value used in NEURON for F has is the value given by NIST in 1986.

You bring up a very interesting point about how to handle changing values in constants in a "backwards compatible" way.
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Values for Gas and Faraday constants

Post by ted »

The values of all empirically derived constants have changed over time. These variations are much smaller than the errors inherent in most if not all of the experimental measurements that are used as the basis for mechanistic computational modeling. The chief practical consequence is limited but still important because of its implications for comparison of numerical results as a means for evaluating different versions of the same program etc..
hines
Site Admin
Posts: 1682
Joined: Wed May 18, 2005 3:32 pm

Re: Values for Gas and Faraday constants

Post by hines »

The configuration variable --disable-LegacyFR (the default is --enable-LegacyFR) uses the new NIST values for

Code: Select all

/ Nov, 2017 updated faraday, R, e, planck, hbar, mole, k according to
/ https://physics.nist.gov/cuu/Constants/index.html
So no one will see any difference without the explicit configure request. My test without the disable is

Code: Select all

mod UNITS FARADAY=96485.3  R=8.31446 R(from k-mole)=8.3145
hoc: FARADAY=96485.309  R=8.31441
nernst(.1, 10, 2) = 55.4417956457
and with --disable-LegacyFR

Code: Select all

mod UNITS FARADAY=96485.33289  R=8.3144598 R(from k-mole)=8.31445986145
hoc: FARADAY=96485.33289  R=8.3144598
nernst(.1, 10, 2) = 55.4488496883
Ted is, of course, correct that this was probably not worth the effort.
Post Reply