MRG NEURON mechanics

The basics of how to develop, test, and use models.
Post Reply
pxl282
Posts: 4
Joined: Sat May 14, 2016 2:29 pm

MRG NEURON mechanics

Post by pxl282 » Tue May 17, 2016 6:34 pm

Hello,

I am working on a purely Matlab implementation of the MRG 2002 double-cable model, and have run into issues I haven't been able to resolve following the NEURON book, tutorials, papers, and forum posts I have seen. Currently, my results are similar to those given by NEURON - steady state membrane voltage is the same, and the same general pattern appears when responding to an initial voltage - which leads me to believe that I am getting close. However, I am running into an issue where the number/timing of spikes my model predicts is slightly different from that given by NEURON.

I would very much appreciate it if you could please clarify a few points on how NEURON implements:

1. Implicit Euler advancement for ion channels.
I have been following Equation (9) of http://www.neuron.yale.edu/ftp/neuron/p ... ffic84.pdf and taking two half-delta-T steps, first advancing the channel state to that of (t+deltaT/2), then resolving all membrane voltages at (t+deltaT/2) following a variation of Equation (4), and repeating the process again to reach (t+deltaT). This does not feel correct, as the process is split into two half-steps. Would simply altering equations (4) and (9) to use deltaT rather than deltaT/2 be sufficient for implementing a full-step implicit Euler?
The documentation I have seen says that the ion channels and voltages are updated in a staggered manner for the Crank-Nicholson method, but that in more recent implementations they are computed simultaneously for Implicit Euler. I have been unable to find the equations for simultaneously solving the voltage equations and the ion channel progression. If this is the case, could you please direct me to an explanation of how this is done?

2. Voltage initialization.
Using finitialize, and referring specifically to http://www.neuron.yale.edu/neuron/stati ... racellular
I know that upon setting an initial membrane voltage, channel gate values are adjusted to their steady state for the given voltage. Would the same be true of VExt values in extracellular compartments, or would their voltage be set directly to a specific value?

3. Action Potential count.
My understanding of Neuron's record function is that it is generally set to record events specified by the user - in the case of action potentials, this seems to default to membrane voltage breaking 0 mv. Am I correct in assuming that this is the default spike counting method?
I'm trying to find a way to determine if a given time-varying current input (or a change in external voltage) would result in a propagating signal _far_ downstream in a model axon.
For example - when an initial voltage of, say, -40mV is set for a 15um fiber in the MRG model, there are a number of spikes - none of which break 0 mV - which appear before the membrane voltage drops to its resting value. None of these follow the traditional "all-or-nothing" shape, so I am unsure if they would propagate a reasonable distance or excite something more action-potential looking downstream.
Would there be an easy way of determining this without seeing a traditional action potential within the set of modeled nodes, or directly simulating a long axon?

Thank you for your help,
Platon

ted
Site Admin
Posts: 5683
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: MRG NEURON mechanics

Post by ted » Mon May 23, 2016 10:28 am

pxl282 wrote:1. Implicit Euler advancement for ion channels.
I have been following Equation (9) of http://www.neuron.yale.edu/ftp/neuron/p ... ffic84.pdf and taking two half-delta-T steps
Equation 9 pertains only to the use of tables of precomputed rate functions. Ignore it. As far as "two half-delta-T steps" is concerned, Euler methods produce first order correct solutions. Equation 8, however, pertains to a "staggered Crank-Nicholson method" that generates a second order correct solution. It's not relevant if you're trying to implement implicit Euler. If you want implicit Euler, just use the plain old implicit Euler formula.
The documentation I have seen says that the ion channels and voltages are updated in a staggered manner for the Crank-Nicholson method, but that in more recent implementations they are computed simultaneously for Implicit Euler.
I do not recall seeing such documentation. Where did you see it?
I know that upon setting an initial membrane voltage, channel gate values are adjusted to their steady state for the given voltage. Would the same be true of VExt values in extracellular compartments, or would their voltage be set directly to a specific value?
As far as I know, those start out at 0 unless they are driven by Vector play or perhaps (via pointers) by a function of time that has a nonzero value at t=0.
My understanding of Neuron's record function is that it is generally set to record events specified by the user - in the case of action potentials, this seems to default to membrane voltage breaking 0 mv. Am I correct in assuming that this is the default spike counting method?
There are two ways to keep track of the number of spikes. One is with an instance of the APcount class, and the other takes advantage of the NetCon class's record() method. Each has a user-specifiable threshold parameter, but you'll want to see the Programmer's Reference for the most recent documentation of default threshold values.
I'm trying to find a way to determine if a given time-varying current input (or a change in external voltage) would result in a propagating signal _far_ downstream in a model axon.
For example - when an initial voltage of, say, -40mV is set for a 15um fiber in the MRG model, there are a number of spikes - none of which break 0 mV - which appear before the membrane voltage drops to its resting value. None of these follow the traditional "all-or-nothing" shape, so I am unsure if they would propagate a reasonable distance or excite something more action-potential looking downstream.
Would there be an easy way of determining this without seeing a traditional action potential within the set of modeled nodes, or directly simulating a long axon?
The only way to know if a stimulus at some point A elicits a propagating spike is to observe propagation of a spike past some other point B such that B is so far from A that the stimulus current injected at A does not directly affect membrane potential at B.

pxl282
Posts: 4
Joined: Sat May 14, 2016 2:29 pm

Re: MRG NEURON mechanics

Post by pxl282 » Tue May 31, 2016 3:32 pm

Hello ted, thank you for your response!
If you want implicit Euler, just use the plain old implicit Euler formula.
Regarding the Implicit Euler equation. Would simply
m = m + mexp(v) * (minf(v)-m)
where
mexp(v) = 1 - exp (-deltaT / tau( v(t) ) ) //deltaT in ms
be the correct implicit Euler equation?

Also, in following fadvance, is the following process correct:
1. Check conductances between compartments, adjust changes.
2. Find di/dv by evaluating IHH( m,h,s, v) and IHH (m,h,s,v+0.001) [as opposed to IHH ( m,h,s,v re-evaluated assuming V(t+deltaT) = V(t+deltaT) +0.001)]
3. Resolve matrix equations by gaussian elimination. Acquire V(t+deltaT).
4. Adjust channels using this new V(t+deltaT) and the Implicit Euler equation for channels.
I do not recall seeing such documentation. Where did you see it?
Sorry, I misread the channels and voltages being updated simultaneously. This seems to only apply to voltage clamp models.

Thanks again!
Platon

ted
Site Admin
Posts: 5683
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: MRG NEURON mechanics

Post by ted » Tue May 31, 2016 11:42 pm

Tell you what--chapter 7 of The NEURON Book is the most detailed narration available, short of walking through the source code. See if chapter 7 gives you the information you're looking for.

pxl282
Posts: 4
Joined: Sat May 14, 2016 2:29 pm

Re: MRG NEURON mechanics

Post by pxl282 » Fri Jun 03, 2016 11:13 am

Hello ted,

I have been following chapter 7, and it has been incredibly helpful!
I asked about the process only to check that I wasn't missing something simple.

I've got few differences between my output and NEURON's output, but they do exist and I'm trying to iron them out. I am most unsure of the implicit Euler ion channel adjustment step after calculating all voltages following the process described in chapter 7. As is I'm using equation 7.5, from chapter 7, with (t+ deltaT | t) rather than (t +deltaT/2 | t-deltaT/2), but this doesn't seem right.

Unfortunately, I can't find a source for the implicit equation for integrating Hodgkin Huxley channels - the "plain old implicit Euler formula" - that doesn't involve finding a convergence point iteratively, and was hoping you could provide the equation used or a reference to it.



Thanks,
Platon

ted
Site Admin
Posts: 5683
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: MRG NEURON mechanics

Post by ted » Fri Jun 03, 2016 11:33 am

Have you read chapter 4?

pxl282
Posts: 4
Joined: Sat May 14, 2016 2:29 pm

Re: MRG NEURON mechanics

Post by pxl282 » Tue Mar 27, 2018 9:25 pm

Hello ted,

Chapter 4 helped, thank you!
- Platon

Post Reply