forked from nest/nestml
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathizhikevich.nestml
91 lines (64 loc) · 2.21 KB
/
izhikevich.nestml
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
"""
izhikevich - Izhikevich neuron model
####################################
Description
+++++++++++
Implementation of the simple spiking neuron model introduced by Izhikevich [1]_. The dynamics are given by:
.. math::
dv/dt &= 0.04 v^2 + 5 v + 140 - u + I\\
du/dt &= a (b v - u)
.. math::
&\text{if}\;\; v \geq V_{th}:\\
&\;\;\;\; v \text{ is set to } c\\
&\;\;\;\; u \text{ is incremented by } d\\
& \, \\
&v \text{ jumps on each spike arrival by the weight of the spike}
As published in [1]_, the numerics differs from the standard forward Euler technique in two ways:
1) the new value of :math:`u` is calculated based on the new value of :math:`v`, rather than the previous value
2) the variable :math:`v` is updated using a time step half the size of that used to update variable :math:`u`.
This model will instead be simulated using the numerical solver that is recommended by ODE-toolbox during code generation.
Authors
+++++++
Hanuschkin, Morrison, Kunkel
References
++++++++++
.. [1] Izhikevich, Simple Model of Spiking Neurons, IEEE Transactions on Neural Networks (2003) 14:1569-1572
"""
neuron izhikevich:
initial_values:
V_m mV = V_m_init # Membrane potential
U_m real = b * V_m_init # Membrane potential recovery variable
end
equations:
V_m' = ( 0.04 * V_m * V_m / mV + 5.0 * V_m + ( 140 - U_m ) * mV + ( (I_e + I_stim) * GOhm ) ) / ms
U_m' = a*(b*V_m-U_m * mV) / (mV*ms)
end
parameters:
a real = 0.02 # describes time scale of recovery variable
b real = 0.2 # sensitivity of recovery variable
c mV = -65 mV # after-spike reset value of V_m
d real = 8.0 # after-spike reset value of U_m
V_m_init mV = -65 mV # initial membrane potential
V_min mV = -inf * mV # Absolute lower value for the membrane potential.
# constant external input current
I_e pA = 0 pA
end
input:
spikes mV <- spike
I_stim pA <- current
end
output: spike
update:
integrate_odes()
# Add synaptic current
V_m += spikes
# lower bound of membrane potential
V_m = (V_m < V_min)? V_min : V_m
# threshold crossing
if V_m >= 30 mV:
V_m = c
U_m += d
emit_spike()
end
end
end