Hello,
I'm using NEURON in my python codes, and I'm trying to get the variables in the 'hh' mechanism. I saw the following in the documentation:
'rates_hh(v) computes the global variables [mhn]inf_hh and [mhn]tau_hh from the rate functions. usetable_hh defaults to 1.'
I tried several times but couldn't get them. Could you clarify how to get the inf_hh and tau_hh in detail? A simple example code would be perfect.
Thanks,
Yi
Accessing inf_hh and tau_hh in the hh mechanism
Moderator: hines
-
- Posts: 267
- Joined: Fri Nov 28, 2008 3:38 pm
- Location: Yale School of Public Health
Re: Accessing inf_hh and tau_hh in the hh mechanism
Globals are accessed globally; i.e. through the h object:
Code: Select all
from neuron import h
soma = h.Section(name='soma')
soma.insert('hh')
print(h.htau_hh)
print(h.hinf_hh)
Re: Accessing inf_hh and tau_hh in the hh mechanism
Maybe my understanding is wrong, but aren't h.htau_hh and h.hinf_hh two arrays of numbers related to the membrane potential?
i.e. in the following link:
https://icwww.epfl.ch/~gerstner/SPNM/node14.html
in Equation 2.7, h.htau_hh should be the tau_x and h.hinf_hh should be the x_0 here when x = h. Therefore, both of them should be changing with the membrane potential. Am I wrong?
Thanks,
Yi
i.e. in the following link:
https://icwww.epfl.ch/~gerstner/SPNM/node14.html
in Equation 2.7, h.htau_hh should be the tau_x and h.hinf_hh should be the x_0 here when x = h. Therefore, both of them should be changing with the membrane potential. Am I wrong?
Thanks,
Yi
-
- Posts: 267
- Joined: Fri Nov 28, 2008 3:38 pm
- Location: Yale School of Public Health
Re: Accessing inf_hh and tau_hh in the hh mechanism
Conceptually, you are correct.
For memory reasons, however, NEURON's hh.mod doesn't actually store those values since they are only useful for computing one location at one time point. Instead, a GLOBAL value is used, meaning that there is only one memory location used for every spatial point (different points just overwrite the old value when is their turn to be calculated).
The CoreNEURON version, available at
https://github.com/BlueBrain/CoreNeuron ... ile/hh.mod
replaces the GLOBAL variables with RANGE variables and this allows accessing the values at different points. To use that one instead, simply place it in your model directory and recompile with nrnivmodl.
(Actually, I'm not sure: you may have to change the SUFFIX to e.g. hh2... I'm not sure what happens if a local mechanism duplicates the name of a built in one )
For memory reasons, however, NEURON's hh.mod doesn't actually store those values since they are only useful for computing one location at one time point. Instead, a GLOBAL value is used, meaning that there is only one memory location used for every spatial point (different points just overwrite the old value when is their turn to be calculated).
The CoreNEURON version, available at
https://github.com/BlueBrain/CoreNeuron ... ile/hh.mod
replaces the GLOBAL variables with RANGE variables and this allows accessing the values at different points. To use that one instead, simply place it in your model directory and recompile with nrnivmodl.
(Actually, I'm not sure: you may have to change the SUFFIX to e.g. hh2... I'm not sure what happens if a local mechanism duplicates the name of a built in one )
Re: Accessing inf_hh and tau_hh in the hh mechanism
I see. I'll try the CoreNEURON version. I think I can also directly calculate these values by myself because all I need is the membrane potential at each time at each location.
Thanks for answering my questions!
Best,
Yi
Thanks for answering my questions!
Best,
Yi
-
- Site Admin
- Posts: 6299
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Accessing inf_hh and tau_hh in the hh mechanism
Neither is an array. Both are scalars whose values depend on membrane potential.
True. nrnivmodl/mknrndll will refuse to compile a mechanism that has the same name as one that has already been compiled or is already built into NEURON.
Why bother. You're going to have to edit the file anyway. Might as well just copy th hh.mod already on your own machine to a file called hh2.mod that is located in one of your own directories (not in NEURON's installation tree), then edit hh2.mod to changeyiliu021 wrote:I'll try the CoreNEURON version.
Code: Select all
SUFFIX hh
Code: Select all
: SUFFIX hh
SUFFIX hh2
Code: Select all
GLOBAL minf, hinf, ninf, mtau, htau, ntau
Code: Select all
: GLOBAL minf, hinf, ninf, mtau, htau, ntau
RANGE minf, hinf, ninf, mtau, htau, ntau
Re: Accessing inf_hh and tau_hh in the hh mechanism
That is even better than using CoreNEURON. Thanks Ted!
Best,
Yi
Best,
Yi