Page 1 of 1

eca calculation

Posted: Wed Jan 30, 2019 7:01 pm
Hi,
I wanted to ask how does NEURON knows when to calculate eca from cai and cao or not to. For example in Mainen's model https://senselab.med.yale.edu/modeldb/s ... %2F#tabs-1 the eca is always 140. But when using one of the BBP models from their portal it is updated every timestep. How does the environment knows if to calculate eca or keep it constant?
Roy

Re: eca calculation

Posted: Thu Jan 31, 2019 1:16 am
Good question. Read the Programmer's Reference documentation of ion_style.

Re: eca calculation

Posted: Thu Jan 31, 2019 1:54 pm
Thank, Ted!

Re: eca calculation

Posted: Thu Jan 31, 2019 2:40 pm
I am a bit confused trying to figure this out. From the program reference i get this:
The oldstyle value is previous internal setting of c_style + 4*cinit + 8*e_style + 32*einit + 64*eadvance.

c_style: 0, 1, 2, 3.
Concentrations respectively treated as UNUSED, PARAMETER, ASSIGNED, or STATE variables. Determines which panel (if any) will show the concentrations.
e_style: 0, 1, 2, 3.
Reversal potential respectively treated as UNUSED, PARAMETER, ASSIGNED, or STATE variable.
einit: 0 or 1.
If 1 then reversal potential computed by Nernst equation on call to finitialize() using values of concentrations.
If 1 then reversal potential computed every call to fadvance() using the values of the concentrations.
cinit: 0 or 1.
If 1 then a call to finitialize() sets the concentrations to the values of the global initial concentrations. eg. nai set to nai0_na_ion and nao set to nao0_na_ion.
But when i call it in the Mainen model at the soma i get 136 - so i assume that eadvance is 2 - 136/64. But eadvance gets only 0 or 1, what does 2 means.
Thanks

Re: eca calculation

Posted: Thu Jan 31, 2019 5:29 pm
The documentation leads one to believe that

Code: Select all

``````the numeric result returned by ion_style("name_ion")
can be interpreted as the 7 bit binary value
b6 b5 b4 b3 b2 b1 b0
where
b1 b0 is c_style
b2    is cinit
b4 b3 is e_style
b5    is einit
However, as you have noted,
soma print ion_style("ca_ion")
returns the decimal value 136, and the corresponding binary number is the 8 bit value
1 0 0 0 1 0 0 0

Analyzing the model with the ModelView tool confirms that the soma has the cad mechanism, and examining cad.mod, which WRITEs cai, shows that cai is a STATE variable whose value is calculated at every advance, so c_style should be 3 (b1 b0 should be 1 0).
The PARAMETER cainf in cad.mod is used to specify the initial value of cai, but the value of ca0 comes from the global initial concentration cao0_ca_ion. Does that mean that cinit (b2) should be 1 instead of 0?
By default, NEURON should calculate eca at every advance (b6 should be 1) and also at initialization (b5 should also be 1), and eca would be treated as an ASSIGNED variable (b4 b3 (e_style) would be 10 i.e. decimal 2).

So I come up with the binary number
1 1 1 0 ? 1 0
(where the ? is the value of cinit (b2)), which corresponds to decimal 7*16 + 2 + maybe 4 = 114 or 118, depending on whether b2 is 0 or 1.

And now I myself have more questions than answers.

Re: eca calculation

Posted: Thu Jan 31, 2019 5:54 pm
:-) thanks Ted, ill continue investigating!

Re: eca calculation

Posted: Fri Feb 01, 2019 8:53 am
from nrn/src/nrnoc/eion.c

Code: Select all

``````/*the bitmap is
03      concentration unused, nrnocCONST, DEP, STATE
04      initialize concentrations
030     reversal potential unused, nrnocCONST, DEP, STATE
040     initialize reversal potential
0200    ci being written by a model
0400    co being written by a model
*/
``````
So it seems the 0200 and 0400 octal bits in regard to ci and co being written by a model are not described in the
documentation ion_style return value. (note these bits cannot be set via ion_style as they refer to a fact that is derived from the manifest
of membrane mechanisms that happen to have been inserted in the relevant section).

Re: eca calculation

Posted: Fri Feb 01, 2019 12:41 pm
Thanks Micheal,
Now the results i got from ion_style does make sense.
Best
Roy

Re: eca calculation

Posted: Fri Feb 01, 2019 5:06 pm
Correction to my post from 1/31--

cai is a state, and its value is initialized in cad.mod. so b2 b1 b0 should be 1 1 1
and the 7 bit number is
1 1 1 0 1 1 1

So why does ion_style"ca_ion") return 1 0 0 0 1 0 0 0 ? According to that value,
eca is NOT recalculated at every advance,
eca is NOT calculated on initialization from cai and cao
eca is UNUSED
on initialization, cai and ca0 are set to the global initial concentrations cai0_ca_ion and cao0_ca_ion
and cai and cao are UNUSED.

Which makes no sense, since
soma psection()
reveals that the soma has the cad mechanism, which READs ica and cai and WRITEs cai,
and also has the "ca" mechanism, which READs eca.

Regardless of what does or doesn't happen to the 0200 and 0400 octal bits, why does
soma print ion_style("ca_ion")
return 136?

Re: eca calculation

Posted: Fri Feb 01, 2019 6:48 pm
Using
neurondemo -python
#select release model

Code: Select all

``````from neuron import h
bin(int(h.ion_style("ca_ion", sec=h.terminal)))
``````
yields
'0b11110111'
If you send me the code fragment that returns

Code: Select all

``````>>> bin(136)
'0b10001000'
``````
I can look into it in more detail.

Re: eca calculation

Posted: Sun Feb 03, 2019 1:28 pm
For the benefit of others who may read this--
hines points out that the model setup code in demofit1.hoc executes

Code: Select all

``````  forall if(ismembrane("ca_ion")) {
. . .
ion_style("ca_ion",0,1,0,0,0)
. . .
}``````
after a calcium channel mechanism has been inserted into the soma. This overrides the "automatic ion_style" settings.