-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathelif.mod
More file actions
120 lines (104 loc) · 3.17 KB
/
elif.mod
File metadata and controls
120 lines (104 loc) · 3.17 KB
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
: Insert in a passive compartment to get an adaptive-exponential (Brette-Gerstner)
: integrate-and-fire neuron with a refractory period.
: This calculates the adaptive current, sets the membrane potential to the
: correct value at the start and end of the refractory period, and prevents spikes
: during the refractory period by clamping the membrane potential to the reset
: voltage with a huge conductance.
:
: Reference:
:
: Brette R and Gerstner W. Adaptive exponential integrate-and-fire
: model as an effective description of neuronal activity.
: J. Neurophysiol. 94: 3637-3642, 2005.
:
: Implemented by Andrew Davison. UNIC, CNRS, March 2009.
NEURON {
POINT_PROCESS eLIF
RANGE V_reset, t_ref, V_th, spikewidth, V_peak
RANGE epsilon
RANGE g_L, E_0, E_u, E_d, E_f
RANGE tau_e, epsilon_0, epsilon_c, delta, alpha
NONSPECIFIC_CURRENT i, I_e
}
UNITS {
(mV) = (millivolt)
(pA) = (picoamp)
(nS) = (nanosiemens)
}
PARAMETER {
V_th = -50 (mV) : spike threshold for exponential calculation purposes
V_reset = -60 (mV) : reset potential after a spike
V_peak = 0. (mV) : peak potential during a spike
t_ref = 2 (ms) : refractory period
gon = 1e9 (nS) : refractory clamp conductance
spikewidth = 1e-12 (ms) : must be less than t_ref
E_0 = -55. (mV)
E_u = -50. (mV)
E_d = -35. (mV)
E_f = -45. (mV)
epsilon_0 = 0.5
epsilon_c = 0.15
alpha = 1. <0, 1e9>
delta = 0.02
tau_e = 500. (ms) <0, 1e9>
g_L = 30. (nS)
I_e = 0 (pA)
}
ASSIGNED {
i (pA)
irefrac (pA)
grefrac (nS)
refractory
}
STATE {
w (pA)
epsilon
}
INITIAL {
grefrac = 0
net_send(0,4)
epsilon = alpha*epsilon_0
}
FUNCTION E_L (epsilon) (mV) {
E_L = E_0 + (E_u - E_0)*(1 - epsilon/epsilon_0)
}
BREAKPOINT {
SOLVE states METHOD derivimplicit : cnexp
irefrac = grefrac*(v-V_reset)
i = ( g_L*(v - E_L(epsilon)) + irefrac - I_e)
}
DERIVATIVE states { : solve eq for adaptation variable
epsilon' = ((1-epsilon/(alpha*epsilon_0))*(1-epsilon/(alpha*epsilon_0))*(1-epsilon/(alpha*epsilon_0)) - (v-E_f)/(E_d-E_f)) / tau_e
}
FUNCTION threshcrossing (v (mV), epsilon) {
if ((v > V_th) && (epsilon > epsilon_c)) {
threshcrossing = 1
}
else {
threshcrossing = -1
}
}
NET_RECEIVE (weight) {
if (flag == 1) { : beginning of spike
v = V_peak
epsilon = epsilon - delta
net_send(spikewidth, 2)
net_event(t)
:printf("spike: t = %f v = %f w = %f i = %f\n", t, v, w, i)
} else if (flag == 2) { : end of spike, beginning of refractory period
v = V_reset
grefrac = gon
if (t_ref > spikewidth) {
net_send(t_ref-spikewidth, 3)
} else { : also the end of the refractory period
grefrac = 0
}
:printf("refrac: t = %f v = %f w = %f i = %f\n", t, v, w, i)
} else if (flag == 3) { : end of refractory period
v = V_reset
grefrac = 0
:printf("end_refrac: t = %f v = %f w = %f i = %f\n", t, v, w, i)
} else if (flag == 4) { : watch membrane potential
WATCH ( threshcrossing(v, epsilon) > 0 ) 1
}
}