coding an eqn in NMODL

The basics of how to develop, test, and use models.
Post Reply
nr

coding an eqn in NMODL

Post 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
ted
Site Admin
Posts: 6305
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post 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
nr

Post by nr »

Thank you very much Ted. I made the change and it worked.
Post Reply