forked from FabioMurgese/computational-neuroscience
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathizhikevich.m
38 lines (34 loc) · 1.11 KB
/
izhikevich.m
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
%%%%%%%%%%%%%%% Izhikevich model with Leap-Frog method %%%%%%%%%%%%%%%
% u: membrane potential of the neuron (activation of Na+)
% w: membrane recovery variable (inactivation of Na+)
% a: time scale of the recovery variable
% b: sensitivity of the recovery variable to fluctuations of the membrane
% potential
% c: after-spike reset value of the membrane potential
% d: after-spike rest of the recovery variable
% I: synaptic currents or injected dc-currents
% r: flag to distinguish (R) accomodation feature
function [u, w, du, dw, udot, wdot] = izhikevich(a, b, c, d, j, k, l, u, w, I, tau, r)
udot=[];
wdot=[];
if r==true
u = u + tau*(j*u^2+k*u+l-w+I);
w = w + tau*a*(b*(u+65));
du = j*u^2+k*u+l-w+I;
dw = a*(b*(u+65));
else
u = u + tau*(j*u^2+k*u+l-w+I);
w = w + tau*a*(b*u-w);
du = j*u^2+k*u+l-w+I;
dw = a*(b*u-w);
end
% after-spike resetting
if u > 30 % not a threshold, but the peak of the spike
udot(end+1)=30;
u = c;
w = w + d;
else
udot(end+1)=u;
end
wdot(end+1)=w;
end