-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Derived units calculation issue #1226
Comments
The translation values are correct but unexpected to me also. I had to experiment a bit to figure out the semantics. The syntax of the above UNITS block is used to define constants (R, J, and test) that have units, and the right side of the = uses the units database to determine the values of those constants. So R on the left hand side is the name of a constant and R in parentheses To add a new unit to the database, one must use the syntax
but you will get a message on translation like
and if you fix that, then a similar error for mole.
And then in the translated c file you would see:
I have a very old units.html file that discusses all this. It needs to be incorporated into the docs. Here are the relevant text fragments.
|
The discrepancy in NMODL got fixed in NMODL with BlueBrain/nmodl#1030 so this can be closed. |
Context
NEURON mod translation error in the calculated value for derived units
Overview of the issue
When calculating values of derived units from other units when needed to do a calculation like multiplication or division there is an error in the computed values by
mod2c
andNEURON
.For example for:
We have with NEURON:
With mod2c:
For the above modern units were selected.
Note that hex and decimal numbers match.
Expected result/behavior
From the above we see that
mole = 6.02214075999999987e+23
,R = 8.313424
and if we calculate by handJ = R*mole
we have:NEURON setup
Minimal working example - MWE
Translate any mod file with:
Same as: BlueBrain/mod2c#62
The text was updated successfully, but these errors were encountered: