-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOFThpo.mod
135 lines (113 loc) · 3.4 KB
/
OFThpo.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
: $Id: OFThpo.mod,v 1.3 2009/03/13 11:57:56 billl Exp $
COMMENT
based on Otto Friesen Neurodynamix model
spiking portion of cell model
variant on OFThresh.mod that uses paste-on instead of calculated spike
ENDCOMMENT
TITLE OF Threshold Spiking
UNITS {
(mV) = (millivolt)
(nA) = (nanoamp)
(uS) = (microsiemens)
}
NEURON {
POINT_PROCESS OFPO
USEION other WRITE iother VALENCE 1.0
RANGE gkbase : base level of k+ conductance after a spike
RANGE gkmin : min level of k+ conductance can decay to after a spike
RANGE vth : threshold for spike
RANGE tauvtha, vthinc : used for threshold adaptation
RANGE taugka, gkinc : used for gk adaptation (gkadapt state var)
RANGE ik,ek : k-related variables
RANGE tauk : tau for k current
RANGE i,spkht : current, spike height
RANGE refrac : duration of absolute refractory period
RANGE inrefrac : if in refractory period
RANGE apdur : action potential duration
RANGE ena,gnamax : na-related variables -- NOT used
GLOBAL verbose
GLOBAL checkref : check for spikes @ end of refrac
}
ASSIGNED {
v (mV)
iother (nA)
}
STATE { gk vthadapt gkadapt }
PARAMETER {
gkbase=0.060(uS) : Max Potassium conductance
taugka=100 (ms) : Time constant of adaptation
kadapt=0.007(uS) : Amount of adaptation for potassium
spkht = 55(mV)
tauk=2.3 (ms) : Time constant for potassium current
ek = -70(mV)
vth = -40(mV)
refrac = 2.7(ms)
inrefrac = 0
verbose = 0
apdur = 0.9 (ms)
gkinc = 0.006(uS)
tauvtha = 1(ms)
vthinc = 0
ik = 0(nA)
i = 0(nA)
gkmin = 0.00001(uS)
checkref = 1
gnamax = 0 : Na not used -- back compatibility
ena = 0
}
BREAKPOINT {
SOLVE states METHOD cnexp
if( gk < gkmin ) { gk = gkmin }
if( gkadapt < gkbase ) { gkadapt = gkbase }
if( vthadapt < vth ) { vthadapt = vth }
iassign()
}
INITIAL {
net_send(0,1)
gk = 0(uS)
gkadapt = gkbase
vthadapt = vth
ik = 0
i = 0
iother = 0
inrefrac = 0
}
DERIVATIVE states {
gk' = -gk/tauk
gkadapt' = (gkbase - gkadapt)/taugka
vthadapt' = (vth - vthadapt)/tauvtha
}
PROCEDURE iassign () {
ik = gk*(v-ek)
i = ik
iother = i
}
NET_RECEIVE (w) {
if (flag == 1) {
WATCH (v > vthadapt) 2
} else if (flag == 2) { :v > threshold
if(inrefrac == 0) { :if not in refractory period, spike
net_event(t) :send spike event
net_send(apdur,3) :send event for end of action potential
net_send(refrac,4) :send event for end of refractory period
inrefrac=1 :in refractory period
if( verbose ) { printf("spike at t=%g\n",t) }
} else {
if( verbose ) { printf("in refrac @ t = %g, no spike\n",t) }
}
} else if(flag == 3) { :end of action potential
gkadapt = gkadapt + gkinc
vthadapt = vthadapt + vthinc : threshold adaptation
gk = gkadapt :turn gk to max after action potential over
if (verbose) { printf("end of action potential @ t = %g\n",t) }
} else if(flag == 4) { :end of refractory period
inrefrac = 0 :set inrefrac flag off
if( verbose ) { printf("refrac over @ t = %g\n",t) }
:check for new spike @ end of refrac
if(checkref && v > vthadapt) { net_send(0,2) }
}
}
FUNCTION fflag () { fflag=1 }
PROCEDURE version () {
printf("$Id: OFThpo.mod,v 1.3 2009/03/13 11:57:56 billl Exp $ ")
}