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: