-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathks.mod
76 lines (63 loc) · 1002 Bytes
/
ks.mod
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
TITLE K slow channel from Wang (2002)
: M.Migliore Dec. 2003
UNITS {
(mA) = (milliamp)
(mV) = (millivolt)
}
PARAMETER {
v (mV)
celsius (degC)
gksbar=.005 (mho/cm2)
q10=2
ek
a0q=100
tvh=50
vhalfp=-35
vhalfq=-50
kp=2
kq=6.6
tk=6.8
to=10
tp=6
}
NEURON {
SUFFIX ks
USEION k READ ek WRITE ik
RANGE gksbar,gks
GLOBAL pinf,qinf,taup,tauq
}
STATE {
p
q
}
ASSIGNED {
ik (mA/cm2)
pinf
qinf
taup
tauq
gks
}
INITIAL {
rates(v)
p=pinf
q=qinf
}
BREAKPOINT {
SOLVE states METHOD cnexp
gks = gksbar*p*q
ik = gks*(v-ek)
}
DERIVATIVE states { : exact when v held constant; integrates over dt step
rates(v)
p' = (pinf - p)/taup
q' = (qinf - q)/tauq
}
PROCEDURE rates(v (mV)) { :callable from hoc
LOCAL qt
qt=q10^((celsius-25)/10)
pinf = (1/(1+ exp(-(v-vhalfp)/kp)))
qinf = (1/(1+ exp((v-vhalfq)/kq)))
taup = tp/qt
tauq = to + a0q/(1+exp(-(v+tvh)/tk))/qt
}