-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_currentinj_3.m
More file actions
131 lines (112 loc) · 4.41 KB
/
plot_currentinj_3.m
File metadata and controls
131 lines (112 loc) · 4.41 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
121
122
123
124
125
126
127
128
129
%%% current injection, updating calcium revpot each time step%%%
clear all
close all
initparams
%%%%%%%%%%%%%%% SUBTHRESHOLD TO SPIKE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
i_vals = [-0.04:0.01:-0.01 0:0.05:0.3 0.315];
t_startinj = 100;
t_stopinj = 415;
t_run = 500;
nexttile([3 1])
hold on
for i=1:length(i_vals)
I_ext = i_vals(i);
[g,e,elecparam, calciump] = setparams(gna, gfkdr, gskdr, gka, gtca, gnca, glca, gbk, gsk, ggaba, gkir, gleak, ena, ek, ecl, ekir, C, I_ext, tau, reCa, B, depth, F, t_startinj, t_stopinj);
declareglobal(g, e, elecparam, calciump);
tspan = [0; t_run];
y0 = [V_m; m_0; h_0; nf_0; ns_0; k_0; l_0; a_0; b_0; c_0; d_0; e_0; tcai_0; ncai_0; lcai_0];
[t,y] = ode15s(@membraneODE_withcon, tspan, y0);% options);
plot(t,y(:,1))
end
hold off
xlabel("Time (ms)")
ylabel("Membrane Potential (mV)")
legend({'I_{ext} = -0.04','I_{ext} = -0.03','I_{ext} = -0.02','I_{ext} = -0.01','I_{ext} = 0','I_{ext} = 0.05','I_{ext} = 0.1', 'I_{ext} = 0.15','I_{ext} = 0.2','I_{ext} = 0.25','I_{ext} = 0.3','I_{ext} = 0.315'}, Location = 'northwest')
%%%%%%%%%%%%%%%%%%%%%%%%%%%% SPIKING %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
i_vals = [0.35, 0.37, 0.41];
t_startinj = 0;
t_stopinj = 250;
t_run = 400;
for i=1:length(i_vals)
I_ext = i_vals(i);
[g,e,elecparam, calciump] = setparams(gna, gfkdr, gskdr, gka, gtca, gnca, glca, gbk, gsk, ggaba, gkir, gleak, ena, ek, ecl, ekir, C, I_ext, tau, reCa, B, depth, F, t_startinj, t_stopinj);
declareglobal(g, e, elecparam, calciump);
tspan = [0; t_run];
y0 = [V_m; m_0; h_0; nf_0; ns_0; k_0; l_0; a_0; b_0; c_0; d_0; e_0; tcai_0; ncai_0; lcai_0];
[t,y] = ode15s(@membraneODE_withcon, tspan, y0);% options);
nexttile
txt = ['I_{ext} = ', num2str(i_vals(i))];
plot(t,y(:,1), 'DisplayName', txt)
xlabel("Time (ms)")
ylabel("Membrane Potential (mV)")
legend show
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%% Periodic Spiking %%%%%%%%%%%%%%%%%%%%%%%%%%%%
t_startinj = 0;
t_stopinj = 1700;
t_run = 2000;
I_ext = 0.25;
[g,e,elecparam, calciump] = setparams(gna, gfkdr, gskdr, gka, gtca, gnca, glca, gbk, gsk, ggaba, gkir, gleak, ena, ek, ecl, ekir, C, I_ext, tau, reCa, B, depth, F, t_startinj, t_stopinj);
declareglobal(g, e, elecparam, calciump);
tspan = [0; t_run];
y0 = [V_m; m_0; h_0; nf_0; ns_0; k_0; l_0; a_0; b_0; c_0; d_0; e_0; tcai_0; ncai_0; lcai_0];
[t,y] = ode15s(@membraneODE_withcon, tspan, y0);% options);
fig3 = figure();
plot(t,y(:,1))
xlabel("Time (ms)")
ylabel("Membrane Potential (mV)")
%%%%%%%%%%%%%%%%%%%%%%%%%%%% BURSTING %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% This is hardly bursting behaviour... will disregard %%%
%{
t_startinj = 0;
t_stopinj = 200;
t_run = 250;
i_ext = [0.42, 0.43, 0.44, 0.448]; %vals that produce bursting
fig4 = figure();
tiledlayout(length(i_ext),1)
for i=1:length(i_ext)
I_ext = i_ext(i);
[g,e,elecparam, calciump] = setparams(gna, gfkdr, gskdr, gka, gtca, gnca, glca, gbk, gsk, ggaba, gkir, gleak, ena, ek, ecl, ekir, C, I_ext, tau, reCa, B, depth, F, t_startinj, t_stopinj);
declareglobal(g, e, elecparam, calciump);
tspan = [0; t_run];
y0 = [V_m; m_0; h_0; nf_0; ns_0; k_0; l_0; a_0; b_0; c_0; d_0; e_0; tcai_0; ncai_0; lcai_0];
[t,y] = ode15s(@membraneODE_withcon, tspan, y0);% options);
nexttile
txt = ['I_{ext} = ', num2str(i_ext(i))];
plot(t,y(:,1), 'DisplayName', txt)
xlim([150,210])
xlabel("Time (msec)")
ylabel("Membrane Potential (mV)")
legend show
end
%}
%%%%%%%%%%%%%%%%% CALCIUM %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
t_startinj = 0;
t_stopinj = 200;
t_run = 300;
I_ext = 0.448;
[g,e,elecparam, calciump] = setparams(gna, gfkdr, gskdr, gka, gtca, gnca, glca, gbk, gsk, ggaba, gkir, gleak, ena, ek, ecl, ekir, C, I_ext, tau, reCa, B, depth, F, t_startinj, t_stopinj);
declareglobal(g, e, elecparam, calciump);
tspan = [0; t_run];
y0 = [V_m; m_0; h_0; nf_0; ns_0; k_0; l_0; a_0; b_0; c_0; d_0; e_0; tcai_0; ncai_0; lcai_0];
[t,y] = ode15s(@membraneODE_withcon, tspan, y0);% options);
for i=1:length(y(:,15))
eca_store(i) = eca(y(i,13), y(i,14), y(i,15));
cai_store(i) = y(i,13)+ y(i,14)+ y(i,15);
end
fig5 = figure();
tiledlayout(3,1)
nexttile
plot(t, y(:,1))
xlabel("Time (ms)")
ylabel("Membrane Potential (mV)")
nexttile
plot(t, eca_store)
xlabel("Time (ms)")
ylabel("Ca^{2+} Reversal Potential (mV)")
nexttile
plot(t, cai_store)
xlabel("Time (ms)")
ylabel("Intracellular [Ca^{2+}] (mM)")
saveas(fig3, 'plot_periodic_withcon.jpeg')
saveas(fig5, 'plot_calcdyn_withcon.jpeg')