Pandemic Modelling Exploration Report
Pandemic Modelling Exploration Report
Pandemic Modelling Exploration Report
Question 1 2
Question 2 3
Question 3 6
Question 4 8
Contact Number Calculation 10
Relation to Public Health Practices 11
Question 5 11
Contact Number Calculation 13
Average Duration of Infection Calculation 14
Relation to Public Health Practices 14
Question 6 14
Case 1 for di/dt = 0, s =1/c 15
Case 2 for di/dt = 0, s =1/c 17
Case 3 for di/dt = 0, s =1/c 18
Case for di/dt < 0 19
Question 7 20
Case 1 for finding c 21
Case 2 for finding c 22
Case 3 for finding c 23
Question 8 24
Fraction of Inoculated Population to Prevent Epidemic Calculation 26
Question 9 27
Comparison to Reality 28
References 29
1
Question 1
The SIR equations as outlined within the assignment was implemented into Matlab through the
following program:
ds = -b*y(1)*y(2);
di = b*y(1)*y(2) - k*y(2);
dr = k*y(2);
end
2
Question 2
The conditions given by Question 2 was solved using the Matlab program provided in Question
1 along with the following command:
%% Differential Equation
N = 10^7; % Susceptible Population
I_0 = 10; %Initial infectious individuals
tspan = [0 70]; %From 0 to 70 days
b = 0.8; %Number of close contacts per day
k = 1/3; %Portion of I that recovers per day
y0 = [1, I_0/N, 0]; %Initial Values for s, i, r
%% Plot
plot(t,y)
axis([0 70 0 1.15])
yticks(0:0.1:1.2)
legend('Susceptible','Infected','Recovered')
title('SIR Model for Question 2')
xlabel('t (Days)'), ylabel('s(t), i(t), r(t)')
grid on;
grid minor;
3
Figure 1. SIR Model for b = 0.8, k = 1/3, I0 = 10, N = 107 initial conditions, with s(t), i(t), r(t) on
the y-axis and t in Days on the x-axis.
The findings as predicted by the SIR Model for the conditions given by Question 2 can be
summarized as follows:
The population starts off with 10 infectious individuals, and a population of roughly 107
individuals or susceptible individuals. As the number of days increase, the number of infectious
individuals would begin to increase at a faster rate, the number of recovered individuals would
also increase at a faster rate, and the number of susceptible individuals would decrease at a faster
rate. Noticeable changes to the population in each group would begin on roughly the 17th day.
At 27.5 days, the number of recovered individuals would surpass the number of infectious
individuals at 1.55 × 10 6 individuals in each group or 15.5% of the population. The number of
infectious individuals peaks at roughly 30.5 days after the initial outbreak, with 22% of the
population infectious or around 2.2 × 10 6 infectious individuals.
4
After the peak, the number of infectious individuals would decrease, the rate of change in the
number of recovered individuals and the number of susceptible individuals would approach zero.
At around 30.7 days, the number of recovered individuals would surpass the number of
susceptible individuals with roughly 39% of the population or 3.9 × 10 6 individuals susceptible
and recovered.
The population would be rid of the infectious disease after roughly 57 days. By then, there would
be 0 infectious individuals. 8.8 × 10 6 individuals or roughly 88% of the population would have
contracted and recovered/died from the disease. 1.2 × 10 6 individuals or roughly 12% of the
population would remain susceptible, meaning that they would have never contracted the
disease.
5
Question 3
Variable i0 can be varied by a change in population or a change in the initial number of infectious
individuals ( I 0 ). For this question, I have chosen to vary I 0 = 10 (as presented in Question 2)
by factors of 10, 100, and 1000, while keeping the total population constant at N = 10 7 . For
I 0 = 1, 10, 100, 1000, 10000 , the respective i 0 values are i 0 = 10 −7 , 10 −6 , 10 −5 , 10 −4 , 10 −3 .
The curves s(t) , i(t) , r(t) for varying values of i 0 can be plotted on individual graphs to
demonstrate, in an organized manner, the effects of a change in i 0 on the SIR Model. For a
sample of a complete SIR Model with all three curves refer to Figure 1. The three graphs for
curves s(t) , i(t) , r(t) are presented below:
Figure 2. s(t) curves of SIR Models for five values of i 0 that differ by factors of 10, with initial
conditions b = 0.8, k = 1/3, N = 107. s(t) on the y-axis and t in Days on the x-axis.
6
Figure 3. i(t) curves of SIR Models for five values of i 0 that differ by factors of 10, with initial
conditions b = 0.8, k = 1/3, N = 107. i(t) on the y-axis and t in Days on the x-axis.
Figure 4. r(t) curves of SIR Models for five values of i 0 that differ by factors of 10, with initial
conditions b = 0.8, k = 1/3, N = 107. r(t) on the y-axis and t in Days on the x-axis.
7
As presented in Figure 2, 3, 4 increasing the i 0 value has the effect of shortening the duration of
the initial flat period where i (t), r(t), s(t) ≈ 0 , for each of the curves or SIR Models. The size
and shape of the curves remain the same in all figures. This is akin to saying that an increase in
initial cases ( I 0 ) would start the epidemic more quickly, but would not affect the outcome of the
outbreak in any other way.
Question 4
To vary b, initial conditions are kept the same to that of Question 2: k = 1/3, I0 = 10, N = 10 7 .
The graphs for the SIR Model with b = 0.5, 1.0, 1.5, 2.0 are presented below. The SIR Model for
b = 0.8 is presented in Figure 1.
Figure 5. SIR Model for b = 0.5, with s(t) , Figure 6. SIR Model for b = 1.0, with s(t) ,
i(t) , r(t) on the y-axis and t in Days on the
i(t) , r(t) on the y-axis and t in Days on the
x-axis. x-axis.
8
Figure 7. SIR Model for b = 1.5 with s(t) , Figure 8. SIR Model for b = 2.0 with s(t) ,
i(t) , r(t) on the y-axis and t in Days on the i(t) , r(t) on the y-axis and t in Days on the
x-axis. x-axis.
To better observe the trends that occur with a change in b, Figure 1, 5, 6, 7, 8 can be plotted
together on a single graph:
Figure 9. Collection of SIR Models for b = 0.5, 0.8, 1.0, 1.5, 2.0 with s(t) , i(t) , r(t) on the
y-axis and t in Days on the x-axis.
9
By examining Figure 5,6,7,8,9 , it can be observed that with a change in b, the outcome of the
epidemic would change in several ways. Firstly, the duration of the initial flat period for the
curves would shorten as b increases. Secondly, with an increase in b, the i(t) curves appear to be
stretched vertically, reaching a higher peak in a shorter amount of time. As a result, the r(t)
curves increase more rapidly and the s(t) curves decrease more rapidly. By the end of the
epidemic, the fraction of the population that gets infected and recovers from the disease
approaches 1, and the fraction of the population that remains susceptible to the disease by the
end of the epidemic approaches 0 with an increase in b. The effects of an increase in b appears to
be more drastic when b is increased from a smaller value.
In a real life context, the SIR Models suggest that with an increase in b the epidemic would start
more quickly, and the disease would infect a greater fraction of the population at a faster rate.
This outcome can be reasoned by the definition of b. Parameter b represents the number of close
contacts per day per infected. If infectious individuals come in contact with a greater number of
individuals, the probability of them infecting a susceptible individual grows. A greater number of
contacts per day per infected would expedite the outbreak cycle along with infecting a greater
fraction of the population. Hence, explaining the trends observed in Figure 9.
10
Relation to Public Health Practices
Currently, individuals around the world are practicing social distancing as a means of reducing
the number of close contacts for every individual. Social distancing is done by limiting or
restricting activities in public areas by remaining at home. This public health practice would help
reduce the b and c values of the COVID-19 epidemic by limiting close contacts for the entire
population. This action is necessary as there exists an asymptomatic period for this virus where
the spread of this disease is still possible. Thus, by practicing social distancing, the fraction of
the population affected by COVID-19 can be significantly reduced.
Question 5
To vary k, initial conditions are kept the same to that of Question 2: b = 0.8, I0 = 10, N = 10 7 .
The graphs for the SIR Model with k = 0.1, 0.2, 0.45, 0.6 are presented below. The SIR Model
for k = 1/3 is presented in Figure 1.
Figure 10. SIR Model for k = 0.1 with s(t) , Figure 11. SIR Model for k = 0.2 with s(t) ,
i(t) , r(t) on the y-axis and t in Days on the i(t) , r(t) on the y-axis and t in Days on the
x-axis. x-axis.
11
Figure 12. SIR Model for k = 0.45 with s(t) , Figure 13. SIR Model for k = 0.6 with s(t) ,
i(t) , r(t) on the y-axis and t in Days on the i(t) , r(t) on the y-axis and t in Days on the
x-axis. x-axis.
To better observe the trend that occurs with a change in k, Figure 1, 10, 11, 12, 13 can be plotted
together on a single graph:
Figure 14. Collection of SIR Models for b = 0.10, 0.20, 0.33, 0.45, 0.6 with s(t) , i(t) , r(t) on the
y-axis and t in Days on the x-axis.
12
By examining Figure 10, 11, 12, 13, 14 , it can be observed that with a change in k, the outcome
of the epidemic would change in several ways. Firstly, the duration of the initial flat period for
the curves would shorten as k decreases. Secondly, with a decrease in k, the i(t) curves would
reach a higher peak in a shorter amount of time, however, the duration of the decrease of i(t)
from the peak would not shorten. As a result, the s(t) curve would decrease more rapidly, while
the rate of change for the r(t) curve may vary. By the end of the epidemic, the fraction of the
population that recovers from the disease approaches 1 and the fraction of the population that
remains susceptible to the disease approaches 0 with a decrease in k.
In a real life context, the SIR Models suggest that with a decrease in k, the epidemic would start
more quickly, the disease would infect a greater fraction of the population at a faster rate, and the
disease may plague the population for a longer period of time. This outcome can be reasoned by
the definition of k. Parameter k represents the numbers of individuals moving to the recovered
1
group per day, and k
is assumed to be the average number of days an individual remains
infected. A decrease in k would signify a decrease in the number of individuals that recover each
day and an increase in the number of days an individual remains infectious. If the infectious
period is prolonged and if the number of close contacts remains constant, then the probability of
an infectious individual to infect a susceptible individual increases. A greater number of
individuals would be infected at a faster rate, and infectious individuals would remain infectious
for a longer time. Hence, this would explain the trends observed in Figure 14.
13
Average Duration of Infection Calculation
For this range of k, the the corresponding average numbers of days an individual is infectious or
1
k
values would be:
1 1
k
= 0.1
= 10 (5.4)
1 1 5
k
= 0.6
= 3
(5.5)
5 1
Thus, for 0.1 ≤ k ≤ 0.6 , 3
≤ k
≤ 10 .
Question 6
Equation 3 as provided by the assignment is,
di
dt
= bs(t)i(t) − ki(t) (6.1)
Given k = b/c , and that i(t) can be factored out from both terms, the equation yields
di
dt
= i(t)(bs(t) − bc ) (6.2)
The b term can then be factored out of the Equation 6.2.
di
dt
= bi(t)(s(t) − 1c ) (6.3)
di
Since, bi(t) would always a positive term, because b ≥ 0 and i(t) ≥ 0 , the sign of dt
will be
dependent on the (s(t) − 1c ) term. Thus,
di 1
dt
< 0 when s(t) − c
<0 (6.4)
14
Or it can be said that, when
di 1
dt
< 0 when s < c
(6.5)
The peak value of i(t) would occur at the local maximum of i(t) when,
di 1
dt
= 0, s = c
(6.6)
di 1
The condition for when dt
= 0, s = c
can be demonstrated using a few cases from the previous
questions.
The s(t) value for when s = 1/c can be solved by Matlab using the following method.
1. The peak of i(t) can be found using the following command:
N = 10^7;
I_0 = 10;
tspan = [0 70];
b = 0.8;
k = 1/3;
y0 = [1, I_0/N, 0];
15
2. Using the I and M values, where M = i max or i(t) at its peak, the corresponding s(t)
value for when s(t) = 1/c can be found through inspection of the y values using
WORKSPACE. s(t) values are displayed in the ‘1’ column, and i(t) are displayed in the
‘2’ column.
Figure 15. Display of Matlab WORKSPACE for y values of the SIR Model for question 2. The
di 1
s(t) and i(t) values for when dt
= 0 and s = c
is highlighted in blue.
di
3. The s(t) and i(t) can be verified graphically to ensure that i(t) is located at dt
= 0 , and
the points where i(t) and s(t) land contains the same t value (vertical line test). This can
be done by finding the points for the s(t) and i(t) values on their respective curves on
the SIR Model. The two points are plotted in the figure below:
Figure 16. SIR Model for Question 2, with local max of i(t) plotted as i m and the corresponding
s(t) point where s = 1/c displayed as a black dot with its coordinates shown.
16
The conditions mentioned above can be verified to be true.
di
As can be seen in Figure 16, when dt
= 0 , s = 0.4107 which is roughly equal to 0.4167 , the
value calculated above for when s = 1/c . The discrepancy between the two s values can be
explained by floating point arithmetics, and the size of dt being too large at dt = 1 day.
Therefore, Case 1 verifies that the conditions calculated in equation 6.6 is true.
Using the same method as described in Case 1, the following value and graph can be found:
Figure 17. SIR Model for Question 4 where b = 2.0 , with local max of i(t) plotted as i m and
the corresponding s(t) point where s = 1/c displayed as a black dot with its coordinates shown.
17
di
As can be seen in Figure 17, when dt
= 0 , s = 0.1751 which is roughly equal to 0.167, the value
calculated above for when s = 1/c . Therefore, Case 2 verifies that the conditions calculated in
equation 6.6 is true.
Using the same method as described in Case 1, the following value and graph can be found:
Figure 18. SIR Model for question 5 where k = 0.6 , with local max of i(t) plotted as i m and
the corresponding s(t) point where s = 1/c displayed as a black dot with its coordinates.
di
As can be seen in Figure 18, when dt
= 0 , s = 0.7641 which is roughly equal to 0.75, the value
calculated above for when s = 1/c . Therefore Case 3 verifies that the conditions calculated in
equation 6.6 is true.
18
Case for di/dt < 0
To find a case where the initial di/dt is negative, Equation 6.5 can be used: di
dt
< 0 , when s < 1
c
.
Since c = b/k , the equation can be written as,
di k
dt
< 0 , when s < b
(6.11)
The initial conditions for s when t = 0 is given as s = 1 . Equation 6.11 can be rewritten as,
di
dt
< 0 , when b < k (6.12)
Given the conditions provided in Question 2 and 3, b = 0.8 and k = 1/3 , it cannot satisfy
equation 6.12, since 0.8 > 1/3 , thus, b > k .
Given the conditions provided in Question 4, k = 1/3 is a fixed value and 0.5 ≤ b ≤ 2.0 , it
cannot satisfy equation 6.12, since there exists no values in 0.5 ≤ b ≤ 2.0 , where b < k .
Given the conditions provided in Question 5, b = 0.8 is a fixed value and 0.1 ≤ k ≤ 0.6 , it
cannot satisfy equation 6.12, since there exists no values in 0.1 ≤ k ≤ 0.6 , where b < k .
There are no cases in the answers above where the rate of change of i is negative initially and no
epidemic occurs. This is because if b < k , the total number of close contacts per infected
individual or c would be less than 1, meaning that the probability of the disease infecting a
fraction of the population greater than the initial cases is very low. The disease would eventually
disappear, causing no epidemics to occur. All the above cases depict growth in the infectious
fraction of the population or i , thus, epidemics would occur.
19
Question 7
di
Using the chain rule, dt
can be written as,
di di ds
dt = ds · dt (7.1)
20
This property can be illustrated using a few cases from the previous answers as described below.
To verify Equation 7.11, the value for s ∞ can be found using Matlab.
1. The span of t can be set to a large number where s has settled to its steady state value.
2. Using Matlab WORKSPACE for y values, the last displayed s(t) value can be used as
s ∞ . The s ∞ value is shown in the graph below.
21
Given Equation 7.11 and s ∞ = 0.1222,
ln(0.1222)
c= 0.1222−1
= 2.39473255 (7.14)
This confirms equation 7.11, since given c as calculated in Equation 7.13, c = 2.4 ≈ 2.39473255 .
The discrepancies can be attributed to floating point arithmetic error, and/or that s have not
completely settled at a steady state, it can be taken at an even larger value.
Figure 20. SIR Model for Question 4 b = 2.0 , with s ∞ value displayed as s 995.8
22
Case 3 for finding c
Using initial conditions provided in Question 5, b = 0.8, k = 0.6, I 0 = 10, N = 107.
Given equation 7.12, and b = 0.8 , k = 0.6 ,
c = 0.8 ÷ 0.6 (7.17)
4
This yields, c = 3
= 1.3 .
Using the same process as described in Case 1, the following graph can be produced.
Figure 21. SIR Model for Question 5 k = 0.6 , with s ∞ value displayed as s 986.9
ln(s ∞ )
Given c = s ∞ −1
and s ∞ = 0.5461,
ln(0.5461)
c= 0.5461−1
= 1.332789535 (7.18)
This confirms equation 7.11,since given c as calculated in Equation 7.17, c = 1.3 ≈ 1.33278953 .
23
Question 8
To vary s and r, initial conditions are kept the same to that of Question 2: b = 0.8, k = 1/3 ,
I0 = 10, N = 10 7 . It should be noted that s + i + r = 1 , where i = I 0 /N ≈ 0 , thus, s+r = 1.
The SIR Model for s = 1 , and r = 0 is presented in Figure 1. Permutations for SIR Models with
s = 0.9, 0.8, 0.7, 0.6, 0.5, 0.4 and r = 0.1, 0.2, 0.3, 0.4, 0.5, 0.6 respectively are displayed
below.
Figure 22. SIR Model for Question 2, with Figure 23. SIR Model for Question 2, with
s = 0.9 and r = 0.1 and s(t), i(t), r(t) on the s = 0.8 and r = 0.2 and s(t), i(t), r(t) on the
y-axis and t in Days on the x-axis. y-axis and t in Days on the x-axis.
Figure 24. SIR Model for Question 2, with Figure 25. SIR Model for Question 2, with
s = 0.7 and r = 0.3 and s(t), i(t), r(t) on the s = 0.6 and r = 0.4 and s(t), i(t), r(t) on the
y-axis and t in Days on the x-axis. y-axis and t in Days on the x-axis.
24
Figure 26. SIR Model for Question 2, with Figure 27. SIR Model for Question 2, with
s = 0.5 and r = 0.5 and s(t), i(t), r(t) on the s = 0.4 and r = 0.6 and s(t), i(t), r(t) on the
y-axis and t in Days on the x-axis. y-axis and t in Days on the x-axis.
From Figure 1, 22, 23, 24, 25, 26, 27, it can be observed that with a decrease in s and an increase
in r, the peak of the i(t) curves would begin to flatten. As a result, the s(t) curves and the r(t)
curves appear to be compressed vertically. Less individuals would become infected by the
disease, and the s(t) and r(t) curves would begin to flatline. All curves display no change (ie.
horizontal linear lines), when s = 0.4 and r = 0.6 .
In a real life scenario, an increase in r 0 , before the outbreak, alludes to an increase in the
fraction of the population that is inoculated for the disease. A greater r 0 decreases the fraction
of the population that is still susceptible or s 0 . As r 0 grows, the fraction of the population that
is inoculated helps prevent the susceptible population from contracting the disease, as inoculated
individuals cannot be infected and pass on the disease even if they come in contact with an
infectious individual. This phenomenon is called herd immunity.
As displayed in Figure 27, the disease described by the initial condition b = 0.8, k = 1/3 ,
I0 = 10, N = 10 7 can be completely avoided if roughly 0.6 or 60% of the population becomes
inoculated. This can be observed in Figure 27, as after 1000 days, the initial fraction of
populations in each group remains the same, thus, no epidemic occurs.
25
Fraction of Inoculated Population to Prevent Epidemic Calculation
The specific fraction of the population that needs to be inoculated can be calculated using the
di
principle described in Question 6, where no epidemic would occur if dt
< 0.
26
Question 9
From the information given within the text, several information can be extracted. Firstly, the
average number of days an individual remains infected or 1/k is thought to be 14 days or
between 7-8 days. Thus, 1/k = 14 or 7 ≤ k1 ≤ 8 . Next, it is provided that the contact number or
c , can be between 2 to 6. Thus, 2 ≤ c ≤ 6 .
Figure 28. SIR Model to simulate COVID-19, Figure 29. SIR Model to simulate COVID-19,
with initial conditions of c = 5 , and with initial conditions of c = 4 , and
1/k = 14 . The rise period of i(t) is roughly 31 1/k = 14 . The rise period of i(t) is roughly 37
days. The peak is at roughly i(t) = 0.4778 . days. The peak is at roughly i(t) = 0.4778 .
27
Figure 30. SIR Model to simulate COVID-19, Figure 31. SIR Model to simulate COVID-19,
with initial conditions of with initial conditions of
c = 3 , and 1/k = 14 . The rise period of i(t) is c = 2 , and 1/k = 7 . The rise period of i(t) is
roughly 45 days. The peak is at roughly roughly 45 days. The peak is at roughly
i(t) = 0.3001 . i(t) = 0.1526 .
Comparison to Reality
These prediction models can be compared to reality through statistics for COVID-19 outcomes
of countries that are nearing the end of their epidemic cycle. One densely populated country that
is nearing the end of their COVID-19 epidemic is China. At the height of the outbreak, China
had a total of 58,016 active cases on February 17th [1]. Given that China has a population of
roughly N = 1.4 × 10 9 [2], and assuming that the actual population had 100 times more than the
reported cases, this means that at the peak of China’s i(t) curve, they had i(t) ≈ 0.004144 , or
roughly 0.4% of their population infectious. Since the number of active cases began noticeably
rising around January 1st [3], the rising period for China’s i(t) curve is roughly 47 days. Based
only on the peak of i(t) , the closest model from Figure 28, 29, 30, 31 to China’s outbreak
statistics is probably Figure 31. Even then, the fraction of the population that would be impacted
by the virus is over predicted by roughly 40 times. This might be explained by China’s strict
enforcement of their social distancing policies, along with many other factors and variables
unaccounted for within the SIR Model.
These models can also be compared to another densely populated country that is nearing the end
of their epidemic cycle: South Korea. S. Korea’s i(t) peak occurred on March 11th, with 7362
cases [4]. Given that the actual cases are 100 times the statistic, and that S.Korea’s population is
roughly N = 52 × 10 6 [5], their i(t) at its peak is i(t) ≈ 0.01416 . S. Korea’s noticeable rise in
active cases occurred on February 1st [6], thus, the duration of the i(t) curve rise would be
28
roughly 39 days. The closest model that mimics this outbreak would again be Figure 31. With
this model, the fraction of the population that becomes infectious during the peak is
overpredicted by 11 times. This discrepancy, again, can be attributed to the many unaccounted
variables for within the model.
The SIR Model is one of the basic tools used in epidemiology to help us predict and estimate
trends for disease outbreaks around the world. Although not completely accurate, it would allow
us to predict and prepare for epidemics like COVID-19, through the understanding of factors that
affect epidemics and epidemic dynamics.
References
[1] “ China,” Worldometer. [Online]. Available:
https://www.worldometers.info/coronavirus/country/china/. [Accessed: 14-Apr-2020].
[3] D. B. Taylor, “A Timeline of the Coronavirus Pandemic,” The New York Times, 13-Feb-2020.
[Online]. Available: https://www.nytimes.com/article/coronavirus-timeline.html. [Accessed:
14-Apr-2020].
[6] “South Korea learned its successful Covid-19 strategy from a previous coronavirus outbreak:
MERS,” Bulletin of the Atomic Scientists, 20-Mar-2020. [Online]. Available:
https://thebulletin.org/2020/03/south-korea-learned-its-successful-covid-19-strategy-from-a-previ
ous-coronavirus-outbreak-mers/. [Accessed: 14-Apr-2020].
29