State and Parameter Discontinuities in HOC

Physical System

Transient voltage clamp to assess action potential stability.

Model

Force a discontinuous change in potential during an Action Potential

Simulation

To work properly with variable time step methods, models that change states and/or parameters discontinuously during a simulation must notify NEURON when such events take place. This exercise illustrates the kinds of problems that occur when a model is changed without reinitializing the variable step integrator.

1) Start with a current pulse stimulated HH patch. E.g. HH Patch

2) Discontinuously change the voltage by +20 mV using

objref fih
fih = new FInitializeHandler("cvode.event(2, \"change()\")")
proc change() {
    print "change at ", t
    v += 20
}
Notice the difference between fixed and variable step methods.

3) Replace the "change" procedure with the following and try again.

proc change() {
    print "change at ", t
    v += 20
    cvode.re_init()
}
4) What happens if you discontinuously change a parameter such as gnabar_hh during the interval 2-3 ms without notifying the variable time step method.
objref fih
fih = new FInitializeHandler("cvode.event(2, \"change(1)\")")
proc change() {
    print "change at ", t
    if ($1 == 1) {
        gnabar_hh *= 2
        cvode.event(3, "change(2)")
    } else {
        gnabar_hh /= 2
    }
    // cvode.re_init // should be here for varstep method
}
It will be helpful to use the Crank-Nicholson fixed step method and compare the variable step method with and without the cvode.re_init() . Zoom in around the discontinuity at 2ms.


Extra:

Parameter Discontinuities in NMODL

This older exercise makes use of the deprecated at_time way of notifying cvode of the time for a discontinuity. Nowadays, a NET_RECEIVE block is recommended for dealing with discontinuities but the old exercise still is a good cautionary example of what happens when there is a discontinuity without notifying the variable step method.
NEURON hands-on course
Copyright © 1998-2009 by N.T. Carnevale and M.L. Hines, all rights reserved.