CVode, more questions (and a bit of GUI)
Posted: Wed Sep 24, 2008 5:52 am
I'm trying to find out why my model produces a different output when using cvode (i) started from the GUI with tools -> variablestep control, and (ii) started directly from typed in code.
A bit more info:
(1) if i start a model and, throught the GUI, set the timestep to adaptive. it all works fine a very quickly. the atol is set to 0.001 and the dts can be verified throught the runcontrol to be larger than this atol. OK. good. (some more info is that the model is "1301" which means it is using the local time step)
(2) i don't like working with a lot of windows and like to type in the code. so, instead of using the GUI i added the following lines to my code
objref cvode
cvode = CVode()
cvode.atol(0.001)
cvode.active(1)
That works to the extend that the time step is indeed adaptive and changes (again verified through the runcontrol panel)
However, the execution time is much longer than the time required when using the GUI because the dt takes very small values. So, i added some more lines to try to achieve the same results as with the cvode evoked from the gui:
cvode.use_daspk(0) // because everyhting can be set to 1 at the same time according to the manual
cvode.use_local_dt(1)
when asking for the cvode.current_method() it nicely replies "1301".However, when i run this code the simulation goes insane (voltages of 3500 mV...)
I tried to find out what else i had to add to my model in order to get the same output as produced when evoking cvode from the gui. unfortunately, a full afternoon in "varmeth1.hoc" did not resolve anything.
if anybody knows what i do wrong and how to solve it i would be very happy (and less annoyed).
Ben
A bit more info:
(1) if i start a model and, throught the GUI, set the timestep to adaptive. it all works fine a very quickly. the atol is set to 0.001 and the dts can be verified throught the runcontrol to be larger than this atol. OK. good. (some more info is that the model is "1301" which means it is using the local time step)
(2) i don't like working with a lot of windows and like to type in the code. so, instead of using the GUI i added the following lines to my code
objref cvode
cvode = CVode()
cvode.atol(0.001)
cvode.active(1)
That works to the extend that the time step is indeed adaptive and changes (again verified through the runcontrol panel)
However, the execution time is much longer than the time required when using the GUI because the dt takes very small values. So, i added some more lines to try to achieve the same results as with the cvode evoked from the gui:
cvode.use_daspk(0) // because everyhting can be set to 1 at the same time according to the manual
cvode.use_local_dt(1)
when asking for the cvode.current_method() it nicely replies "1301".However, when i run this code the simulation goes insane (voltages of 3500 mV...)
I tried to find out what else i had to add to my model in order to get the same output as produced when evoking cvode from the gui. unfortunately, a full afternoon in "varmeth1.hoc" did not resolve anything.
if anybody knows what i do wrong and how to solve it i would be very happy (and less annoyed).
Ben