Page 1 of 1

coding an eqn in NMODL

Posted: Fri Jan 18, 2008 12:16 pm
by nr
Hi all,

When I try to include this eqn (taken directly from a paper (Golomb 2007) in my procedure , Ia m unable to covert using mknrndll and am getting an error message that says illegal integer expression and use.

taun = (0.087+11.4/( 1+exp[(v+14.6)/8.6]))

can this type of eqn not be encoded in the PROCEDURE section? alternatively, is there any way to use the channel builder to code this type of eqn?

Thanks

(my code is

TITLE POTCHANNEL

UNITS {
(mV) = (millivolt)
(mA) = (milliamp)
}

NEURON {
SUFFIX KT
USEION k READ ek WRITE ik
RANGE gk
}

PARAMETER {
gk = 225 (mho/cm2)
theetahn = -12.4
sigman = 6.8
}

ASSIGNED {
v (mV)
ek (mV)
ik (mA/cm2)
taun
nsteady
}

STATE {
n
}

BREAKPOINT {
SOLVE states METHOD cnexp
ik = gk * n^2 * (v-ek)
}

INITIAL {
n= 1/exp(-(v-theetahn)/sigman)
nsteady=n
}

DERIVATIVE states {
settables(v)
n'=(nsteady-n)/taun
}

UNITSOFF

PROCEDURE settables(v (mV)) {

taun = (0.087+11.4/( 1+exp[(v+14.6)/8.6])) * (0.087+11.4/( 1+exp[-(v-1.3)/18.7]))

}

UNITSON

Posted: Fri Jan 18, 2008 2:28 pm
by ted
To answer your question:

Code: Select all

taun = (0.087+11.4/( 1+exp[(v+14.6)/8.6])) * (0.087+11.4/( 1+exp[-(v-1.3)/18.7]))
In most high level programming languages, square brackets [ ] are reserved for array indices.
NMODL is no exception. Nested expressions may use only parentheses ( ).

By the way, please see
Preserving code and text formatting
https://www.neuron.yale.edu/phpBB2/viewtopic.php?t=493

Posted: Sat Jan 19, 2008 10:07 am
by nr
Thank you very much Ted. I made the change and it worked.