-
Notifications
You must be signed in to change notification settings - Fork 5
/
geneval_cvode.inc
226 lines (185 loc) · 4.79 KB
/
geneval_cvode.inc
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
: $Id: geneval_cvode.inc,v 1.6 2004/02/04 21:04:15 billl Exp $
TITLE Kevins Cvode modified Generalized Hodgkin-Huxley eqn Channel Model
COMMENT
Each channel has activation and inactivation particles as in the original
Hodgkin Huxley formulation. The activation particle mm and inactivation
particle hh go from on to off states according to kinetic variables alpha
and beta which are voltage dependent.
Allows exponential, sigmoid and linoid forms (flags 0,1,2)
See functions alpha() and beta() for details of parameterization
ENDCOMMENT
INDEPENDENT {t FROM 0 TO 1 WITH 1 (ms)}
NEURON {
RANGE gmax, g, i
GLOBAL erev, Inf, Tau, vrest
} : end NEURON
CONSTANT {
FARADAY = 96489.0 : Faraday's constant
R= 8.31441 : Gas constant
} : end CONSTANT
UNITS {
(mA) = (milliamp)
(mV) = (millivolt)
(umho) = (micromho)
} : end UNITS
COMMENT
** Parameter values should come from files specific to particular channels
PARAMETER {
erev = 0 (mV)
gmax = 0 (mho/cm^2)
maflag = 0
malphaA = 0
malphaB = 0
malphaV0 = 0
mbflag = 0
mbetaA = 0
mbetaB = 0
mbetaV0 = 0
exptemp = 0
mq10 = 3
mexp = 0
haflag = 0
halphaA = 0
halphaB = 0
halphaV0 = 0
hbflag = 0
hbetaA = 0
hbetaB = 0
hbetaV0 = 0
hq10 = 3
hexp = 0
} : end PARAMETER
ENDCOMMENT
PARAMETER {
cao (mM)
cai (mM)
celsius (degC)
dt (ms)
v (mV)
}
ASSIGNED {
i (mA/cm^2)
g (mho/cm^2)
Inf[2] : 0 = m and 1 = h
Tau[2] : 0 = m and 1 = h
} : end ASSIGNED
STATE { m h }
INITIAL {
mh(v)
m = Inf[0] h = Inf[1]
}
BREAKPOINT {
LOCAL hexp_val, index, mexp_val, mexp2
SOLVE states METHOD cnexp
hexp_val = 1
mexp_val = 1
: Determining h's exponent value
if (hexp > 0) {
FROM index=1 TO hexp {
hexp_val = h * hexp_val
}
}
: Determining m's exponent value
if (mexp > 0) {
FROM index = 1 TO mexp {
mexp_val = m * mexp_val
}
} else if (mexp<0) {
mexp2=-mexp
FROM index = 1 TO mexp2 {
mexp_val = Inf[0] * mexp_val
}
}
: mexp hexp
: Note that mexp_val is now = m and hexp_val is now = h
g = gmax * mexp_val * hexp_val
iassign()
} : end BREAKPOINT
: ASSIGNMENT PROCEDURES
: Must be given by a user routines in parameters.multi
: E.G.:
: PROCEDURE iassign () { i = g*(v-erev) ina=i }
: PROCEDURE iassign () { i = g*ghkca(v) ica=i }
:-------------------------------------------------------------------
DERIVATIVE states {
mh(v)
m' = (-m + Inf[0]) / Tau[0]
h' = (-h + Inf[1]) / Tau[1]
}
:-------------------------------------------------------------------
: NOTE : 0 = m and 1 = h
PROCEDURE mh (v) {
LOCAL a, b, j, qq10[2]
qq10[0] = mq10^((celsius-exptemp)/10.)
qq10[1] = hq10^((celsius-exptemp)/10.)
: Calculater Inf and Tau values for h and m
FROM j = 0 TO 1 {
a = alpha (v, j)
b = beta (v, j)
if (j==1 && hexp==0) { Tau[j] = 1. Inf[j] = 1.
} else {
Inf[j] = a / (a + b)
Tau[j] = 1. / (a + b) / qq10[j]
}
}
} : end PROCEDURE mh (v)
:-------------------------------------------------------------------
FUNCTION alpha(v,j) {
LOCAL flag, A, B, V0
if (j==1 && hexp==0) {
alpha = 0
} else {
if (j == 1) {
A = halphaA B = halphaB V0 = halphaV0+vrest flag = haflag
} else {
A = malphaA B = malphaB V0 = malphaV0+vrest flag = maflag
}
if (flag == 1) { : EXPONENTIAL
alpha = A*exp((v-V0)/B)
} else if (flag == 2) { : SIGMOID
alpha = A/(exp((v-V0)/B)+1)
} else if (flag == 3) { : LINOID
if(v == V0) {
alpha = A*B
} else {
alpha = A*(v-V0)/(exp((v-V0)/B)-1) }
}
}
} : end FUNCTION alpha (v,j)
:-------------------------------------------------------------------
FUNCTION beta (v,j) {
LOCAL flag, A, B, V0
if (j==1 && hexp==0) {
beta = 1
} else {
if (j == 1) {
A = hbetaA B = hbetaB V0 = hbetaV0+vrest flag = hbflag
} else {
A = mbetaA B = mbetaB V0 = mbetaV0+vrest flag = mbflag
}
if (flag == 1) { : EXPONENTIAL
beta = A*exp((v-V0)/B)
} else if (flag == 2) { : SIGMOID
beta = A/(exp((v-V0)/B)+1)
} else if (flag == 3) { : LINOID
if(v == V0) {
beta = A*B
} else {
beta = A*(v-V0)/(exp((v-V0)/B)-1) }
}
}
} : end FUNCTION beta (v,j)
:-------------------------------------------------------------------
FUNCTION FRT(temperature) {
FRT = FARADAY * 0.001 / R / (temperature + 273.15)
} : end FUNCTION FRT (temperature)
:-------------------------------------------------------------------
FUNCTION ghkca (v) { : Goldman-Hodgkin-Katz eqn
LOCAL nu, efun
nu = v*2*FRT(celsius)
if(fabs(nu) < 1.e-6) {
efun = 1.- nu/2.
} else {
efun = nu/(exp(nu)-1.) }
ghkca = -FARADAY*2.e-3*efun*(cao - cai*exp(nu))
} : end FUNCTION ghkca()