-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_dI1_near0_st_theory2.m
105 lines (69 loc) · 1.62 KB
/
main_dI1_near0_st_theory2.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
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
main_init;
global rhobulkK rhobulkD
global pE dE1 dE2 wE nE KE betaE
global pI dI1 dI2 wI nI KI
global JK JD tauK tauD
global N
global vK vD
rhobulkK = 0.5;
rhobulkD = 0.5;
pE = 6;
wE = 5;
pI = 6;
wI = 5;
vK = 1;
vD = 1;
N = 10;
dE1 = 1;
dE2 = 1;
%dI1 = 1;
dI2 = 1;
nE = 4;
nI = 4;
KE = 2;
KI = 2;
global E10 I20 aI aE
JK = vK * rhobulkK * (1-rhobulkK);
JD = vD * rhobulkD * (1-rhobulkD);
E10 = pE/(dE1 + wE*JK);
I20 = pI/(dI2 + wI*JD);
aI = wI*JD/dI1;
aE = wE*JK/dE2;
E1_stst=[];
E2_stst=[];
I1_stst=[];
I2_stst=[];
dI1_list=[];
tauK = delay(rhobulkK, N, vK);
tauD = delay(rhobulkD, N, vD);
delays = [tauK, tauD];
tmin = 8000;
tmax = 10000;
tspan = [0, tmax];
no_y = 3;
dt = 1;
t_start = 8000;
t_end = 10000;
freq_list = [];
max_list = [];
min_list = [];
amp_list = [];
par_list = []; % Used to plot frequency, period
T_list = [];
par_stst = []; %Used to plot bifurcation diagram
y_stst = []; %Used to plot bifurcation diagram
par_bf = []; % Store bifurcation points
y_bf = []; % Store bifurcation points
nunst_stst = []; % Store stability
% Store the first branch point dI1=0
% This cannot be got by the codes in the for loop
for dI1 = 0.0001:0.0001:0.001
sol = dde23(@rhs_dde23, delays, @history, tspan);
par_stst(end+1) = dI1;
y_stst(end+1) = sol.y(3,end);
nunst_stst(end+1) = 0;
end
% Test figure to plot parameter vs period
plot(par_stst, y_stst);
% Save data
save_data_1par_dI1near0(N, par_stst, y_stst, nunst_stst, par_list, freq_list, T_list, amp_list, max_list, min_list, par_bf, y_bf);