Answer To: Math 435 - Math in the City Fall 2020 Homework 2 due Wednesday, September 16 You may collaborate...
Kshitij answered on Sep 16 2021
Question 1.docx
Question 1
(a) The total population N = S + E + I + R is a contant.
Since the sum of them is a constant then its derivative gives us zero as:
(1)
Hence, plug in the dynamical equations of the SEIR into (1) we get:
Thus, the sum of them is constant
Problem 2
(b) What is the basic reproduction number R0?
The reproduction number
(c) (d) Modify the attached demo code to plot S and I alongside the data. Do they fit?
The function of SIR without virtual dynamics in matlab is written as :
SEIR.m
function S=SEIR(t,x,beta,mu,gamma)
% Matlab function of the SEIR at third problem
S=zeros(4,1);
S(1)=-beta*x(1)*x(3);
S(2)=beta*x(1)*x(3)-mu*x(2);
S(3)=mu*x(2)-gamma*x(3);
S(4)=gamma*x(3);
end
SIR.m
function S=SIR(t,x,beta,gamma)
S=zeros(3,1);
N=x(1)+x(2)+x(3);
S(1)=-beta*x(1)*x(2);
S(2)=beta*x(1)*x(2)/(N)-gamma*x(2);
S(3)=gamma*x(2);
end
TestCodeQ2.m
% (d) Modify the attached demo code to plot S and I alongside the data. Do
% they fit?
clear all,clc
% Please use your own parameters here for beta and gamma
beta=10;
gamma=10;
% This is simulation time try to modify it accroding to your need
tspan=[0 1];
initial=[10 1 1]; % Initial condtions of inital=[S0 I0 R0]
[t,SI]=ode45(@(t,x)SIR(t,x,beta,gamma),tspan,initial);
plot(t,SI,'LineWidth',2); grid on
legend('S(t)','I(t)','R(t)')
TestCodeQ3.m
clear all,clc
% (a) What is R0? Plot the simulation results of this problem. Attach the
% image.
paramters=[0.01 1/4 1/5;0.05 1/4 1/5;0.01 1/3 1/5];
C=cell({'\beta change','\mu Change','\gamma change'})
for kk=1:size(paramters,2)
beta=paramters(kk,1);
gamma=paramters(kk,3);
mu=paramters(kk,2);
% This is simulation time try to modify it accroding to your need
tspan=[0 100];
initial=[90 0 10 0]; % Initial condtions of inital=[S0 E0 I0 R0]
[t,SI]=ode45(@(t,x)SEIR(t,x,beta,mu,gamma),tspan,initial);
figure(),
plot(t,SI,'LineWidth',2); grid on
str=['paramters are [\beta \gamma \mu]=',num2str([beta gamma mu]) , 'With ',C(kk) ];
title(str)
legend('S(t)','E(t)','I(t)','R(t)')
end
ApplyData.pdf
Using Real Data in an SIR Model
D. Sulsky
June 21, 2012
In most epidemics it is difficult to determine how many new infectives there are
each day since only those that are removed, for medical aid or other reasons, can be
counted. Public health records generally give the number of removed per day, per
week, or per month. So to apply the model to an actual disease, we need to know the
number removed per unit time, namely, dR/dt as a function of time. Using previous
results, we can obtain an equation for R alone
dR
dt
= aI = a(N0 −R− S) = a
(
N0 −R− S0 exp
[
− R
ρ
])
, R(0) = 0, (1)
which can only be solved in a parametric way. However this form is not convenient.
Of course we can always compute the solution numerically if we know a, b, S0 and
N0. But, usually we don’t know all the parameters. Thus, we try to carry out a best
fit procedure, assuming, of course, that the model actually is a reasonable description
of the epidemic.
Kermack and McKendrick argued that if the epidemic is not large, R/ρ is small.
Using this observation, we can approximate equation (1) as
dR
dt
≈ a
(
N0 −R− S0
[
1− R
ρ
+
1
2
(
R
ρ
)2
])
= a
(
N0 − S0 +
[
S0
ρ
− 1
]
R−
[
S0R
2
2ρ2
])
.
(2)
Factoring the right-hand side quadratic in R, we can integrate the equation to get
R(t) =
ρ2
S0
[(S0
ρ
− 1
)
+ α tanh
(
αat
2
− φ
)]
α =
[(S0
ρ
− 1
)2
+
2S0(N − S0)
ρ2
]1/2
, φ =
tanh−1(S0
ρ
− 1)
α
.
(3)
1
The removal rate is then given by
dR
dt
=
aα2ρ2
2S0
sech2
(αat
2
− φ
)
, (4)
which involves only three parameters, namely aα2ρ2/(2S0), αb and φ. With epidemics
that are not large, it is this function of time which we should fit to the Public Health
records. On the other hand, if the disease is such that we know the actual number of
the removed class, then it is R(t) that we should use. If R/ρ is not small, however,
we must use the original differential equation for dR/dt.
Examples
Bombay Plague Epidemic, 1905-6
This epidemic lasted for almost a year. Most of the victims who got the disease died,
the number removed per week, that is dR/dt, is approximately equal to the deaths
per week. On the basis that the epidemic was not severe (relative to the population
size), Kermack and McKendrick compared the actual data with (4) and determined
the best fit for the three parameters and got
dR
dt
= 890sech2(0.2t− 3.4). (5)
Figure 1 is from [4] showing the comparison between data and their model. Kermack
and McKendrick [4] note
plague in man is a reflection of plague in rats, and that with respect to
the rat (1) the uninfected population was uniformly susceptible; (2) that
all susceptible rats in the island had an equal chance of being infected;
(3) that the infectivity, recovery, and death rates were of constant value
throughout the course of sickness of each rat; (4) that all cases ended
fatally or became immune; and (5) that the flea population was so large
that the condition approximated to one of contact infection. None of
these assumptions are strictly fulfilled and consequently the numerical
equation can only be a very rough approximation. A close fit is not to
be expected, and deductions as to the actual values of the various con-
stants should not be drawn. It may be said, however, that...