Problem with DASPK: Initiation Error

Anything that doesn't fit elsewhere.
Post Reply
amin_mahnam

Problem with DASPK: Initiation Error

Post by amin_mahnam »

Hi,
I am using Neuron for simulation of extracellular stimulation of neural fibers.
I implemented extracellular mechanism to apply the effect of stimulation.
I am trying to use CVode (actually DASPK) for integration. I have used it for simpler models before, successfully. But with the new more complicated model, I usually encounter this error.

IDA initialization failure, weighted norm of residual=8.84689
err=-6
nrniv: variable step integrator error

The error may not encountered for the first simulation, but for the next simulations when I apply higher values of stimulus amplitudes.

I reduced the parameter 'cvode.dae_init_dteps' from 1e-9 to 1e-12.
The situation improved, but I still encounter this error for some values of stimulus amplitudes.

I appreciate if any one can tell me,
1) when does such error produce?
2) how may I be able to avoid it?
3) what is the parameter dae_init_dteps? I have read its description in the Neuron help html, but it is so brief to help me.

Thank you.
Amin
hines
Site Admin
Posts: 1710
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

You can force the integrator to continue by using the undocumented "failure_style"
second argument to dae_init_dteps. When the second arg is missing or 0 you get
the error as you observed. If it is 1 the
error turns into a warning and integration continues. If it is 2, the error turns into a warning and for the next 1e-6 ms the equation solved is
f(y', y, t) - f(y', y, t0)*exp(-1e-7*(t - t0)) = 0
Needless to say, this last is a bit experimental.

What is happening is that IDA (the presently used Differental-Algebraic Solver) is not supposed to integrate the f(y', y, t) = 0 problem unless you start it out so that f(y'(0), y(0), 0) = 0 to within the cvode.atol you requested. i.e the
algebraic part is supposed to start out
consistent. This is hard to make happen because the equations are so mixed together that NEURON does not know which are differential and which are algebraic. You can think of it as some
combinations of states have infinitesimal
time constants, and other combinations have finite time constants. The basic heuristic to reconcile all this is a very small fully implicit time step which allows the 0 time constant changes to settle into their quasi equilibrium without changing the ones that are changing less than infinitely fast. Sadly, this does not always work within a single time
step. I've tried a half dozen variants
each of which work better than the others in specific cases. I promised myself I would return to the issue when I had time. If someone wants to try their own hand at getting a valid initialization take a look at
int Daspk::init() {
in nrn/src/nrncvode/nrndaspk.cpp

If you send me your hoc,ses,mod files in a zip file setup to show the error I'll take a look at precisely why the initialization is failing. Send to michael.hines@yale.edu

If you do decide to turn the error into a warning then take a careful look at what is going on in the neighborhood of the discontinuities to make sure that the state changes are physically meaningful.
Post Reply