eca calculation
eca calculation
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?
Thanks in advance
Roy
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?
Thanks in advance
Roy
-
- Site Admin
- Posts: 6299
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: eca calculation
Good question. Read the Programmer's Reference documentation of ion_style.
Re: eca calculation
Thank, Ted!
This is very helpful.
This is very helpful.
Re: eca calculation
I am a bit confused trying to figure this out. From the program reference i get this:
In the BBP model i get 247 thus eadvance is 3 so i am probably misunderstood the documentation. Please help.
Thanks
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.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.
eadvance: 0 or 1.
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.
In the BBP model i get 247 thus eadvance is 3 so i am probably misunderstood the documentation. Please help.
Thanks
-
- Site Admin
- Posts: 6299
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: eca calculation
The documentation leads one to believe thatHowever, 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.
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
b6 is eadvance
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
:-) thanks Ted, ill continue investigating!
Re: eca calculation
from nrn/src/nrnoc/eion.c
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).
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
0100 calc reversal during fadvance
0200 ci being written by a model
0400 co being written by a model
*/
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
Thanks Micheal,
Now the results i got from ion_style does make sense.
Best
Roy
Now the results i got from ion_style does make sense.
Best
Roy
-
- Site Admin
- Posts: 6299
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: eca calculation
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?
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
Using
neurondemo -python
#select release model
yields
'0b11110111'
If you send me the code fragment that returns
I can look into it in more detail.
neurondemo -python
#select release model
Code: Select all
from neuron import h
bin(int(h.ion_style("ca_ion", sec=h.terminal)))
'0b11110111'
If you send me the code fragment that returns
Code: Select all
>>> bin(136)
'0b10001000'
-
- Site Admin
- Posts: 6299
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: eca calculation
For the benefit of others who may read this--
hines points out that the model setup code in demofit1.hoc executesafter a calcium channel mechanism has been inserted into the soma. This overrides the "automatic ion_style" settings.
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)
. . .
}