I'm translating a GENESIS model into NEURON and the 10 NMODL mechanisms all work the same in my nrn model as in the genesis one, with one exception. The trouble-maker is an Sk channel, a calcium-dependent potassium channel, reading calcium concentration from a 200 nM shell below the cell membrane. The calcium concentration mechanism works fine. Can anyone see something wrong in the following code, for example with the double USEION statements in the NEURON block? Or with the TABLE lower down? Thanks a lot! /Joe
NEURON {
SUFFIX Sk
USEION ca READ cai VALENCE 2
USEION k READ ek WRITE ik
RANGE gbar, z, ik
}
UNITS {
(mA) = (milliamp)
(mV) = (millivolt)
(molar) = (1/liter)
(mM) = (millimolar)
}
PARAMETER {
gbar = 1e-5 (siemens/cm2) :default value, change in hoc
}
ASSIGNED {
v (mV)
ek (mV) : set ek to -90 (mV) from hoc
ik (mA/cm2)
cai (mM)
zinf
tauz (ms)
}
STATE {
z :calcium-dependent activation variable
}
INITIAL {
rate(cai)
z = zinf
}
BREAKPOINT {
SOLVE states METHOD cnexp
ik = gbar * z * (v - ek)
}
DERIVATIVE states {
rate(cai)
z' = (zinf - z) / tauz
}
PROCEDURE rate(cai(mM)) {
TABLE zinf, tauz FROM 0 TO 0.01 WITH 300
UNITSOFF
zinf = cai*cai*cai*cai / (cai*cai*cai*cai + 8.1e-15)
if (cai < 0.005) {
tauz = 1 - (186.67 * cai)
} else {
tauz = 0.0667
}
UNITSON
}