Skip to content

[Question] cvode active and setting h.tstop #1773

Answered by ramcdougal
xanderladd asked this question in Q&A
Discussion options

You must be logged in to vote

This is expected behavior.

If you're using CVode, by definition the time steps are not evenly spaced and you could have more or less of them than in your fixed-step case. Always record time as well as voltage; e.g.

t = h.Vector().record(h._ref_t)
v = h.Vector().record(soma(0.5)._ref_v)

If you really want values interpolated to a regular interval (but you may not need this), you can always record as above and then use e.g. numpy.interp to do the interpolation after-the-fact.

One other suggestion: True and False are probably more intuitive than 1 and 0 here, so consider writing:

h.cvode.active(True)

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by nrnhines
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants
Converted from issue

This discussion was converted from issue #1763 on April 08, 2022 22:09.