The RANGE variables are defined at the end of the BREAKPOINT block, and they depend only on PARAMETERs and STATEs. From reading "Expanding NEURON's Repertoire of Mechanisms with NMODL" (Hines and Carnevale), my code should work.
All of the RANGE variables in this mod file disappear in the same way. I also tried moving the equations defining these variables into the KINETIC block with no success. I've had this problem in both NEURON 5.9 and the latest alpha version of NEURON. This is my code:
Code: Select all
:Accum_Ca
NEURON {
SUFFIX Accum_Ca
USEION ca READ cai, ica WRITE cai
USEION cass READ cassi, icass WRITE cassi VALENCE 2
RANGE Jrel, Jup, Jleak, Jtr, Jxfer
}
UNITS {
(S) = (siemens)
(mV) = (millivolt)
(mA) = (milliamp)
(mM) = (milli/liter)
(pA) = (picoamp)
(uF) = (microfarad)
(pF) = (picofarad)
}
PARAMETER {
:Table 2 - Cell geometry params
Acap = 1.534e-4 (cm2)
Vmyo = 25.84e-6 (microliter)
VJSR = 0.12e-6 (microliter)
VNSR = 2.098e-6 (microliter)
Vss = 1.485e-9 (microliter)
F = 96.5 (kilocoulombs) :C/mmol NOT C/mM !!
iCaL_max = 7.0e-3 (mA/cm2)
:table 6- Buffering parameters
: LTRPN_tot = 0.0700 (mM)
: HTRPN_tot = 0.1400 (mM)
k_htrpn_pos = 2.37 (/mM-ms)
k_htrpn_neg = 3.2e-5 (/ms)
k_ltrpn_pos = 32.7 (/mM-ms)
k_ltrpn_neg = 0.0196 (/ms)
CMDN_tot = 0.0500 (mM)
CSQN_tot = 15.0000 (mM)
K_CMDN_m = 0.000238 (mM)
K_CSQN_m = 0.8000 (mM)
:table 4- SR parameters
new1 = 4.5 (/ms)
new2 = 1.74e-5 (/ms)
new3 = 0.00045 (mM/ms)
Km_up = 0.0005 (mM)
tau_tr = 20.0 (ms)
tau_xfer = 8.0 (ms)
ka_pos = 0.006075e12 (/mM4-ms)
ka_neg = 0.07125 (/ms)
kb_pos = 0.00405e9 (/mM3-ms)
kb_neg = 0.965 (/ms)
kc_pos = 0.009 (/ms)
kc_neg = 0.0008 (/ms)
n = 4 :these 2 (n,m) are hard coded- there's a conflict with the unit-checking for 'm' (meters)
m = 3
}
ASSIGNED {
v (mV)
ica (mA/cm2)
icass (mA/cm2)
Bi
Bss
Bjsr
Jrel (mM/ms)
Jxfer (mM/ms)
Jtr (mM/ms)
Jup (mM/ms)
Jleak (mM/ms)
}
STATE {
cai (mM) <1e-10>
cassi (mM) <1e-10>
cajsr (mM) <1e-10>
cansr (mM) <1e-10>
HTRPNCa (mM) <1e-10>
LTRPNCa (mM) <1e-10>
HTRPN (mM) <1e-10>
LTRPN (mM) <1e-10>
:Ryanodine
PO1 PC1 PO2 PC2 P_RyR
}
BREAKPOINT {
SOLVE nain METHOD sparse
:Calc'd here for validation
Jxfer = (cassi - cai)/tau_xfer
Jrel = new1*(PO1+PO2)*(cajsr-cassi)*P_RyR
Jtr = (cansr - cajsr)/tau_tr
Jleak = new2*(cansr-cai)
Jup = new3*cai^2/(Km_up^2+cai^2)
}
INITIAL {
LTRPNCa = 0.0112684 (mM)
HTRPNCa = 0.125290 (mM)
LTRPN = .0587316 :0.0700 - 0.0112684 (mM) :LTRPN_tot - LTRPNCa
HTRPN = 0.01471 :0.1400 - 0.125290 (mM)
PC1 = 0.999817
PC2 = 0.167740e-3
PO1 = 1.149102e-4
PO2 = 9.951726e-10
P_RyR = 0.0
cajsr = 1.29950 (mM)
cansr = 1.29950 (mM)
}
KINETIC nain {
:COMPARTMENT changes LHS to mass/time in explicit flux statement
: I choose not to use this method, using intensive values in the calc.
: This is clearer, I think.
:
:From Ted, "I always hate wrestling with that stuff. Your approach is fine, as
:long as you never have to change nseg or the dimensions (diameter or
:length) of your model cell."
:
: I may want to increase resolution- in this case, compartments will need to
: be changed to COMPARTMENT type.
Bi = (1+CMDN_tot*K_CMDN_m/(K_CMDN_m+cai)^2)^-1
Bss = (1+CMDN_tot*K_CMDN_m/(K_CMDN_m+cassi)^2)^-1
Bjsr = (1+CSQN_tot*K_CSQN_m/(K_CSQN_m+cajsr)^2)^-1
:Explicit Fluxes
~ cai << (Bi*(-(ica)*Acap/Vmyo/F/2 + (cassi - cai)/tau_xfer + new2*(cansr-cai) - new3*cai^2/(Km_up^2+cai^2))) :these units work
~ cassi << (Bss*(new1*(PO1+PO2)*(cajsr-cassi)*P_RyR*VJSR/Vss-(cassi - cai)/tau_xfer*Vmyo/Vss-icass*Acap/2/Vss/F))
~ cajsr << (Bjsr*((cansr - cajsr)/tau_tr-new1*(PO1+PO2)*(cajsr-cassi)*P_RyR))
~ cansr << ((new3*cai^2/(Km_up^2+cai^2)-new2*(cansr-cai))*Vmyo/VNSR-(cansr - cajsr)/tau_tr*VJSR/VNSR)
:Buffering in Vmyo- this replaces eqtns A14,A16-17 in Bond2004
~ cai + LTRPN <-> LTRPNCa (k_ltrpn_pos, k_ltrpn_neg)
~ cai + HTRPN <-> HTRPNCa (k_htrpn_pos, k_htrpn_neg)
:Ryanodine Kinetics
~ PO1 <-> PC1 (ka_neg, ka_pos*cassi^4)
~ PO1 <-> PO2 (kb_pos*cassi^3, kb_neg)
~ PO1 <-> PC2 (kc_pos, kc_neg)
CONSERVE PO1 + PO2 + PC1 + PC2 = 1
~ P_RyR << (-0.04(/ms)*P_RyR - 0.1(/ms)*icass/iCaL_max*exp(-(v-5.0)^2/648.0(mV2)))
}