Bug: CVode - stdrun.hoc - tstop

Post Reply
Posts: 19
Joined: Sun Nov 30, 2014 6:03 am

Bug: CVode - stdrun.hoc - tstop

Post 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]
Site Admin
Posts: 5885
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine

Re: Bug: CVode - stdrun.hoc - tstop

Post by ted »

Try cvode_active(1) instead of cvode.active(1). See
Turning adaptive integration ("CVODE") on and off
in the Hot tips area of the NEURON forum.
Post Reply