-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCoronavirusACE0110.m~
326 lines (240 loc) · 8.61 KB
/
CoronavirusACE0110.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
%%%%%Write on Jul 6 2020
%%%%To solve the within host coronavirus model
clear all
format long
T=15; %%T=maximum day
%%%%read viral load data
viraldata=csvread('viraldata.csv', 0, 1);
SampleYdata=viraldata(1:(T+1), 1); %%%%%use the first 10 days data
%%%use interpolation to get the data for each hour
SampleTData=(0:1:T)'*24;
tdata=(0:1:T*24)';
ydata=interp1(SampleTData, SampleYdata, tdata);
incubation=5;
%%%%%Initial value for optimization
A1_Initial=1.96*10^4;
A2_Initial=3.29*10^4;
M_Initial=5.99*10^3;
V_Initial=200*10^-6;
rhoX=0.006;
%%%%use the estimated paprameters to graph the solutions
pp2=0.05;
funfunfun=@(t, y) model1(t,y, rhoX, pp2, A1_Initial, A2_Initial);
y0=[A1_Initial; pp2*A2_Initial; (1-pp2)*A2_Initial; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; M_Initial; V_Initial];
[t2,y2] = ode15s(funfunfun, [0 24*(T+incubation)], y0);
%%%%We assume the viral load in the lung is two magnitue larger than saliva
p2=plot(t2/24-incubation, 6-2+log10(y2(:, 14)),'LineWidth', 2);
%%%%use the estimated paprameters to graph the solutions
pp1=.025;
funfunfun=@(t, y) model1(t,y, rhoX, pp1, A1_Initial, A2_Initial);
y0=[A1_Initial; pp1*A2_Initial; (1-pp1)*A2_Initial; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; M_Initial; V_Initial];
[t1,y1] = ode15s(funfunfun, [0 24*(T+incubation)], y0);
%%%%We assume the viral load in the lung is two magnitue larger than saliva
p1=plot(t1/24-incubation, 6-2+log10(y1(:, 14)),'--','LineWidth', 2)
hold on
%%%%use the estimated paprameters to graph the solutions
pp0=.005;
funfunfun=@(t, y) model1(t,y, rhoX, pp0, A1_Initial, A2_Initial)
y0=[A1_Initial; pp0*A2_Initial; (1-pp0)*A2_Initial; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; M_Initial; V_Initial];
[t,y] = ode15s(funfunfun, [0 24*(T+incubation)], y0);
%%%%We assume the viral load in the lung is two magnitue larger than saliva
p0=plot(t/24-incubation, 6-2+log10(y(:, 14)),'--','LineWidth', 2)
hold on
%%%%use the estimated paprameters to graph the solutions
pp3=0.1;
funfunfun=@(t, y) model1(t,y, rhoX, pp3, A1_Initial, A2_Initial)
y0=[A1_Initial; pp3*A2_Initial; (1-pp3)*A2_Initial; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; M_Initial; V_Initial];
[t3,y3] = ode15s(funfunfun, [0 24*(T+incubation)], y0);
%%%%We assume the viral load in the lung is two magnitue larger than saliva
p3=plot(t3/24-incubation, 6-2+log10(y3(:, 14)),'--','LineWidth', 2)
ylabel('Viral load (log_{10})','FontSize', 20)
xlabel('Days','FontSize', 20)
set(gca,'fontsize',16)
L0=sprintf('%.1f%% ACE2^+', pp0*100);
L1=sprintf('%.1f%% ACE2^+', pp1*100);
L2=sprintf('%.1f%% ACE2^+', pp2*100);
L3=sprintf('%.1f%% ACE2^+', pp3*100);
legend([p2 p0, p1, p3],{L2,L0,L1,L3},'Location','best','FontSize', 16)
exportgraphics(gcf,'receptors.eps')
hold off
figure
hold on
%%%%We assume the viral load in the lung is two magnitue larger than serum
p2=plot(t2/24-incubation, y2(:, 2)+y2(:, 3)+y2(:, 4)+y2(:, 5),'LineWidth', 2)
%%%%We assume the viral load in the lung is two magnitue larger than serum
p1=plot(t1/24-incubation, y1(:, 2)+y1(:, 3)+y1(:, 4)+y1(:, 5),'--','LineWidth', 2)
%%%%We assume the viral load in the lung is two magnitue larger than serum
p0=plot(t/24-incubation, y(:, 2)+y(:, 3)+y(:, 4)+y(:, 5),'--','LineWidth', 2)
%%%%We assume the viral load in the lung is two magnitue larger than serum
p3=plot(t3/24-incubation, y3(:, 2)+y3(:, 3)+y3(:, 4)+y3(:, 5),'--','LineWidth', 2)
ylabel('A_2 cells (10^6 cells)','FontSize', 20)
xlabel('Days','FontSize', 20)
set(gca,'fontsize',16)
L0=sprintf('%.1f%% ACE2^+', pp0*100);
L1=sprintf('%.1f%% ACE2^+', pp1*100);
L2=sprintf('%.1f%% ACE2^+', pp2*100);
L3=sprintf('%.1f%% ACE2^+', pp3*100);
legend([p2 p0, p1, p3],{L2,L0,L1,L3},'Location','best','FontSize', 16)
exportgraphics(gcf,'receptors_A2Cells.eps')
hold off
% figure
% plot(t/24-incubation, y3(:, 1), 'LineWidth', 1)
% ylabel('A_1 cells (10^6 cells)','FontSize', 20)
% xlabel('days','FontSize', 20)
% exportgraphics(gcf,'A1.eps')
%
%
% figure
% plot(t/24-incubation, y3(:, 2))
% ylabel('A_2^+ cells (10^6 cells)','FontSize', 20)
% xlabel('days','FontSize', 20)
% exportgraphics(gcf,'A2+.eps')
%
% figure
% plot(t/24-incubation, y3(:, 3))
% ylabel('A_2^- cells (10^6 cells)','FontSize', 20)
% xlabel('days','FontSize', 20)
% exportgraphics(gcf,'A2-.eps')
%
%
% figure
% plot(t/24-incubation, y3(:, 4))
% ylabel('A_2^{*+} cells (10^6 cells)','FontSize', 20)
% xlabel('days','FontSize', 20)
% exportgraphics(gcf,'A2+s.eps')
%
% figure
% plot(t/24-incubation, y3(:, 5))
% ylabel('A_2^{*-} cells (10^6 cells)','FontSize', 20)
% xlabel('days','FontSize', 20)
% exportgraphics(gcf,'A2-s.eps')
%
% figure
% plot(t/24-incubation, y3(:, 2)+y3(:,3)+y3(:,4)+y3(:,5))
% ylabel('Healthy A_2 cells (10^6 cells)','FontSize', 20)
% xlabel('days','FontSize', 20)
% exportgraphics(gcf, 'A2_total.eps')
%
%
%
% figure
% plot(t/24-incubation, y3(:, 6))
% ylabel('I cells (10^6 cells)','FontSize', 20)
% xlabel('days','FontSize', 20)
% exportgraphics(gcf,'I.eps')
%
% figure
% plot(t/24-incubation, y3(:, 7))
% ylabel('I^* cells (10^6 cells)','FontSize', 20)
% xlabel('days','FontSize', 20)
% exportgraphics(gcf,'Is.eps')
%
% figure
% plot(t/24-incubation, y3(:, 8))
% ylabel('D cells (10^6 cells)','FontSize', 20)
% xlabel('days','FontSize', 20)
% exportgraphics(gcf,'D.eps')
%
% figure
% plot(t/24-incubation, y3(:, 9))
% ylabel('Interferons','FontSize', 20)
% xlabel('days','FontSize', 20)
% exportgraphics(gcf,'F.eps')
%
% figure
% plot(t/24-incubation, y3(:, 10))
% ylabel('Chemoxines','FontSize', 20)
% xlabel('days','FontSize', 20)
% exportgraphics(gcf,'X.eps')
%
%
% figure
% plot(t/24-incubation, y3(:, 11))
% ylabel('Toxins (10^6 NETs)','FontSize', 20)
% xlabel('days','FontSize', 20)
% exportgraphics(gcf,'T.eps')
%
% figure
% plot(t/24-incubation, y3(:, 12))
% ylabel('M^* cells (10^6 cells)','FontSize', 20)
% xlabel('days','FontSize', 20)
% exportgraphics(gcf,'Ms.eps')
%
% figure
% plot(t/24-incubation, y3(:, 13))
% ylabel('M cells (10^6 cells)','FontSize', 20)
% xlabel('days','FontSize', 20)
% exportgraphics(gcf,'M.eps')
%%%%%The model
function dydt = model1(t,y, rhoX, pp, A1_Initial, A2_Initial) %%%%%%%%%%%%%%
%%%%%%%%%This function is the model to be solved
%%%%Cell parameters
beta=1/6;
KV=1000;
KX=500;
rhoT=0.12;
rhoV=3.1848;
gamma=7.7282;
sigmaA=0.00035;
AT_Initial=A1_Initial+A2_Initial;
delta=sigmaA*A1_Initial/A2_Initial;
KA=AT_Initial/(1-.01);
r2=(delta+sigmaA)/(1-AT_Initial/KA);
a2p=(1-pp)*gamma*(delta+sigmaA);
a2m=pp*gamma*(delta+sigmaA);
diff_rate=1/(7*24);
frac_prolif=delta*7*24;
KA1=A1_Initial/(1-frac_prolif);
mu=0.005;
sigmaM=0.0005;
sigmaMs=0.02;
%%%Immume cells
rM=3;
rMs=350;
kM0=10^-4;
kM1=3*kM0;
%%%%Alveolar cells infection parameters
sigmaI=1/72;
%%%%%%%%%%%%%%%%%%%%%%
%%%%Fluid volume
C1=20;
C2=250*10^-3;
%%%%%%Interferon
sigmaF=0.35;
alpha=0.6;
qF=20;
KF=100;
%%%%%%Virus
rhoVs=rhoV*10^-3;
sigmaV=1/3;
%%%%Toxins and chemokines
r=0.1;
KT=3*10^2;
sigmaX=1;
rhoF1=0.01;
rhoF2=0.0;
qV=1;
%%%%%%%%%%%%
A1=y(1); A2=y(2); A2n=y(3);
A2s=y(4); A2sn=y(5);
I=y(6); Is=y(7); D=y(8);
F=y(9); X=y(10); T=y(11); Ms=y(12); M=y(13); V=y(14);
AT=A1+A2+A2n+A2s+A2sn+I+Is;
%compute per capita rate of diff
a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(kM0*M*V-kM1*Ms*V))/C1-sigmaV*V;
dydt=[dydt(1); dydt(2); dydt(3); dydt(4); dydt(5); dydt(6); dydt(7); dydt(8); dydt(9); dydt(10); dydt(11); dydt(12); dydt(13); dydt(14)];
end