CVode, more questions (and a bit of GUI)

Anything that doesn't fit elsewhere.
Post Reply
btorb
Posts: 30
Joined: Fri Oct 21, 2005 8:14 am

CVode, more questions (and a bit of GUI)

Post by btorb »

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
btorb
Posts: 30
Joined: Fri Oct 21, 2005 8:14 am

Re: CVode, more questions (and a bit of GUI)

Post by btorb »

After anohter two hours of thrying, the error becomes more clear and the question can be reformulated as follows:

How can i manually (i.e., typing code) set an adaptive time step, with local_step and Mx=b treesolver.

the following code has proven NOT to work:

objref cvode
cvode = new CVode()
cvode.active(1)
cvode.atol(0.001)
cvode.minstep(0.001)
cvode.use_local_dt(1)
cvode.use_mxb(1)
cvode.condition_order(1)
cvode.re_init()

Despite the fact that when checking the model with cvode.current_method() is returns 1301, which indicates the correct method. Well, also upon checking with the GUI the method IS correct. However, the simulation results go insane (the voltage trace resembles a Mondriaan!)

Please help.

Ben
ted
Site Admin
Posts: 6384
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: CVode, more questions (and a bit of GUI)

Post by ted »

In order to provide informed comment, it is necessary to be able to reproduce the observations you describe. In other words, I will need to see and execute your code. Lacking that, I can only suggest a strategy you might apply to debug the problem yourself. Let me know how you wish to proceed.
Post Reply