Page 1 of 1

combining schemes

Posted: Fri Apr 14, 2006 6:02 pm
by moritz
I want to implement a channel in NMODL that uses both a kinetic scheme as well as an HH type inactivation parameter. Can I have two SOLVE statements within the same mod file-- one with a DERIVATIVE function and one with a KINETIC function? If so, I take it that I just list them one after the other in the BREAKPOINT section?

Thanks in advance for your help.

Posted: Fri Apr 14, 2006 10:07 pm
by ted
I haven't tried this myself; my guess is that the compiler would complain. My own
inclination would be to use the ChannelBuilder, which is perfectly capable of doing
exactly this, and less of a pain than dealing with NMODL. But you might as well try
NMODL first--the worst that might happen is that it would compile and seem to work,
but produce incorrect results. Of course, you always test each mechanism you use,
to make sure it is working properly, right?

Posted: Tue Apr 18, 2006 6:31 pm
by moritz
Thanks for getting back to me. You were right. The NMODL compiler does not like having 2 SOLVE statements and states that the results will be inaccurate. I don't think I can use the ChannelBuilder because (1) I need to include a Ca2+ accumulation mechanism and (2) my ionic current equation is non-standard and I don't see anywhere to modfy that in ChannelBuilder.

Therefore, I wrote out the 12 differential equations for my kinetic states, as well as the HH inactivation gate. Unfortunately, I am getting the following error when I compile, and I am not sure what the culprit is. Could you point in the direction of the likely cause? Would the reference to "diffeq.y" mean that there is an error in the DERIVATIVE block? What type of error could cause this message?

-->
gcc -mno-cygwin -I/cygdrive/c/nrn57/src/scopmath -I/cygdrive/c/nrn57/src/nrnoc -I/cygdrive/c/nrn57/src/oc -I/cygdrive/c/nrn57/lib -I/cygdrive/c/nrn57/mingw -c mod_func.c
nocmodl caLjaf
Translating caLjaf.mod into caLjaf.c
assertion "0" failed: file "diffeq.y", line 194
make: *** [caLjaf.o] Aborted (core dumped)

There was an error in the process of creating nrnmech.dll
Press Return key to exit

Previous occurence of error message

Posted: Wed Apr 19, 2006 4:21 am
by Raj
Moritz,

I remember seeing this error message before on the forum. You might therefore want to have a look at the following topic and then update your neuron version.

https://www.neuron.yale.edu/phpBB2/view ... ght=diffeq

Raj

Posted: Wed Apr 19, 2006 10:04 am
by ted
moritz wrote:I don't think I can use the ChannelBuilder because (1) I need to include a Ca2+ accumulation mechanism
Apply the principle of modular software design. Specify a Ca accumulation mechanism
with NMODL, and specify the channel properties with a ChannelBuilder.
(2) my ionic current equation is non-standard and I don't see anywhere to modfy that in ChannelBuilder.
What is the equation? Sometimes a little algebraic rearrangement will put things in a
more tractable form.

Posted: Thu Apr 20, 2006 5:36 pm
by moritz
Raj and Ted--
Thank you both for your input.

Raj, the link to the postings about that error were very helpful. My DEs depended on multiple other states and were too complex for the intepreter. I broke them down a bit using local variables and was able to compile the mod file.

Since I got the channel working with NMODL, I think I will stick with that.

Again, thanks for your replies!
Mickey

Posted: Thu Apr 20, 2006 6:09 pm
by Raj
I hope you read the topic to the end, because the first solution was discouraged by Michael Hines, because it leads to stability problems, see quote below. Instead he proposed and implemented a fix to Neuron.
Michael Hines wrote:Anyway, DO NOT replace multiargument functions involving the state
mentioned on the left hand side with local variables. That will ruin the numerical stability properties of the translated equations. i.e
Code:
D' = (alphad * sigmoid(D, thetad,sigmad) - D )/taud

cannot be written as
Code:

xxx = alphad*sigmoid(D, thetad, sigmad)
D' = (xxx - D)/taud

because xxx involves D and the diagonal jacobian element needs that
contribution.

Posted: Thu Apr 20, 2006 6:27 pm
by moritz
Thanks for checking! Yes, I saw that comment. I only used local variables to simplify expressions that did not include state variables.