forked from FabioMurgese/computational-neuroscience
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathL_integrator.m
60 lines (51 loc) · 1.38 KB
/
L_integrator.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
%%%%%%%%%%%%%%%%%%%% (L) Integrator %%%%%%%%%%%%%%%%%%%%
% These neurons prefer high-frequency input; the higher the frequency the
% more likely they fire.
clear variables;
a=0.02; b=-0.1; c=-55; d=6;
j=0.04; k=4.1; l=108;
r=false;
u=-60; % threshold value of the model neuron
w=b*u;
udot=[];
wdot=[];
grad_u=[];
grad_w=[];
tau = 0.25;
tspan = 0:tau:100;
T1=tspan(end)/11;
T2=T1+5;
T3 = 0.7*tspan(end);
T4 = T3+10;
for t=tspan
if ((t>T1) && (t < T1+2)) || ((t>T2) && (t < T2+2)) || ((t>T3) && ...
(t < T3+2)) || ((t>T4) && (t < T4+2))
I=9;
else
I=0;
end
[u, w, du, dw, ud, wd] = izhikevich(a, b, c, d, j, k, l, u, w, I, tau, r);
udot(end+1)=ud;
wdot(end+1)=wd;
grad_u(end+1)=du;
grad_w(end+1)=dw;
end
% plot membrane potential
fig = figure;
plot(tspan,udot,[0 T1 T1 (T1+2) (T1+2) T2 T2 (T2+2) (T2+2) T3 T3 (T3+2)...
(T3+2) T4 T4 (T4+2) (T4+2) max(tspan)],...
-90+[0 0 10 10 0 0 10 10 0 0 10 10 0 0 10 10 0 0]);
axis([0 max(tspan) -90 30])
xlabel('time')
ylabel('membrane potential')
title('(L) integrator');
print(fig,'img/L_integrator_membrane_potential.png','-dpng')
% plot phase portrait
fig = figure;
hold on;
plot(udot,wdot)
quiver(udot,wdot,grad_u,grad_w,'r')
xlabel('membrane potential')
ylabel('recovery variable')
title('(L) integrator phase portrait');
print(fig,'img/L_integrator_phase_portrait.png','-dpng')