Page 1 of 1

Bug: CVode - stdrun.hoc - tstop

Posted: Fri Jun 02, 2017 6:05 am
by cafischer
When loading stdrun.hoc before declaring and setting CVode to 1 the simulation will not run until tstop but stop at some earlier point. However when reversing the order everything is fine and the simulation stops at tstop. In the documentation it says that a cvode will be created when loading stdrun.hoc but also if I set h.cvode to 1 the simulation does not run until tstop.

Here is a small example:

Code: Select all

from neuron import h

# adaptive integration
h.load_file("stdrun.hoc") # reverse order between this and the following two lines
cvode = h.CVode()

# create cell
soma = h.Section(name='soma')

# insert IClamp
iclamp = h.IClamp(soma(.5))
iclamp.amp = 1
iclamp.delay = 20.0
iclamp.dur = 40.0

# record the time
t_rec = h.Vector()

# run simulation
dt = 0.01
tstop = 100
h.v_init = -60
h.tstop = tstop
h.steps_per_ms = 1.0 / dt
h.dt = dt

# output
print tstop
print t_rec[-1]
assert tstop == t_rec[-1]

Re: Bug: CVode - stdrun.hoc - tstop

Posted: Fri Jun 02, 2017 10:25 am
by ted
Try cvode_active(1) instead of See
Turning adaptive integration ("CVODE") on and off
in the Hot tips area of the NEURON forum.