-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add NMODL Language This is the NEURON extension to MODL, a model description language used within the neuroscientific community. See also: https://www.neuron.yale.edu/neuron/static/py_doc/modelspec/programmatic/mechanisms/nmodl2.html * Add some heuristics * Try to add some tests
- Loading branch information
Showing
5 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
: Each NetCon maintains a count of external events. | ||
: And time of last external event | ||
: On each internal event all connecting NetCon get the internal event count. | ||
: And time of last external event | ||
|
||
NEURON { | ||
POINT_PROCESS ForNetConTest | ||
RANGE tbegin | ||
} | ||
|
||
UNITS { | ||
} | ||
|
||
PARAMETER { | ||
tbegin = 0 (ms) | ||
} | ||
|
||
INITIAL { | ||
net_send(tbegin, 1) | ||
} | ||
|
||
NET_RECEIVE(w, npre, tpre (ms), npost, tpost (ms)) { | ||
INITIAL { | ||
npre=0 tpre=-1 npost=0 tpost=-1 | ||
} | ||
|
||
if (flag == 0) { : external (pre) event | ||
npre = npre + 1 | ||
tpre = t | ||
} | ||
|
||
if (flag == 1) { : internal (post) event | ||
FOR_NETCONS(w, fnpre, ftpre (ms), fnpost, ftpost (ms)) { | ||
fnpost = fnpost + 1 | ||
ftpost = t | ||
} | ||
net_send(3, 1) : in 3 ms another 1 event | ||
net_event(t) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
: Three state kinetic scheme for HH-like potassium channel | ||
: Steady-state v-dependent state transitions have been fit | ||
: Needs v-dependent time constants from tables created under hoc | ||
NEURON { | ||
SUFFIX k3st | ||
USEION k READ ek WRITE ik | ||
RANGE g, gbar | ||
RANGE tau1_rec, tau2_rec | ||
} | ||
UNITS { (mV) = (millivolt) } | ||
PARAMETER { | ||
gbar = 33 (millimho/cm2) | ||
d1 = -38 (mV) | ||
k1 = 0.151 (/mV) | ||
d2 = -25 (mV) | ||
k2 = 0.044 (/mV) | ||
} | ||
|
||
ASSIGNED { | ||
v (mV) | ||
ek (mV) | ||
g (millimho/cm2) | ||
ik (milliamp/cm2) | ||
kf1 (/ms) | ||
kb1 (/ms) | ||
kf2 (/ms) | ||
kb2 (/ms) | ||
tau1_rec | ||
tau2_rec | ||
} | ||
|
||
STATE { c1 c2 o } | ||
|
||
BREAKPOINT { | ||
SOLVE kin METHOD sparse | ||
g = gbar*o | ||
ik = g*(v - ek)*(1e-3) | ||
} | ||
|
||
INITIAL { SOLVE kin STEADYSTATE sparse } | ||
|
||
KINETIC kin { | ||
rates(v) | ||
~ c1 <-> c2 (kf1, kb1) | ||
~ c2 <-> o (kf2, kb2) | ||
CONSERVE c1 + c2 + o = 1 | ||
} | ||
|
||
FUNCTION_TABLE tau1(v(mV)) (ms) | ||
FUNCTION_TABLE tau2(v(mV)) (ms) | ||
|
||
PROCEDURE rates(v(millivolt)) { | ||
LOCAL K1, K2 | ||
K1 = exp(k2*(d2 - v) - k1*(d1 - v)) | ||
kf1 = K1/(tau1(v)*(1+K1)) | ||
kb1 = 1/(tau1(v)*(1+K1)) | ||
K2 = exp(-k2*(d2 - v)) | ||
kf2 = K2/(tau2(v)*(1+K2)) | ||
kb2 = 1/(tau2(v)*(1+K2)) | ||
tau1_rec = tau1(v) | ||
tau2_rec = tau2(v) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters