[Question] cvode slows down model significantly #1799
-
Hello NEURON team, I am currently working with an L5 TTPC cell model that I have translated from HOC into python. When I turn on
My question is -- why does Cvode result in such a dramatic slowdown? I have tried cvode using the same model and constant stimuli (set using IClamp amp) and it is indeed faster in that case. Ultimately, I am just looking to find the fastest model for these stimuli. I thought the issue could be that I am using a high value for the DT (.09) but even when I use the regular DT (.02) I see the exact same results.
10000 init states seem like an issue. Attached Working ExampleI attached a tarred version of the files needed for this code example. This setup might require recompile but should run without any external libraries besides NEURON, NumPy, os, and matplotlib. I also attached responses for each model, notably the cvode model has 20k timesteps instead of the expected 10k. no cvode visualizationcvode visualizationIt is attached but also here is the code for main.py
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
also I can move this issue to discussion if that is more appropriate. Thank you in advance for all your help so far!! |
Beta Was this translation helpful? Give feedback.
-
Have not run the model yet but will do so. Until then, on a brief look at main.py, my first guess is that the performance problem is because of
This forces cvode to reinitialize itself after every dt interval and start from that time as though it is a different initial value problem (with a possibly different value for cell.ic.amp). I haven't looked yet at your Ok. Looking back near the top of your post I see
So CVode reinitialized itself 10000 times and each time interpolating itself back to the exact i*dt time to take into account a new value for cell.ic.amp . I expect that the abscissa on your second plot is not your recorded time. I'll get back after I run the model and see if my speculations are confirmed. If so a simple modification to |
Beta Was this translation helpful? Give feedback.
-
With
and
I get
But when you plot |
Beta Was this translation helpful? Give feedback.
-
Confirming that specifying dt caused all of those init calls. As you specified,
which shows the expected behavior of cvode. Thank you for your help it is greatly appreciated and I will close this issue. |
Beta Was this translation helpful? Give feedback.
With