-
Notifications
You must be signed in to change notification settings - Fork 2
/
fh.mod
144 lines (131 loc) · 2.46 KB
/
fh.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
TITLE FH channel
: Frankenhaeuser - Huxley channels for Xenopus
NEURON {
SUFFIX fh
USEION na READ nai, nao WRITE ina
USEION k READ ki, ko WRITE ik
NONSPECIFIC_CURRENT il, ip
RANGE pnabar, pkbar, ppbar, gl, el, il, ip
GLOBAL inf,tau
}
UNITS {
(molar) = (/liter)
(mA) = (milliamp)
(mV) = (millivolt)
(mM) = (millimolar)
FARADAY = (faraday) (coulomb)
R = (k-mole) (joule/degC)
}
PARAMETER {
v (mV)
celsius (degC) : 20
pnabar=8e-3 (cm/s)
ppbar=.54e-3 (cm/s)
pkbar=1.2e-3 (cm/s)
nai (mM) : 13.74
nao (mM) : 114.5
ki (mM) : 120
ko (mM) : 2.5
gl=30.3e-3 (mho/cm2)
el = -69.74 (mV)
}
STATE {
m h n p
}
ASSIGNED {
ina (mA/cm2)
ik (mA/cm2)
ip (mA/cm2)
il (mA/cm2)
inf[4]
tau[4] (ms)
}
INITIAL {
mhnp(v*1(/mV))
m = inf[0]
h = inf[1]
n = inf[2]
p = inf[3]
}
BREAKPOINT {
LOCAL ghkna
SOLVE states METHOD cnexp
ghkna = ghk(v, nai, nao)
ina = pnabar*m*m*h*ghkna
ip = ppbar*p*p*ghkna
ik = pkbar*n*n*ghk(v, ki, ko)
il = gl*(v - el)
}
FUNCTION ghk(v(mV), ci(mM), co(mM)) (.001 coul/cm3) {
:assume a single charge
LOCAL z, eci, eco
z = (1e-3)*FARADAY*v/(R*(celsius+273.15))
eco = co*efun(z)
eci = ci*efun(-z)
ghk = (.001)*FARADAY*(eci - eco)
}
FUNCTION efun(z) {
if (fabs(z) < 1e-4) {
efun = 1 - z/2
}else{
efun = z/(exp(z) - 1)
}
}
DERIVATIVE states { : exact when v held constant
mhnp(v*1(/mV))
m' = (inf[0] - m)/tau[0]
h' = (inf[1] - h)/tau[1]
n' = (inf[2] - n)/tau[2]
p' = (inf[3] - p)/tau[3]
}
UNITSOFF
FUNCTION alp(v(mV),i) { LOCAL a,b,c,q10 :rest = -70 order m,h,n,p
v = v+70
q10 = 3^((celsius - 20)/10)
if (i==0) {
a=.36 b=22. c=3.
alp = q10*a*expM1(b - v, c)
}else if (i==1){
a=.1 b=-10. c=6.
alp = q10*a*expM1(v - b, c)
}else if (i==2){
a=.02 b= 35. c=10.
alp = q10*a*expM1(b - v, c)
}else{
a=.006 b= 40. c=10.
alp = q10*a*expM1(b - v , c)
}
}
FUNCTION bet(v,i) { LOCAL a,b,c,q10 :rest = -70 order m,h,n,p
v = v+70
q10 = 3^((celsius - 20)/10)
if (i==0) {
a=.4 b= 13. c=20.
bet = q10*a*expM1(v - b, c)
}else if (i==1){
a=4.5 b= 45. c=10.
bet = q10*a/(exp((b - v)/c) + 1)
}else if (i==2){
a=.05 b= 10. c=10.
bet = q10*a*expM1(v - b, c)
}else{
a=.09 b= -25. c=20.
bet = q10*a*expM1(v - b, c)
}
}
FUNCTION expM1(x,y) {
if (fabs(x/y) < 1e-6) {
expM1 = y*(1 - x/y/2)
}else{
expM1 = x/(exp(x/y) - 1)
}
}
PROCEDURE mhnp(v) {LOCAL a, b :rest = -70
TABLE inf, tau DEPEND celsius FROM -100 TO 100 WITH 200
FROM i=0 TO 3 {
a = alp(v,i) b=bet(v,i)
tau[i] = 1/(a + b)
inf[i] = a/(a + b)
}
}
UNITSON