Page 1 of 1

Higher order derivatives in NMODL

Posted: Wed Nov 21, 2007 6:59 am
by theiera
We're currently trying to implement a second order equation in a mod file.
According to the example given inside the deriv.c file (src/nmodl/deriv.c) it should be easy to do so.
However, the given example does not compile and it contains old NMODL commands. The article, which so far has been my reference for tricky implementations in NEURON, nmodl400.pdf states that higher order ODE can be solved by NEURON but does not show how to write them in the mod file.
Did anybody face this problem before?

Best regards
Sergio

Posted: Wed Nov 21, 2007 11:23 am
by ted
Did anybody face this problem before?
Which one--sketchy documentation, obscure syntax, high order ODEs? All of them, I'd bet.
According to the example given inside the deriv.c file (src/nmodl/deriv.c) it should be easy to do so.
It's not possible to just rewrite it as a family of 1st order ODEs?

Posted: Wed Nov 21, 2007 11:37 am
by theiera
I already wrote the mod file to solve a family of 1st order ODE.
Since in the nmodl400.pdf file (pg18) is written that it's possible to write ODE with higher order derivatives I tried to do so, without success.
Searching for info i got to the file deriv.c where a long comment shows an example for MODL where a 3rd order ODE is implemented.
However i could not get nrnivmodl to compile it.
I'll keep on using the first version of my mod file.

Thanks
Sergio

Posted: Wed Nov 21, 2007 2:59 pm
by hines
It was broken by the cvode extensions
back in the 90's. Hence the

Code: Select all

nocmodl: ../../../nrn/src/nmodl/deriv.c:1151: cvode_diffeq: Assertion `s' failed.
My feeling is that the limitation is not
significant but the documentation should
be updated to reflect that only first order
equations are supported.