You are on page 1of 35

Mathematical and Computational Modeling Final Project

A Study of Dispersion Epidemic Models using an SI


Mathematical Model

Submitted by
Shiva Phuyal, Aleah Archibald, Nigussie Guluma, and Tenesha Robinson

December 5, 2018

Abstract: Epidemic is a spreading of an infectious disease over a certain time and in a certain
place. This disease can cause death of many lives. The study of this disease could help to control
and avoid people from getting infected. The mathematical model is one of the tools to study
about epidemic. The objective of this project is to look at an SIR model and modify it. In our
project, we consider that the infected population does not recover but eventually die at a rate -bI.
We also want to assume that the infected population disperses in both one and two directions
relating to Fick’s Law and the susceptible population does not disperse. Also, we will look at an
epidemic that is dispersed by Fisk’s Law along with stream velocities as well as by a flow in a

1
lake whose velocity is based on which direction. In 1D continuous epidemic dispersion model,
the infected population decreases as time increases because the susceptible population decreases.
When the flow of stream with velocity>0 along with Fick’s law is modeled, the infected
population decreases faster along with time as the velocities gets higher. In 2D continuous
epidemic model, the infected concentrations decrease as the susceptible concentrations
decreases.

1. Introduction

Epidemic disease can be defined as spreading of an infectious disease over a certain period in a

certain place. This can result death of many lives. The history of epidemics shows that this

disease has potential to outburst in any time and in any form. For example, Ebola Virus Disease

(EVD) which was first appeared in 1976 returned in 2014-2016 outbreak and affected many

people in west Africa [1]. The prevention and cure for epidemics can protect several lives of

people. One way of prevention could be to design some mathematical model that help us to

understand the severity of the epidemics in a sample of population. The mathematical model

emulates the spread of disease in a population and the transmission of the pathogens based on

contact between infected and susceptible individuals. Once all of the factors are formulated, the

models allow us to make predictions about the number of individuals to be infected, the duration

of the epidemic as well as the epidemic curve, helping to predict the number of cases at each

point in time [2]. Kermack and McKendrick first introduced the concept of such mathematical

model in 1927 known as SIR model, where susceptible (S), infected (I), and recovered (R).  

The SIR model consists of a system of three combined non-linear ordinary differential

equations, which does not possess an explicit formula solution. Simple tools and techniques from

calculus allow us to collect tons of information about different solutions. There are several

assumptions behind the SIR model including large and closed populations, the epidemic has a

2
short duration, no individuals are added or removed from the population i.e. births or deaths,

recovered individual cannot become susceptible or infected, and mass-action mixing of the

population. Mass-action mixing assumes the rate of interaction between susceptible and infected

individuals is proportional to the product of the population sizes. [3] Changing the size of either

population results in new infections per unit of time. This requires the members of both

susceptible and infected populations are evenly distributed in space and do not mix with

subgroups. SIR also assumes each person will interact with each other person per unit time with

equal probability. Most humans have contacts with only a small fraction of individuals in their

community and are more likely to have contacts with family members, neighbors, and

classmates. Children typically have many more contacts than seniors.

2. Models, Methods, and Mathematical Equations


2.1. SIR Epidemic Model

S I R
FIGURE 2.1.1 The simplest SIR model, described by Kermack and Mckendrick in 1927.

The model described in Figure 2.1.1 consists of three compartments: susceptible (S), infected (I),

and recovered (R). In the susceptible population, these are the individuals that have never been

infected and are able to catch the disease. Once they catch the disease, they move into the

infected populations. The infected individuals are compiled into the infected population where

3
they can affect those in the susceptible population. When they recover from the disease, they

move to the recovered population. In this population, individuals are assumed to be immune for

life. This SIR model can be written as ordinary differential equations as listed below. This

implies there is no random change in the model where the initial conditions output the same

result with continuous time.

S' =−aSI with S ( 0 )=S0

I ' =aSI −bI with I ( 0 )=I 0

R' =−bI with R ( 0 )=R0

Note: α represents the rate of infection and b represents the rate of recovery

Now assume that the infected individuals do not recover and eventually die at a rate of −bI .

Also assume that the susceptible and infected populations become functions of space and time in

one or two directions. If in the one direction, S(x,t) and I(x,t). If the two – directional case,

S(x,y,t) and I(x,y,t).

2.2. SI with Dispersion in 1D Epidemic Model


Suppose that infected population disperses in one direction according to Fick’s law. But, the

susceptible population does not disperse. The unknown populations for the susceptible and the

infected will be functions of time and space in one direction . In the one-directional case, the S(x,

t) and I(x, t) are concentrations of the susceptible and the infected populations and satisfy the

equations 1-3.

4
St =−aSI with S ( x ,0 )=S0 , 0 ≤ x ≤ L ….. (1)

I t=aSI −bI + D I xx with I ( x ,0 )=I 0….. (2)

I x =0=I x (L ,t ) ….. (3)

Now we will discretize the 1D continuous epidemic dispersion model. We get

S k+1−S k k +1 k+1
=−a S I
∆t

 Sk +1=S k −a ∆ t Sk +1 I k+1

Also,

I k +1−I k k +1 k+1 k +1 D
=−a S I −b I + ¿ ¿
∆t

 I k+1=I k +a ∆tS k+1 I k +1−b ∆ t I k +1+ D ∆ t


¿¿

D∆t
Let 2
=α and ∆ x= L =h. Therefore,
(∆ x ) n

I k+1=I k +α ∆ tS k+1 I k+1−b ∆ t I k+1+ α [I i+1−2 I i+ I i−1 ]

Given, Ś=S k and Í =I k+1. These are (n+1) unknowns for both, S=S k+1 and I =I k+1. Let

F : R2 ( n+1) → R2 ( n+1) be the function of Si and I i where ( S , I ) ∈ R


2 ( n+1 )
. At each time step, one must

^
solve 2(n+ 1) non-linear equations. Also, let 1 ≤i ≤n+ 1 and i=i− ( n+ 1 ) for i> ( n+1 ) and so that,

for,

5
(i) 1 ≤i ≤n+ 1 : F i = Si− Ś i+ a ∆ t Si I i

(ii) i=n+ 2 : F i = I ^i− Í ^i−a ∆ t S ^i I ^i+ ∆ tb I ^i−α ¿)

(iii) n+2<i<2(n+1) : F i = I ^i− Í i−a ∆ t S ^i I ^i+ ∆ tb I ^i−α ¿)

(iv) i=2(n+ 1) : F i = I ^i− Í ^i−a ∆ t S ^i I ^i+ ∆ tb I ^i−α ¿)

Next, the non-zero components of the Jacobian 2 ( n+1 )∗2( n+1) matrix F 'are:

for,

∂ Fi
(i) 1 ≤i ≤n+ 1 : =F ' i=1+a ∆ t I i
∂ Si

∂ Fi
=F ' i=a ∆ t S i
∂ Si

∂ Fi
(ii) i=n+ 2 : =−a ∆t I i^
∂ S ^i

∂ Fi
=1+b ∆ t +2 α −a ∆ t Si^
∂ I i^

∂ Fi
=−2 α
∂ S ^i+1

∂ Fi
(iii) n+2<i<2(n+1) : =1+b ∆ t +2 α −a ∆ t Si^
∂ I i^

∂ Fi
=−α
∂ I i+1
^

∂ Fi
=−α
∂ I i−1
^

6
∂ Fi
=−a ∆t I i^
∂ S ^i

∂ Fi
(iv) i=2(n+ 1) : =1+b ∆ t +2 α −a ∆ t Si^
∂ I i^

∂ Fi
=−2 α
∂ I i−1
^

∂ Fi
=−a ∆t I i^
∂ S ^i

Thus, the matrix F ' can be written as a block 2 x 2 matrix where the four blocks are

( n+1 )∗(n+ 1) matrices:

A E
F'= ~
F C[ ]
,

~ ∂ Fi ∂ Fi ∂ Fi
where A, E, and F are diagonal matrices whose components are , , and ,
∂ Si ∂ I i ∂ S ^i

respectively. The matrix C is tridiagonal,

for n=4

F6 I 2α 0 0 0

[ ]
1

−α F7 I2
−α 0 0
C= 0 −α F8I 3
−α 0
0 0 −α F 9 I −α
4

0 0 0 −2 α F 10 I 5

To find the steady state solution, we have:

St =0

7
 −aS ( x ) I ( x )=0

 a=0

Also,

I t=0

 aS ( x ) I ( x )−bI ( x ) + D I xx ( x ) =0

 D I xx ( x )=b I 0

bI0 b I (x)
 I xx ( x )= ,∨I x = 0 + c
D D

Using the boundary conditions:

I x ( 0 )=0=c →c =0

Also,

b I 0(0 )
I x ( L ) =0 → =0
D

 I 0=0

Thus,

b I 0 ( x )2
I ( x )= + cx+ d (some constant)
2D

I ( x )=d .

This is the steady state solution.

2.3. SI with Dispersion in 2D Epidemic Model


Suppose that infected population disperses in two direction according to Fick’s law. But, the

susceptible population does not disperse. The unknown populations for the susceptible and the

infected will be functions of time and space in two direction . In the two-directional case, the

8
S(x,y,t) and I(x,y, t) are concentrations of the susceptible and the infected populations and satisfy

the equations 1-4.

St =−aSI with S ( x , y , 0 )=S 0 , 0 ≤ x , y ≤ L … (1)

I t=aSI −bI + D(I xx + I yy )with I ( x , y , 0 )=I 0… (2)

I x (0 , y ,t )=0=I x ( L, y , t) … (3)

I y (x , 0 , t)=0=I y (x , L , t)…. (4)

For the discretize the 2D continuous epidemic dispersion model:

Sk +1=S k −a ∆ t Sk +1 I k+1

I k+1=I k +a ∆t S (k +1) I k +1−b ∆ t I k +1+ ∆ tD I k+1xx + ∆ tD I k+1 yy

L ∆ tD
Let ∆ x= =∆ y=h and α = 2 .Also let S=S k+1 and I =I k+1 for 1 ≤i , j≤ n+1. So n=4 by
n−1 h
2
( n−1 ) =9 → 4 n=16. Therefore I 1 , j =I 2 , j , I n+1 , j=I n , j , I i ,1=I i ,2 , I i , n+1=I i ,n.

For, 2 ≤i , j ≤ n

(i) 0=Gi , j ≅ S i, j −S´i , j a ∆t S i , j I i , j

(ii) 0=H i , j ≅ I i , j− I ´i , j a ∆t S i , j I i , j +b ∆ t I i , j −α (I i−1 , j+ I i , j−1−4 I i , j + I i+1 , j+ I i , j+1 )

(iii) 0=A i , j=I i , j− I´i , j a ∆ t Si , j I i , j +b ∆t I i , j−α (I i−1 , j + I i , j−1−4 I i , j + I i +1 , j + I i , j+1 )

(iv) H i , j=I i , j − I´i , j a ∆ t Si , j I i , j +b ∆t I i , j−α (−2 I i , j + I i+1 , j + I i , j +1)

9
2 2

Let F ( S , I ) =0 , F : R2 (n−1) → R2 (n −1 ) ,and F ( S , I ) =(G , H). We will now apply Newton’s Method

to solve for S and I.

A E G GI
'
F=~ [ ][
F C
= s
Hs HI ]
C11 C 12 0
H I=
2H
2I [
= C 21 C 22 C 23
0 C 32 C 33 ]
−α 0 0

[
C 12,21,23,32= 0 −α 0
0 0 −α ]
β2,2 +2 α −α 0

[
C 11= −α
0
β 3,2 +3 α
−α
−α
β 4,2 +4 α ]
β 2,3 +3 α −α 0
C 22=
[ −α
0
β 3,3+ 4 α
−α
−α
β 4,3 +3 α ]
β 2,4 +2 α −α 0

[
C 33= −α
0
β 3,4 +3 α
−α
−α
β 4,4 +2 α ]
S m+1 Sm
[ ][ ][ ]
I m +1 =
I m −
∆S
∆I

I 0 G s GI ∆ S I 0 G
[ −H s ( G s )−1
][ ][ ] [
I H s HI ∆ I
=
−H s ( G s ) −1
I H ][ ]
Gs G I ∆ S G(S m , I m)

[ ][ ] [ ]
Hs H I ∆ I
=
H ( S m , I m)

I 0 G s GI ∆ S I 0 G
 [ −H s ( G s )−1
][ ][ ] [ ( ) ][ ]
I H s HI ∆ I
=
−H s G s −1
I H

10
Gs GI G

[ 0
−1
H I −H s ( G s ) G ] ∆ I [ H −H ( G ) G ]
I
[ ∆S =
] s s
−1

−1 −1
 ( H ¿¿ I −H s ( G s ) G I ) ∆ I =H−H s ( G s ) G¿

Gs ∆ S=G−G I ∆ I

2.4. Fick’s Motion Law


Let C (x , t) represent concentration as a function of time and space in one direction and A be a

cross-section. Matter changes through A by moving high concentrations to low concentrations.

Also, the change is proportional to the change in time, which is the cross-section area A and the

derivative of the concentration with respect to x. Let D represent dispersion. We have,

∆x
D ∆ tA C x ( x+ , t +∆ t)
2

∆x ∆x
 ( C ( x , t+ ∆ t )−C ( x , t ) ) A ∆ x ≈ D ∆ tA C x (x + , t+ ∆ t)≈−D ∆ tA C x ( x− , t+ ∆ t)
2 2

 C t=( D C x ) x

This resembles the heat equation where the concentration is replaced with temperature and

dispersion is replaced by thermal conductivity divided by density and specific heat. [4]

3. Numerical Simulations and Plots


3.1. Discrete MATLAB Code for the Dispersion in 1D Epidemic Model
function [F,u,m] = SIDiff1D(Sus0,inf0,a,b,D,n,maxk,L,T)
% This code is for susceptible/infected population.
% The infected may disperse in 1D via Fick's law.
% Newton's method is used.
% The full Jacobian matrix is defined.
% The linear steps are solved by A\d.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Initialize the parameter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

sus0 = 50.;
inf0 = 0.;

11
a = 20/50;
b = 1;
D = 10000;
n = 20;
nn = 2*n+2;
maxk = 80;
L = 900;
dx = L/n;
x = dx*(0:n);
T = 3;
dt = T/maxk;
alpha = D*dt/(dx*dx);
FP = zeros(nn);
F = zeros(nn,1);
sus = ones(n+1,1)*sus0; % define initial populations
sus(1:3) = 2;
susp = sus;
inf = ones(n+1,1)*inf0;
inf(1:3) = 48;
infp = inf;
for k = 1:10 % begin time steps
u = [susp; infp]; % begin Newton iteration
for m = 1:20
for i = 1:nn % compute Jacobian matrix
if i>=1 && i<=n+1
F(i) = sus(i) - susp(i) + dt*a*sus(i)*inf(i);
FP(i,i) = 1 + dt*a*inf(i);
FP(i,i+n+1) = dt*a*sus(i);
end
if i == n+2
F(i) = inf(1) - infp(1) + b*dt*inf(1) -...
alpha*2*(-inf(1) + inf(2)) -...
a*dt*sus(1)*inf(1);
FP(i,i) = 1+b*dt + alpha*2 - a*dt*sus(1);
FP(i,i+1) = -2*alpha;
FP(i,1) = -a*dt*inf(1);
end
if i>n+2 && i<nn
i_shift = i - (n+1);
F(i) = inf(i_shift) - infp(i_shift) + ...
b*dt*inf(i_shift) - ...
alpha*(inf(i_shift-1)...
- 2*inf(i_shift) + inf(i_shift+1))...
- a*dt*sus(i_shift)*inf(i_shift);
FP(i,i) = 1+b*dt + alpha*2 - a*dt*sus(i_shift);
FP(i,i-1) = -alpha;
FP(i,i+1) = -alpha;
FP(i, i_shift) = - a*dt*inf(i_shift);
end
if i == nn
F(i) = inf(n+1) - infp(n+1) + b*dt*inf(n+1) -...
alpha*2*(-inf(n+1) + inf(n)) - ...
a*dt*sus(n+1)*inf(n+1);
FP(i,i) = 1+b*dt + alpha*2 - a*dt*sus(n+1);
FP(i,i-1) = -2*alpha;
FP(i,n+1) = -a*dt*inf(n+1);
end
end
du = FP\F; % solve linear system
u = u - du;
sus(1:n+1) = u(1:n+1);
inf(1:n+1) = u(n+2:nn);
error = norm(F);

12
if error < 0.00001
break;
end
end % Newton iterations
time(k) = k*dt;
time(k)
m
error
susp = sus;
infp = inf;
sustime(:,k) = sus(:);
inftime(:,k) = inf(:);
axis([0 900 0 60]);
hold on;
plot(x,sus,x,inf)
xlabel('space')
ylabel('population concentrations')
pause

end % time step


hold off
figure(2);
plot(time,sustime(10,:),time,inftime(10,:))
xlabel('time')
ylabel('population concentrations')

end

3.2. Plots for the Dispersion in 1D Epidemic Model

13
FIGURE 3.2.1

FIGURE 3.2.2 Time Step

Discussion of Figures: In figure 3.2.1, five times plots of infected and susceptible versus space

are given. As time increases the locations of the largest concentrations of infected move from left

to right. The left side of the infected will decrease as time increases because the concentration of

the susceptible population decreases. Eventually, the infected population will start to decrease for

all locations in space. In figure 3.2.2., one plot of infected and susceptible versus time is given.

14
As time increases, the infected population decreases while the susceptible population increases in

a certain location.

3.3. Modified MATLAB Code for the Epidemic Dispersed by Fick’s law as well as by the
flow of stream in 1D
Now let an epidemic be dispersed by Fisk’s Law as well as by the flow of a stream whose

velocity is v> 0. We will modify the discrete model to take this into account:

I t=aSI −bI + D I xx −v I x

Following the same steps as discretizing the 1D Model, we make small adjustments:

S k+1−S k k +1 k+1
=−a S I
∆t

 Sk +1=S k −a ∆ t Sk +1 I k+1

Also,

I k +1−I k k +1 k+1 k +1 D
=−a S I −b I + ¿ ¿
∆t

 I k+1=I k +a ∆tS k+1 I k +1−b ∆ t I k +1+ D ∆ t


¿¿

D∆t v∆t
Let α = 2 and β= . Then,
(∆ x ) ∆x

I k+1=I k +a ∆tS k+1 I k +1−b ∆ t I k +1+ α [ I i +1−2 I i + I i−1 ] −β [I i+1−I i ]

for,

(v) 1 ≤i ≤n+ 1 : F i = Si− Ś i+ a ∆ t Si I i

(vi) i=n+ 2 : F i = I ^i− Í ^i−a ∆ t S ^i I ^i+ ∆ tb I ^i−α ( −2 I i^ +2 I i+^ 1) −β ( I ^i+1−I ^i)

15
(vii) n+2<i<2(n+1) : F i = I ^i− Í i−a ∆ t S ^i I ^i+ ∆ tb I ^i−α ¿)−β ( I ^i+1−I ^i)

(viii) i=2(n+ 1) : F i = I ^i− Í ^i−a ∆ t S ^i I ^i+ ∆ tb I ^i−α ¿)−β ( I ^i+1−I ^i)

The Jacobian matrix F 'are:

for,

∂ Fi
(v) 1 ≤i ≤n+ 1 : =F ' i=1+a ∆ t I i
∂ Si

∂ Fi
=F ' i=a ∆ t S i
∂ Si

∂ Fi
(vi) i=n+ 2 : =−a ∆t I i^
∂ S ^i

∂ Fi
=1+b ∆ t +2 α −a ∆ t Si^ + β
∂ I i^

∂ Fi
=−2 α −β
∂ S ^i+1

∂ Fi
(vii) n+2<i<2(n+1) : =1+b ∆ t +2 α −a ∆ t Si^ + β
∂ I i^

∂ Fi
=−α− β
∂ I i+1
^

∂ Fi
=−α
∂ I i−1
^

∂ Fi
=−a ∆t I i^
∂ S ^i

16
∂ Fi
(viii) i=2(n+ 1) : =1+b ∆ t +2 α −a ∆ t Si^ + β
∂ I i^

∂ Fi
=−2 α
∂ I i−1
^

∂ Fi
=−a ∆t I i^
∂ S ^i

Thus, the matrix F ' can be written as a block 2 x 2 matrix where the four blocks are

( n+1 )∗(n+ 1) matrices:

A E
F'= ~[ ]
F C
,

~ ∂ Fi ∂ Fi ∂ Fi
where A, E, and F are diagonal matrices whose components are , , and ,
∂ Si ∂ I i ∂ S ^i

respectively.

function [F,u,m] = SIDiff1Dmodified(Sus0,inf0,a,b,D,n,maxk,L,T,vel)


% This code is for susceptible/infected population.
% The infected may disperse in 1D via Fick's law.
% Newton's method is used.
% The full Jacobian matrix is defined.
% The linear steps are solved by A\d.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%
% Initialize the parameter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%

sus0  = 50.;
vel = 20.0;
inf0  = 0.;
a     = 20/50;
b     = 1;

17
D     = 10000;
n     = 20;
nn    = 2*n+2;
maxk  = 80;
L     = 900;
dx    = L/n;
x     = dx*(0:n);
T     = 3;
dt    = T/maxk;
alpha = D*dt/(dx*dx);
beta = vel*dt/dx;
FP    = zeros(nn);
F     = zeros(nn,1);
sus   = ones(n+1,1)*sus0;  % define initial populations
sus(1:3) = 2;
susp     = sus;
inf      = ones(n+1,1)*inf0;
inf(1:3) = 48;
infp     = inf;
for k = 1:10               % begin time steps 
    u = [susp; infp];      % begin Newton iteration
    for m = 1:20
        for i = 1:nn       % compute Jacobian matrix 
            if i>=1 && i<=n+1
               F(i) = sus(i) - susp(i) + dt*a*sus(i)*inf(i);
               FP(i,i) = 1 + dt*a*inf(i);
               FP(i,i+n+1) = dt*a*sus(i);
            end
if i == n+2
               F(i) = inf(1) - infp(1) + b*dt*inf(1) -...
                      alpha*(-2*inf(1) + 2*inf(2)) -...
                      a*dt*sus(1)*inf(1)- beta*( inf(2)- inf(1));
               FP(i,i) = 1+b*dt + alpha*2 - a*dt*sus(1)+beta;
               FP(i,i+1) = -2*alpha-beta;
               FP(i,1) = -a*dt*inf(1);
            end
            if i>n+2 && i<nn
               i_shift = i - (n+1);
               F(i) = inf(i_shift) - infp(i_shift) + ...
                      b*dt*inf(i_shift) - ...
                      alpha*(inf(i_shift-1)...
                      - 2*inf(i_shift) + inf(i_shift+1))...
                      - a*dt*sus(i_shift)*inf(i_shift)...

18
                      -beta*( inf(i_shift+1)- inf(i_shift));
               FP(i,i) = 1+b*dt + alpha*2 - a*dt*sus(i_shift)+ beta;
               FP(i,i-1) = -alpha;
               FP(i,i+1) = -alpha-beta;
               FP(i, i_shift) = - a*dt*inf(i_shift);
            end
            if i == nn
               F(i) = inf(n+1) - infp(n+1) + b*dt*inf(n+1) -...
                      alpha*2*(-inf(n+1) + inf(n)) - ...
                      a*dt*sus(n+1)*inf(n+1)-beta*( inf(2)- inf(1));
               FP(i,i) = 1+b*dt + alpha*2 - a*dt*sus(n+1)+beta;
               FP(i,i-1) = -2*alpha;
               FP(i,n+1) = -a*dt*inf(n+1);
            end
        end
        du = FP\F;        % solve linear system
        u  = u - du;
        sus(1:n+1) = u(1:n+1);
        inf(1:n+1) = u(n+2:nn);
        error = norm(F);
        if error < 0.00001
            break;
        end
    end    % Newton iterations

    
    time(k) = k*dt;
    time(k)
  m
    error
    susp = sus;
    infp = inf;
    sustime(:,k) = sus(:);
    inftime(:,k)  = inf(:);
    axis([0 900 0 60]);
    hold on;
    plot(x,sus,x,inf)
    xlabel('space')
    ylabel('population concentrations')
    pause
    
end                        % time step
hold off

19
figure(2);
plot(time,sustime(10,:),time,inftime(10,:)) 
xlabel('time')
ylabel('population concentrations')
end
   

3.4. Plots for the Epidemic Dispersed by Fick’s law as well as by the flow of stream in 1D

FIGURE 3.4.1. velocity = 1.0

20
FIGURE 3.4.2. velocity = 3.0

FIGURE 3.4.3. velocity = 4.0

21
FIGURE 3.4.4. velocity = 6.0

FIGURE 3.4.5. Time Step

Discussion of Figures:
When the velocity is 1.0 in figure 3.4.1, we can see that the low concentrations strictly become

higher concentrations as well as high concentrations strictly move down to the lower

concentrations. As the velocity increase in figures 3.4.2-3.4.5, the higher concentrations move to

lower concentrations but between space 650 and 750, it staggers between high and low. In

22
comparison, the infected population moves from left to right but the infected population

decreases.

3.5. Discrete MATLAB Code for the Dispersion in 2D Epidemic Model


SIDiff2d
----------------------------------------------------------------
function SIDiff2d (sus0,inf0,a,b,D,n,maxk,T)
% This code is for susceptible/infected population.
% The infected may disperse in 2D via Fick's law.
% Newton's method is used.
% The Schur complement is used on the Jacobian matrix.
% The linear solve steps use a sparse pcg.
% Uses m-files coeff_in_laplace.m, update_bc.m and pcgssor.m
clear;
sus0 = 50;
inf0 = 0;
a = 20/50;
b = 1;
D = 10000;
n = 21;
maxk = 80;
dx = 900./(n-1);
x = dx*(0:n);
dy = dx;
y = x;
T = 3;
dt = T/maxk;
alpha = D*dt/(dx*dx);
coeff_in_laplace; % define the coefficient in laplace
G = zeros(n+1); % equation for sus (susceptible)
H = zeros(n+1); % equation for inf (infected)
sus = ones(n+1)*sus0; % define initial populations
sus(1:3,1:3) = 2;
susp = sus;
inf = ones(n+1)*inf0;
inf(1:3,1:3) = 48;
infp = inf;
for k = 1:maxk % begin time steps
for m = 1:20 % begin Newton iteration
for j = 2:n % compute sparse Jacobian matrix
for i = 2:n
G(i,j) = sus(i,j) - susp(i,j) + ...
dt*a*sus(i,j)*inf(i,j);
H(i,j) = inf(i,j) - infp(i,j) + b*dt*inf(i,j)...
- alpha*(cw(i,j)*inf(i-1,j) + ...
ce(i,j)* inf(i+1,j) + ...
cs(i,j)*inf(i,j-1) +...
cn(i,j)* inf(i,j+1)...
- cc(i,j)*inf(i,j)) - ...
a*dt*sus(i,j)*inf(i,j);
ac(i,j) = 1 + dt*b+alpha*cc(i,j)-dt*a*sus(i,j);
ae(i,j) = -alpha*ce(i,j);

23
aw(i,j) =
-alpha*cw(i,j);
an(i,j) =
-alpha*cn(i,j);
as(i,j) =
-alpha*cs(i,j);
ac(i,j) =
ac(i,j)-(dt*a*sus(i,j))*...
(-dt*a*inf(i,j))/(1+dt*a*inf(i,j));
rhs(i,j) = H(i,j) - (-dt*a*inf(i,j))*G(i,j)/...
(1+dt*a*inf(i,j));
end
end
% solve linear system
[dinf , mpcg] = pcgssor(an,as,aw,ae,ac,inf,rhs,n);
dsus(2:n,2:n) = G(2:n,2:n)-...
(dt*a*sus(2:n,2:n)).*dinf(2:n,2:n);
update_bc; % update the boundary values
sus = sus - dsus;
inf = inf - dinf;
error = norm(H(2:n,2:n));
if error < 0.0001
break;
end
end % Newton iterations
susp = sus;
infp = inf;
time(k) = k*dt;
current_time = time(k)
mpcg
error
subplot(1,2,1)
mesh(x,y,inf)
title('infected')
axis([0 1000 0 1000 0 40]);
subplot(1,2,2)
mesh(x,y,sus)
title('susceptible')
axis([0 1000 0 1000 0 50]);
pause
end % time step

coeff_in_laplace.m

------------------------------------------------------------------------------------------------------------------------------------------
cc = 4*ones(n+1); % coefficients in Laplace
ce = ones(n+1);
cw = ones(n+1);
cn = ones(n+1);
cs = ones(n+1);
cw(2,2) = 0.;
cc(2,2) = 2.;
cs(2,2) = 0.;

24
cs(3:n-1,2) = 0.;
cc(3:n-1,2) = 3.;
cs(n,2) = 0.;
cc(n,2) = 2.;
ce(n,2) = 0.;
ce(n,3:n-1) = 0.;
cc(n,3:n-1) = 3.;
ce(n,n) = 0.;
cc(n,n) = 2.;
cn(n,n) = 0.;
cn(3:n-1,n) =0.;
cc(3:n-1,n) = 3.;
cw(2,n) = 0.;
cc(2,n) = 2.;
cn(2,n) = 0.;
cw(2,3:n-1) = 0.;
cc(2,3:n-1) = 3.;

update_bc.m

dinf(2:n,1) = dinf(2:n,2); % update the boundary values


dinf(2:n,n+1) = dinf(2:n,n);
dinf(1,2:n) = dinf(2,2:n);
dinf(n+1,2:n) = dinf(n,2:n);
dsus(2:n,1) = dsus(2:n,2);
dsus(2:n,n+1) = dsus(2:n,n);
dsus(1,2:n) = dsus(2,2:n);
dsus(n+1,2:n) = dsus(n,2:n);
dsus(1,1) = dsus(2,2);
dsus(n+1,n+1) = dsus(n,n);
dsus(1,n+1) = dsus(2,n);
dsus(n+1,1) = dsus(n,2);
dinf(1,1) = dinf(2,2);
dinf(n+1,n+1) = dinf(n,n);
dinf(1,n+1) = dinf(2,n);
dinf(n+1,1) = dinf(n,2);

pcgssor

% This function is the solve step in a Picard method


% PCG subroutine with SSOR preconditioner
function [u , mpcg] = pcgssor(an,as,aw,ae,ac,up,rhs,n)
w = 1.5;
u = up;
r = zeros(n+1);
rhat = zeros(n+1);
q = zeros(n+1);

25
p = zeros(n+1);
% Use the previous Picard iterate as an initial guess for PCG.
for j = 2:n
for i = 2:n
r(i,j) = rhs(i,j)-(ac(i,j)*up(i,j)...
+ aw(i,j)*up(i-1,j) + ae(i,j)*up(i+1,j)...
+ as(i,j)*up(i,j-1) + an(i,j)*up(i,j+1));
end
end
error = 1. ;
m = 0;
rho = 0.0;
while ((error>.0001)&&(m<200))
m = m+1;
oldrho = rho;
% Execute SSOR preconditioner.
for j = 2:n
for i = 2:n
rhat(i,j) = w*(r(i,j) - aw(i,j)*rhat(i-1,j)...
-as(i,j)*rhat(i,j-1))/ac(i,j);
end
end
for j = 2:n
for i = 2:n
rhat(i,j) = ((2.-w)/w)*ac(i,j)*rhat(i,j);
end
end
for j = n:-1:2
for i = n:-1:2
rhat(i,j) = w*(rhat(i,j) - ae(i,j)*rhat(i+1,j)...
-an(i,j)*rhat(i,j+1))/ac(i,j);
end
end
% Find conjugate direction.
rho = sum(sum(r(2:n,2:n).*rhat(2:n,2:n)));
if (m==1)
p = rhat;
else
p = rhat + (rho/oldrho)*p ;
end
% Execute matrix product q = Ap.
for j = 2:n
for i = 2:n
q(i,j) = ac(i,j)*p(i,j) + aw(i,j)*p(i-1,j)...
+ ae(i,j)*p(i+1,j) + as(i,j)*p(i,j-1)...
+ an(i,j)*p(i,j+1);
end
end
% Find steepest descent.
alpha = rho/sum(sum(p.*q));
u = u + alpha*p;
r = r - alpha*q;
error = max(max(abs(r(2:n,2:n))));
end % end while loop
mpcg = m;

26
3.6. Discrete Plots for the Dispersion in 2D Epidemic Model

infected susceptible

40 50

40
30

30
20
20

10
10

0 0
1000 1000
1000 1000
500 500
500 500

0 0 0 0

FIGURE 3.6.1

Discussion of Figures:

27
The infected portion of the population initial concentration was 48. The graph in Figure 3.6.1 on

the left shows the infected population increasing.  In contrast, the concentration of the infected

population is decreasing because the concentration of the susceptible population is getting closer

to 0. The 2d model is similar and confirms the graphs in the 1d model.

3.7. Modified discrete model for the Epidemic Dispersed by Fick’s law as well as by the
flow in a lake in 2D
From section 2.3 , we have SI with Dispersion in 2D Epidemic Model

St= -aSI with Sx,y,0= S0, 0≤x,y≤L


It= aSI-bI+D(Ixx+Iyy) with Ix,y,0= I0
Ix(0,y,t)= 0= Ix (L,y,t)
Iy(x,0,t)= 0= Iy (x,L,t)
Also, we can modify for two dimensions of Fick’s law

For the discretize the 2D continuous epidemic dispersion model:


Sk+1=Sk-α∆tSk+1Ik+1

Let an epidemic be dispersed by Fick’s law as well as by a flow in a lake


whose velocity is v= (v1,v2) The following is a modification of section (2.3) to take
this into account
St= -aSI with Sx,y,0= S0, 0≤x,y≤L
It= aSI-bI+D(Ixx+Iyy) -V1 I X −V 2 I Y with Ix,y,0= I0
Ix(0,y,t)= 0= Ix (L,y,t)
Iy(x,0,t)= 0= Iy (x,L,t)
For the discretize the 2D continuous epidemic dispersion model:

Sk +1=S k −α ∆ t S k+1 I k +1
I k+1=I k +a ∆t S (k +1) I k +1−b ∆ t I k +1+ ∆ tD I k+1xx + ∆ tD I k+1 yy - v 1 I X -- v 1 I y

28
L ∆ tD
Let ∆ x= =∆ y=h and α = 2 .Also let S=S k+1 and I =I k+1 for 1 ≤i , j≤ n+1. So n=4 by
n−1 h
2
( n−1 ) =9 → 4 n=16. Therefore I 1 , j =I 2 , j , I n+1 , j=I n , j , I i ,1=I i ,2 , I i , n+1=I i ,n.
Beta1=v1∆ t /∆ x beta2= v2∆ t /∆ y

For, 2 ≤i , j ≤ n

(i) 0=G i , j ≅ S i, j −S´i , j a ∆t S i , j I i , j

(ii) 0=H i , j ≅ I i , j− I ´i , j a ∆t S i , j I i , j +b ∆ t I i , j −α (I i−1 , j+ I i , j−1−4 I i , j + I i+1 , j+ I i , j+1 )-beta1( I I +1


- I I )-beta2( I J+ 1- I i , j ¿

(iii) 0=A i , j=I i , j− I´i , j a ∆ t Si , j I i , j +b ∆t I i , j−α (I i−1 , j + I i , j−1−4 I i , j + I i +1 , j + I i , j+1 )

(iv) H i , j=I i , j − I´i , j a ∆ t Si , j I i , j +b ∆t I i , j−α (−2 I i , j + I i+1 , j + I i , j +1)+¿-beta1( I I +1 ,J - I I , j )-


beta2( Ii ,J +1- I i , j ¿

3.8. Modified MATLAB Code for the Epidemic Dispersed by Fick’s law as well as by the
flow in a lake in 2D

function SIDiff2imd(sus0,inf0,a,b,D,n,maxk,T,v1,v2)
% This code is for susceptible/infected population.
% The infected may disperse in 2D via Fick's law.
% Newton's method is used.
% The Schur complement is used on the Jacobian matrix.
% The linear solve steps use a sparse pcg.
% Uses m-files coeff_in_laplace.m, update_bc.m and pcgssor.m
clear;
sus0 = 50;
inf0 = 0;
a = 20/50;
b = 1;
D = 10000;
n = 40;

29
v1=34;
v2=56;

maxk = 80;
dx = 900./(n-1);
x = dx*(0:n);
dy = dx;
y = x;
T = 3;
dt = T/maxk;
beta1=v1*dt/dx;
beta2=v2*dt/dx;
alpha = D*dt/(dx*dx);
coeff_in_laplace; % define the coefficient in laplace
G = zeros(n+1); % equation for sus (susceptible)
H = zeros(n+1); % equation for inf (infected)
sus = ones(n+1)*sus0; % define initial populations
sus(1:3,1:3) = 2;
susp = sus;
inf = ones(n+1)*inf0;
inf(1:3,1:3) = 48;
infp = inf;
for k = 1:maxk % begin time steps
for m = 1:20 % begin Newton iteration
for j = 2:n % compute sparse Jacobian matrix
for i = 2:n
G(i,j) = sus(i,j) - susp(i,j) + ...
dt*a*sus(i,j)*inf(i,j);
H(i,j) = inf(i,j) - infp(i,j) + b*dt*inf(i,j)...
- alpha*(cw(i,j)*inf(i-1,j) + ...
ce(i,j)* inf(i+1,j) + ...
cs(i,j)*inf(i,j-1) +...
cn(i,j)* inf(i,j+1)...
- cc(i,j)*inf(i,j)) - ...
a*dt*sus(i,j)*inf(i,j)+beta1*(inf(i+1,j)-inf(i,j))+beta2*(inf(i,j+1)-inf(i,j));

ac(i,j) = 1 + dt*b+alpha*cc(i,j)-dt*a*sus(i,j)+beta1+beta2;
ae(i,j) = -alpha*ce(i,j)-beta1;
aw(i,j) = -alpha*cw(i,j);
an(i,j) = -alpha*cn(i,j)-beta2;
as(i,j) = -alpha*cs(i,j);
ac(i,j) = ac(i,j)-(dt*a*sus(i,j))*...
(-dt*a*inf(i,j))/(1+dt*a*inf(i,j));
rhs(i,j) = H(i,j) - (-dt*a*inf(i,j))*G(i,j)/...
(1+dt*a*inf(i,j));
end
end
% solve linear system
[dinf , mpcg] = pcgssor(an,as,aw,ae,ac,inf,rhs,n);
dsus(2:n,2:n) = G(2:n,2:n)-...
(dt*a*sus(2:n,2:n)).*dinf(2:n,2:n);
update_bc; % update the boundary values
sus = sus - dsus;
inf = inf - dinf;
error = norm(H(2:n,2:n));

30
if error < 0.0001
break;
end
end % Newton iterations
susp = sus;
infp = inf;
time(k) = k*dt;
current_time = time(k)
mpcg
error
subplot(1,2,1)
mesh(x,y,inf)
title('infected')
axis([0 1000 0 1000 0 40]);
subplot(1,2,2)
mesh(x,y,sus)
title('susceptible')
axis([0 1000 0 1000 0 50]);
pause
end % time step

coeff_in_laplace.m

cc = 4*ones(n+1); % coefficients in Laplace


ce = ones(n+1);
cw = ones(n+1);
cn = ones(n+1);
cs = ones(n+1);
cw(2,2) = 0.;
cc(2,2) = 2.;
cs(2,2) = 0.;
cs(3:n-1,2) = 0.;
cc(3:n-1,2) = 3.;
cs(n,2) = 0.;
cc(n,2) = 2.;
ce(n,2) = 0.;
ce(n,3:n-1) = 0.;
cc(n,3:n-1) = 3.;
ce(n,n) = 0.;
cc(n,n) = 2.;
cn(n,n) = 0.;
cn(3:n-1,n) =0.;
cc(3:n-1,n) = 3.;
cw(2,n) = 0.;
cc(2,n) = 2.;
cn(2,n) = 0.;
cw(2,3:n-1) = 0.;
cc(2,3:n-1) = 3.;

update_bc.m

31
dinf(2:n,1) = dinf(2:n,2); % update the boundary values
dinf(2:n,n+1) = dinf(2:n,n);
dinf(1,2:n) = dinf(2,2:n);
dinf(n+1,2:n) = dinf(n,2:n);
dsus(2:n,1) = dsus(2:n,2);
dsus(2:n,n+1) = dsus(2:n,n);
dsus(1,2:n) = dsus(2,2:n);
dsus(n+1,2:n) = dsus(n,2:n);
dsus(1,1) = dsus(2,2);
dsus(n+1,n+1) = dsus(n,n);
dsus(1,n+1) = dsus(2,n);
dsus(n+1,1) = dsus(n,2);
dinf(1,1) = dinf(2,2);
dinf(n+1,n+1) = dinf(n,n);
dinf(1,n+1) = dinf(2,n);
dinf(n+1,1) = dinf(n,2);

pcgssor

% This function is the solve step in a Picard method


% PCG subroutine with SSOR preconditioner
function [u , mpcg] = pcgssor(an,as,aw,ae,ac,up,rhs,n)
w = 1.5;
u = up;
r = zeros(n+1);
rhat = zeros(n+1);
q = zeros(n+1);
p = zeros(n+1);
% Use the previous Picard iterate as an initial guess for PCG.
for j = 2:n
for i = 2:n
r(i,j) = rhs(i,j)-(ac(i,j)*up(i,j)...
+ aw(i,j)*up(i-1,j) + ae(i,j)*up(i+1,j)...
+ as(i,j)*up(i,j-1) + an(i,j)*up(i,j+1));
end
end
error = 1. ;
m = 0;
rho = 0.0;
while ((error>.0001)&&(m<200))
m = m+1;
oldrho = rho;
% Execute SSOR preconditioner.
for j = 2:n
for i = 2:n
rhat(i,j) = w*(r(i,j) - aw(i,j)*rhat(i-1,j)...
-as(i,j)*rhat(i,j-1))/ac(i,j);
end
end
for j = 2:n
for i = 2:n
rhat(i,j) = ((2.-w)/w)*ac(i,j)*rhat(i,j);

32
end
end
for j = n:-1:2
for i = n:-1:2
rhat(i,j) = w*(rhat(i,j) - ae(i,j)*rhat(i+1,j)...
-an(i,j)*rhat(i,j+1))/ac(i,j);
end
end
% Find conjugate direction.
rho = sum(sum(r(2:n,2:n).*rhat(2:n,2:n)));
if (m==1)
p = rhat;
else
p = rhat + (rho/oldrho)*p ;
end
% Execute matrix product q = Ap.
for j = 2:n
for i = 2:n
q(i,j) = ac(i,j)*p(i,j) + aw(i,j)*p(i-1,j)...
+ ae(i,j)*p(i+1,j) + as(i,j)*p(i,j-1)...
+ an(i,j)*p(i,j+1);
end
end
% Find steepest descent.
alpha = rho/sum(sum(p.*q));
u = u + alpha*p;
r = r - alpha*q;
error = max(max(abs(r(2:n,2:n))));
end % end while loop
mpcg = m;

3.9. Plot for the Epidemic Dispersed by Fick’s law as well as by the flow in a lake in 2D

33
infected susceptible

40 50

40
30

30
20
20

10
10

0 0
1000 1000
1000 1000
500 500
500 500

0 0 0 0

FIGURE 3.9.1

Discussion of Figure:

Figure 3.8.1 indicates the population versus space for time equal to 0.3. The

infected population had an initial concentration of 48 near y = x= 0 The left

graph is for the infected population, and the peak is moving in the positive x

and y directions. The concentration of the infected population is decreasing for

small values of x and y, because the concentration of the susceptible population

is nearly zero, as indicated in the right graph. This is similar to the one

dimensional model of the previous section.

4. Conclusion:

The SIR model is modified by assuming recover population dies and the modified model

is SI model. We also assume the rate of infection to be dispersed by obeying Fick’s law. We

have used time discretization along with the centered finite difference method of the space

variable to discretize our continuous model. The initial parameter was used to numerically

34
compute our model. Newton’s iteration method and Jacobian matrix , Schur complement was

formulated in our model. In 1D epidemic SI model, S(x,t) and I(x,t) are function of space and

time and are concentrations of susceptible and infected populations. As the time increases, the

infected population and susceptible population decreases along the spaces. When the flow of

stream with vel > 0 is applied along with Fick’s Law in 1D epidemic model, we have found that

the changes in concentration is guided by the velocity. Higher the velocity, the faster the change

in concentration is seen. . In 2D epidemic SI model, S(x,y,t) and I(x,y,t) are function of space

and time and are concentrations of susceptible and infected populations. The result in 2D model

shows that concentration of infected population is decreasing for small values of x and y,

because the concentration of susceptible population is nearly zero. We get similar result in the

case of 2D epidemic model along with flow in a lake for v1> 0 and v2 >0 as that of 2D epidemic

model.

5. References:

[1] Ebola Virus Disease, World Health Organization. Feb 12, 2018.

[2] A. Huppert, G. Katriel. 2013.  Mathematical modelling and prediction in infectious


disease epidemiology. Retrived from
http://www.sciencedirect.com/science/article/pii/S1198743X14630019
[3] http://mat.uab.cat/matmat/PDFv2013/v2013n03.pdf
[4] White, R. E. (Robert E.) Computational mathematics : models, methods, and analysis
with MATLAB and MPI /Robert E. White.

35

You might also like