+ All Categories
Home > Documents > Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1...

Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1...

Date post: 11-Aug-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
19
Modeling Addiction with SIR Models and Diusion David Zimmerman MTH 496: Senior Project Advisor: Dr. Shawn Ryan Spring 2018 1
Transcript
Page 1: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

Modeling Addiction with SIR Models and Di↵usion

David Zimmerman

MTH 496: Senior Project

Advisor: Dr. Shawn Ryan

Spring 2018

1

Page 2: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

Abstract

Contents

1 Introduction 2

1.1 SIR Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 Modeling Addiction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.3 Wangari-Stone Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.4 Saturation Treatment Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.5 Calculating Rate of Spread . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 Qualitative Behavior 6

2.1 Boundedness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2 Fixed Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.3 Bifurcations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.4 Bifurcations in Wangari-Stone Model . . . . . . . . . . . . . . . . . . . . . . . . 102.5 Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3 Modeling Spatial Interaction with Di↵usion 11

3.1 Adding A Spatial Element to Our Model . . . . . . . . . . . . . . . . . . . . . . . 113.2 Reaction-Di↵usion Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.3 Numerical Solution to Di↵usion Model . . . . . . . . . . . . . . . . . . . . . . . 123.4 Numerical Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4 Code 16

4.1 Density Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

1 Introduction

1.1 SIR Models

A SIR Model is a compartmental ODE model for the spreading of disease. It ”compartmentalizes”a population into three basic groups: S for those who are susceptible to a disease, I for those whoare infected, R for those who are recovered, and N to represent the population. The transition ratefrom S to I is proportional to the product of the values of each. This is e↵ectively the law of mass

action.8>>>>><>>>>>:

S = ��IS

I = �IS � ⌫IR = ⌫I

It is assumed that each member of the population always transitions from S to I to R. Also,once you are recovered you cannot become susceptible again.

2

Page 3: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

S I R

The most basic SIR model is said to lack vital dynamics, meaning that births and deaths in thepopulation are not considered. This is an example of a conservative system. Mathematically, wewould say that the population N does not change in time and that

dN

dt=

dS

dt+

dI

dt+

dR

dt= 0.

We can easily modify this model to fit a di↵erent situation. What if, for example, once you arerecovered you could become susceptible again? This situation assumes no immunity is obtainedafter infection and is modeled

8>>>>><>>>>>:

S = ��IS + �R

I = �IS � ⌫IR = ⌫I � �R

.

If we allow those who are recovered to become susceptible again our flow chart is cyclic. Thismodified version is often called an SIRS model.

S

IR

We can also consider vital dynamics. If we enforce that the rate at which the population be-comes susceptible (this could be the same the rate of birth) is equal to the mortality rate then wepreserve the conservative nature of the system.

1.2 Modeling Addiction

We can use a compartmental model of ODEs to describe the dynamics of substance addiction.It is reasonable to assume that the law of mass action still applies to the spread of addiction;someone must come into contact with an addict before they assume addiction. Addicts can diefrom overdosing, natural causese, or from other complications involving drug abuse and they canalso recover. An interesting question would be if recovered addicts can become susceptible againor even more susceptible than they were before they became addicted. The model considered in thenext section assumes that once you are recovered you cannot be susceptible again but can resumeheroin use before the end of a treatment period. This situation is described with another modifiedSIR model where vital dynamics are considered.

3

Page 4: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

1.3 Wangari-Stone Model

The heroin epidemic model formulated by Wangari/Stone is considered here without alteration.The population is separated into four classes: S , susceptibles, U1, heroin users not receiving treat-ment, U2, heroin uses receiving treatment, and U3, those successfully treated from heroin use. Thefollowing is assumed:

1. Individuals in all classes freely interact with one another

2. Addicts in treatment may or may not still be using heroin

3. Herion users in treatment relapse to heroin users not in treatment due to a decision to self-terminate treatment

4. Heroin users are separated from the population (e.g., treatment facility) and do not a↵ectsusceptibles.

Below is our model reflecting these assumptions:8>>>>>>><>>>>>>>:

S = ⇤ � �U1S � µSU1 = �U1S + ⇢U2 � (µ + �1 + ⇠)U1 � T (U1)U2 = T (U1) � (⇢ + � + �2 + µ)U2

U3 = �U2 + ⇠U1 � µU3

(1)

The parameters and key quantities of system (1) are defined in the following table

Parameter Description⇤ The rate at which individuals in a general population enter the system via the

susceptible population (e.g., Births, coming of age)� Contact rate between susceptibles and heroin users not receving treatmentµ Death rate due to natural causes⇢ Rate at which those undergoing treatment relapse to heroin use⇠ Self-cure rate. Rate at which users recover without receiving treatment�1 Heroin related death rate of heroin users not in treatment�2 Heroin related death rate of heroin users in treatment� Rate at which heroin users in treatment are successfully detoxified and cured

from heroin use↵ Rate at which heroin users are treated! The extent of saturation of heroin users within the community

4

Page 5: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

Figure 1: Wangari-Stone Model

1.4 Saturation Treatment Function

We have not yet defined the function T (U1). This is the treatment function, or the rate at whichusers receive treatment.

T (U1) ⌘ ↵U1

1 + !U1

and we call this the saturation treatment function. This function is formulated by borrowingan idea from Michaelis-Menten kinetics. The rate that users are treated should depend on theavailability of treatment and that rate should decrease as more resources are in use. When U1 issmall, treatment is approximately linear. T (U1) ⇡ ↵U1. When U1 >> 1, T (U1) ⇡ ↵

! , indicatingthat treatment centers are at capacity and the rate of treatment does not increase with the numberof drug users. This feature is called saturation.

1.5 Calculating Rate of Spread

Epidemiologists denote the number of secondary infections brought on by a single infective personby R0 and call this the Basic Reproduction Number. In this context, we will interpret this as theexpected value of secondary individuals infected by a single infected person. If this number is lessthan one, meaning you are unlikely to infect even one person, the disease (or addiction in our case)in the population is eradicated. Otherwise, the disease will spread. We can begin to calculate thisnumber by observing that the average time an individual uses heroin is given by the formula

5

Page 6: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

T0 =1

µ + �1 + ⇠ + ↵

The parameters µ, �1, ⇠, and ↵ all describe rates at which one exits the phase of untreated heroin useand have units 1

time. Hence this formula is the harmonic mean of these rates. Next, the probability

of surviving this period and receiving treatment is given by T1 = ↵T0. The probability of survivingthe heroin users in treatment phase and relapsing to heroin use is given by the rate at which heroinusers stop receiving treatment (the harmonic mean of all the coe�cients describing rates whichmembers of the population cease receiving treatment) multiplied by the rate of relapse, ⇢.

T2 =⇢

⇢ + � + �2 + µ

Now, we can observe that total average time spent by users not in treatment on multiple passes isgiven by

T = T0(1 + T1 · T2 + (T1 · T2)2 + (T1 · T2)3 + ...)

which is a geometric series with ratio T1 · T2 and T1 · T2 < 1 since all parameters of (1) are non-negative. This series is convergent and its sum can be calculated by the usual formula a

1�rwhere

a = T0. After some simplification this time can be written as

T =(⇢ + � + �2 + µ)

(µ + �1 + ⇠)(⇢ + � + �2 + µ) + ↵(� + �2 + µ)bfNext we multiply by the contact rate � and average rate of recruitment ⇤/µ and we finally yield

R0 =�⇤(⇢ + � + �2 + µ)

µ(µ + �1 + ⇠)(⇢ + � + �2 + µ) + µ↵(� + �2 + µ). (2)

2 Qualitative Behavior

Since (1) is a non-linear system we are restricted in the amount of quantitative information we canfind and instead must focus on the qualitative behavior as parameters are varied.

2.1 Boundedness

Proposition 2.1. The solutions of (1) are biologically feasible and are bounded from above and

below:

(a) Given S (0) > 0, U1(0) > 0, U2(0) > 0, U3(0) > 0, the trajectories (S (t),U1(t),U2(t),U3(t))will remain positive for all time t.

(b) If N(0) ⇤µ then N(t) ⇤µ for all time t where N = S + U1 + U2 + U3.

Proof. We will first prove (a). The solution to Equation 1 of (1) can be found by use of theintegrating factor technique:

S = S (0) exph� µt �

Z�U1dt

i+ ⇤ exp

h� µt �

Z�U1dt

i Z s

0exphµs +

Z�U1ds

ids � 0

6

Page 7: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

U2 and U3 can be found in a similar way:8>><>>:

U2 = U2(0)e�(⇢+�+�2+µ)t +R

t

0 T (U1(s))e(⇢+�+�2+µ)(s�t)ds

U3 = U3(0)e�µt + e�µtR

t

0 (�U2(s) + ⇠U1(s))ds

Notice that if U1 � 0, Then U2 and U3 will be greater than 0. If U1(0) > 0 and there exists a time t

where U(t) < 0 then there must exist some time interval [0, t0) where U1(t) > 0 and U1(t0) = 0. IfU1(t) < 0 for t > t0 then U1(t0) 0. However, U1(t0) = ⇢U2(t0) > 0, so t0 does not exist. Thus, thetrajectories are strictly positive for all time t.

For (b) we observe that if we add all equations from (1) we get N = ⇤�µN��1U1��2U2 < ⇤�µNsince �1, �2, U1, and U2 are non-negative. If we solve the inequality N < ⇤ � µN we get thatN < N(0)e�µt + ⇤µ (1 � e

�µt). It is clear that if N(0) < ⇤µ then N(t) < ⇤

µ for all t. Moreover, ifN(0) > ⇤µ then N(t) will enter the region (0, ⇤µ ) in finite time. ⇤

2.2 Fixed Points

System (1) has fixed points that refer to addiction eradiction or sustained addiction over time. Weobtain these points by setting the equations of (1) to 0,

S? =

�U?1 + µ,

U?2 =

↵U?1

(⇢ + � + �2 + µ)(1 + !U?1 )

, (3)

U?3 =�↵U

?1 + (⇢ + � + �2 + µ)(1 + !U

?1 )U?1

µ(⇢ + � + �2 + µ)(1 + !U?1 )

.

If we plug these in to equation 2 of (1) we get the expression for U?1

f (U?1 ) = AU?1

3+ BU

?1

2+CU

?1

where

A = (µ + �1 + ⇠)(⇢ + � + �2 + µ)�!,B = (µ + �1 + ⇠)(⇢ + � + �2 + µ)�

+ µ!(µ + �1 + ⇠)(⇢ + � + �2 + µ) + ↵(� + �2 + µ)� (4)� �⇤!(⇢ + � + �2 + µ),

C = [(µ + �1 + ⇠)(⇢ + � + �2 + µ)µ + ↵µ(� + �2 + µ)](1 � R0).

U?1 = 0 is always a fixed point which represents addiction eradication. To find other fixed points

we can consider the equation

7

Page 8: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

f (U?1 ) = AU?1

2+ BU

?1 +C = 0 (5)

which has roots

U?1

1,2=�B ±

pB2 � 4AC

2A. (6)

Notice that if ! = 0,

U?1 =

�C

(µ + �1 + ⇠)(⇢ + � + �2 + µ)� + ↵(� + �2 + µ)�(7)

which is only positive when R0 > 1. For ! > 0, there are four interesting cases for U?1 :

(i) B < 0 and

(a) C = 0 (R0 = 1) or

(b) B2 � 4AC = 0.

Both of these instances result in a root at U?1 = 0 and a root at �B

2Awhich is a unique positive

endemic equilibrium point.

(ii) C < 0 (R0 > 1) and B < 0. In this casep

B2 � 4AC > B, so there exists a biologicallyunfeasible negative equilibrium, a root at U

?1 = 0 and a positive endemic equilibrium.

(iii) C > 0, B < 0, and B2 � 4AC > 0. In this case

pB2 � 4AC < B, so there are two positive

endemic equilbria.

(iv) B > 0 and either

(a) C > 0 or

(b) B2 < 4AC.

This cases has no biologically feasible equilibrium points.

8

Page 9: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

Figure 2: Cases (i)-(iv). Only the region to the right of the y-axis represents biologically feasiblesolutions to (1).

2.3 Bifurcations

We can define a bifurcation of a dynamical system such as (1) as a smooth change in parametersthat cause the system to suddenly change its qualitative or topological behavior. A simple exampleof this is the one dimensional system x = x

2 + r

Figure 3: The three behaviors of x2 + r as r is varied

This is an example of a saddle-node bifurcation.

9

Page 10: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

Definition 1 (Saddle-Node Bifurcation). A saddle-node bifurcation occurs when, as a parameter

is varied,two fixed points approach one another, collide, and mutually annihilate [6].

2.4 Bifurcations in Wangari-Stone Model

Our model has several bifurcation points as the composite parameters A, B, and C are varied. Thisresults in the six di↵erent behaviors shown in Figure 2. It is straightforward to see that one of thesepoints is when B < 0 and C = 0 (R0 = 1). As R0 goes from being less than one to greater than one.The behavior of U1 transitions from case (iii) to case (i.a) to case (ii). This is commonly called abackwards bifurcation and its behavior resembles that of a saddle-node bifurcation.

It is preferable to think about this change in terms of the original model parameters. To do thisfor a system with multiple parameters we must choose a parameter to vary while holding othersconstant. Notice from (5) that when R0 = 1

(µ + �1 + ⇠)(⇢ + � + �2 + µ)µ + ↵µ(µ + �2 + �) = (⇢ + � + �2 + µ)�⇤

and when B < 0

�⇤!(⇢ + � + �2 + µ) > (µ + �1 + ⇠)(⇢ + � + �2 + µ)�+ µ!(µ + �1 + ⇠)(⇢ + � + �2 + µ)+ ↵(� + �2 + µ)�,

which implies

! >(� + µ!)(µ + �1 + ⇠)(⇢ + � + �2 + µ) + ↵(� + �2 + µ)�

⇤�(⇢ + � + �2 + µ).

Together with the condition on C give us a critical value for !:

! >(� + µ!)(µ + �1 + ⇠)(⇢ + � + �2 + µ) + ↵(� + �2 + µ)�

µ↵(� + �2 + µ)

=(µ + �1 + ⇠)(⇢ + � + �2 + µ)� + ↵�(� + �2 + µ)

µ↵(� + �2 + µ)(8)

:= !C

This condition is necessary for the backwards bifurcation at R0 = 1 to occur. Note that thisparameter accounts for the extent of saturation of heroin users, so we can say that when this exceedsa certain threshold we will observe this bifurcation.

2.5 Stability

Let’s consider the heroin-free equilibrium (HFE). It is hard to compute and analyze the eigenval-ues of the Jacobian of (1). It would make physical sense for the stability of the HFE to depend

10

Page 11: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

on R0. In particular it would make sense that this point would be stable for R0 < 1 and unstableotherwise. However, R0 is independent of our bifurcation parameter ! so this is only the case when! < !c. If ! ⇡ 0 our saturated treatment function approximates a linear treatment function andheroin users are treated at a near constant rate making a endemic less likely.

Theorem 2.1. The HFE is globally asymptotically stable i↵ R0 < 1 and ! < !c, where R0 is given

by (2), and unstable otherwise.

A rigorous proof is given in [1]. When ! > !c it is not so straightforward. Case (iii) shows thattwo positive endemic equilibrium points can exist when R0 < 1.

Figure 4: R0 = 0.8006510484303846, ! = 0.3, !c = 0.11562162162162161

The above graph suggests stability of one of the endemic equilibrium points given in (6). Theimplication of this is that it is not enough to reduce R0 below one to eradicate addiction in apopulation. Instead, R0 must be reduced further to some value we denote R

C

0 . A full derivation ofthis is provided in [8].

3 Modeling Spatial Interaction with Di↵usion

3.1 Adding A Spatial Element to Our Model

So far our model has applied only to closed populations. Lets consider each population a subsetof a larger population. Then it becomes natural to wonder how each population interacts with

11

Page 12: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

another geographically given the freedom to cross spatial boundaries. Some questions we mightask ourselves are:

1. Do heroin users immigrate to regions where there are other heroin users?

2. Do those that are receiving treatment or those who are recovered move out of regions wherethere are high concentrations of heroin users?

3. If those in treatment move to a region where there is a low concentration of heroin users doesit decrease the chance of relapse?

4. Instead of the above, are movements in and out of regions completely random? Does entropyplay a role?

We investigate at least a few of the questions in subsequent sections and how we might modelthese phenomena.

3.2 Reaction-Di↵usion Model

It seems plausible that heroin users cluster together. Drug users tend to come from low incomebackgrounds which historically have higher concentrations of drug users. If a heroin user is amonga low-income population it is unlikely for them to leave that population. If we make these as-sumptions then we can model this deterministic process by appending a term to (1) that satisfiesa two-dimensional heat equation with Neumann boundary conditions. This requires that the re-gion in which we solve the problem be a simply connected region in R2 and our boundary to bepiece-wise smooth.

There is a subtlety here: If our region must be simply connected then how can we apply thismodel to places like Hawaii or Japan whose citizens freely travel across a network of islands? Orthose who live in Manhattan and regularly commute to other areas in New York? It might possibleto include travel routes as a part of our domain thus eliminating this problem. For now, we willignore it.

Lets consider only that regions with large concentrations of heroin users are attractors for heroinusers in other regions. Our spatial model:

8>>>>>>>><>>>>>>>>:

S = ⇤ � �U1S � µSU1 = �U1S + ⇢U2 � (µ + �1 + ⇠)U1 � T (U1) � k

@2U1@x2 � k

@2U1@y2

U2 = T (U1) � (⇢ + � + �2 + µ)U2

U3 = �U2 + ⇠U1 � µU3

(9)

where k, our di↵usion constant, is non-negative.

3.3 Numerical Solution to Di↵usion Model

This section will explore how we might numerically solve (8). For the sake of simplicity a rect-angular domain is chosen which contains all (and only) sub-populations of interest, is simplyconnected and piece-wise smooth. We will call this region ⌦. The strategy will be to solve (1) for

12

Page 13: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

each sub-population using any suitable numerical method (Runge-Kutta, Forward-Euler, etc) foreach sub-population, and then solve the di↵usion equation at each sub-population using forwardEuler where the derivatives at each point will be approximated by finite di↵erence methods.

We do not wish for members of any population to leave the domain, so we must enforce thatthe outward normal derivative at the boundary points is zero.

Figure 5: Boundary Diagram

A full system to solve the heat equation is given by:8>>>>>>>>>>>>>>>>>><>>>>>>>>>>>>>>>>>>:

@U1

@t= �k

@2U1

@x2 � k@2

U1

@y2

U1(x, y, 0) = A, an M ⇥ N matrix containing [S (0),U1(0),U2(0),U3(0)]T

i j

for 0 i M, 0 j N

@U1(0, y, t)@t

=@U1(N, y, t)@t

= 0

@U1(x, 0, t)@t

=@U1(x,M, t)@t

= 0

(10)

The di↵usion equation can be solved in the interior of A by discretizing the time domain and usingthe second order central di↵erence formula for the second derivative

�k@2

U1

@x2 � k@2

U1

@y2 ⇡ �kU1(x � �x, y) � 2U1(x, y) + U1(x + �x, y)

(�x)2

� kU1(x, y � �y) � 2U1(x, y) + U1(x, y + �y)

(�y)2

13

Page 14: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

where �x and �y are the horizontal and vertical distances between sub-regions in ⌦ and are rep-resented by a single horizontal or vertical position in A. If we use forward Euler to solve (8) anddenote system (1) by f the solution of the interior points in A is given by

~ai j

,new= ~ai j + �t f (~ai j)

� k�t

(�x)2 (~ai�1, j � 2~ai, j + ~ai+1, j) �k�t

(�y)2 (~ai, j�1 � 2~ai, j + ~ai, j+1) (11)

To guarantee that the solution will be stable over multiple time steps k�t

(�x)2 and k�t

(�y)2 must satisfythe Courant-Friedrichs-Lewy condition

k�t

(�xi)2 <12

.

Since the boundaries are defined piece-wise, we must enforce each boundary condition sepa-rately and we will have to be cautious with the corners of A since they lie on two boundaries. Allthe boundaries must satisfy the heat equation and have an outward derivative of zero. To do thiswe must use backwards/forwards di↵erence approximations using the new values from the interiorof A and set them equal to zero. The second order forward and backward di↵erence formulas aregiven by

Forward Di↵erence:@U1

@xi

=3U1(xi) � 4U1(xi + �xi) + U1(xi + 2�xi)

2�xi

Backward Di↵erence:@U1

@xi

=�3U1(xi) + 4U1(xi � �xi) � U1(xi � 2�xi)

2�xi

.

We can set these equations equal to zero and solve for U1(xi) to compute the boundaries of A

excluding the corners:

Left Boundary: ~a ,new

i,1 =43~a ,new

i,2 � 13~a ,new

i,3

Right Boundary: ~a ,new

i,N =43~a new

i,N�1 �13~a new

i,N�2

Top Boundary: ~a new

1, j =43~a new

2, j �13~a new

3, j

Bottom Boundary: ~a new

M, j =43~a new

M�1, j �13~a new

M�2, j

Since the corners are on two boundaries, we must enforce that the directional derivatives are equalto zero. That is,

14

Page 15: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

Top Left Corner: rU1(0, 0) ·"�11

#= 0

Top Right Corner: rU1(N, 0) ·"11

#= 0

Bottom Left Corner: rU1(0,M) ·"�1�1

#= 0

Bottom Right Corner: rU1(N,M) ·"

1�1

#= 0

The top right and bottom left corner can be computed using the forward and backward di↵er-ence methods previously described since each element in the direction vector has the same sign.The other two corners pose a problem as, when this method is employed, the point we are interestedin end up canceling out. For the top left corner we can deal with this by assuming

@U1(0, 0)@x

⇡ @U1(�x, 0)@x

.

Similarly for the bottom right corner we assume

@U1(N,M)@x

⇡ @U1(N � �x,M)@x

.

Now we can compute the directional derivative by using a first order central di↵erence formulafor the derivative of x

@U1

@xi

=U1(xi � �xi) � U1(xi + �xi)

2�xi

and a second order central di↵erence for the derivative of y. Now we can state the corners of A as

Top Left Corner: ~a new

1,1 =�x(4~a new

2,1 � ~a new

3,1 ) � �y~a new

1,3

3�x � �y

Top Right Corner: ~a new

1,N =4(�y~a new

1,N�1 + �x~a new

2,N ) � (�x~a new

1,N�2 + �y~a new

3,N )3(�x + �y)

Bottom Left Corner: ~a new

M,1 =4(�y~a new

M,2 + �x~a new

M�1,1) � (�x~a new

M�2,1 + �y~a new

M,3 )3(�x + �y)

Bottom Right Corner: ~a new

M.N =�x(4~a new

M�1,N � ~a new

M�2,N) + �y~a new

M,N�2

3�x + �y

3.4 Numerical Example

Matplotlib has a built in function for turning matrices into color maps. This is a nice way tovisualize how Equation 2 of (8) evolves in time.

15

Page 16: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

Figure 6: Left: Colormap of initial conditions. Right: Forwad 10 units of time.

4 Code

All numerical computations and simulations where done using Python with the Numpy and Mat-plotlib packages.

4.1 Density Map

import matplotlib.pyplot as pltimport numpy as np

Lambda=1.6; beta=0.001; delta_1=0.002; delta_2=0.001; mu=0.01; alpha=0.9;

rhe=0.467; sigma=0.1; xi=0.015; omega=0.11,!

A = np.zeros([10,10,4])

for i in range(A.shape[0]):for j in range(A.shape[1]):

A[i,j,0] = 100 + 5*np.random.normal(0,1)

A[i,j,1] = 20 + 2.5*np.random.normal(0,1)

A[i,j,2] = 15 + np.random.normal(0,1)

A[i,j,3] = 10 + np.random.normal(0,1)

def Heat_Map(A, dx, dy, D):def f(x_vec):

S, U1, U2, U3 = x_vec

return [Lambda - beta*U1*S - mu*S, beta*U1*S + rho*U2 -(mu + delta_1 + xi)*U1 - alpha*U1/(1 + omega*U1),

alpha*U1/(1 + omega*U1) -,!

(rho + sigma + delta_2 + mu)*U2, sigma*U2 + xi*U1 -

mu*U3],!

M = A.shape[0]

N = A.shape[1]

16

Page 17: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

A_new = np.zeros([M, N, 4])

A_2d = np.zeros([M, N])

A_diff = np.zeros([M, N, 4])

time_steps = 100

time_length = 10

dt = time_length/time_steps

rx = dt*D/dx**2

ry = dt*D/dy**2

for h in range(time_steps):for i in range(M):

for j in range(N):eval = f(A[i,j])

for k in range(4):A_new[i,j,k] = A[i,j,k] + dt*eval[k]

for i in range(1,M-1):for j in range(1,N-1):

A_diff[i,j,1] = A_new[i,j,1] - rx*(A_new[i-1,j,1]

-2*A_new[i,j,1] + A_new[i+1,j,1]) - ry*(A_new[i,j-1,1]

-2*A_new[i,j,1] + A_new[i,j+1,1])

,!

,!

A_diff[i,j,0] = A_new[i,j,0]

A_diff[i,j,2] = A_new[i,j,2]

A_diff[i,j,3] = A_new[i,j,3]

#### BOUNDARY CONDITIONS ####

for i in range(1,M-1):#Left column boundary condition

A_diff[i,0,1] = (4/3)*A_diff[i,1,1] - (1/3)*A_diff[i,2,1]

#Right column boundary condition

A_diff[i,N-1,1] = (4/3)*A_diff[i,N-2,1] -

(1/3)*A_diff[i,N-3,1],!

for j in range(1,N-1):#Top row boundary condition

A_diff[0,j,1] = (4/3)*A_diff[1,j,1] - (1/3)*A_diff[2,j,1]

#Bottom row boundary condition

A_diff[M-1,j,1] = (4/3)*A_diff[M-2,j,1] -

(1/3)*A_diff[M-3,j,1],!

#Corner boundary conditions

for k in range(4):A_diff[0,0,k] = (dx*(4*A_diff[1,0,k] - A_diff[2,0,k]) -

dy*A_diff[0,2,k])/(3*dx - dy),!

A_diff[0,N-1,k] = (4*(dy*A_diff[0,N-2,k] - dx*A_diff[1,N-1,k])

- (dx*A_diff[0,N-3,k] + dy*A_diff[2,N-1,k]))/(3*(dx + dy)),!

A_diff[M-1,0,k] = (4*(dy*A_diff[M-1,1,k] - dx*A_diff[M-2,0,k])

- (dx*A_diff[M-3,0,k] + dy*A_diff[M-1,2,k]))/(3*(dx + dy)),!

A_diff[M-1,N-1,k] = (dx*(4*A_diff[M-2,N-1,k] -

A_diff[M-3,N-1,k]) + dy*A_diff[M-1,N-3,k])/(3*dx + dy),!

17

Page 18: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

A = A_diff

for i in range(M):for j in range(N):

A_2d[i,j] = A_diff[i,j,1]

plt.imshow(A_2d, cmap = 'hot', interpolation = 'bilinear')plt.colorbar()

Heat_Map(A, 1, 1, 0.01)

18

Page 19: Modeling Addiction with SIR Models and Di usion David ... · 1S µS U˙ 1 = 1S +⇢ 2 (µ 1 ⇠ ) 1 T 1 U˙ 2= T (1)⇢ +µ U˙ 3 = U 2 +⇠U 1 µU 3 (1) The parameters and key quantities

References

[1] P. van den Driessche and James Watmough. “Reproduction numbers and sub-threshold en-demic equilibria for compartmental models of disease transmission”. In: Math. Biosci. 180(2002). John A. Jacquez memorial volume, pp. 29–48. issn: 0025-5564. doi: 10 . 1016 /S0025-5564(02)00108-6. url: https://doi.org/10.1016/S0025-5564(02)00108-6.

[2] Leah Edelstein-Keshet. “4. An Introduction to Continuous Models”. In: Mathematical Mod-

els in Biology. Chap. 4, pp. 115–163.

[3] Leah Edelstein-Keshet. “6. Applications of Continuous Models to Population Dynamics”. In:Mathematical Models in Biology. Chap. 6, pp. 210–270.

[4] Leah Edelstein-Keshet. “9. An Introduction to Partial Di↵erential Equations and Di↵usion inBiological Settings”. In: Mathematical Models in Biology. Chap. 9, pp. 383–435.

[5] Maia Martcheva. “2. Introduction to Epidemic Modeling”. In: An Introduction to Mathemat-

ical Epidemiology. Springer Publishing Company, 2015. Chap. 2.

[6] Stephen Strogatz. Nonlinear Dynamics And Chaos: With Applications To Physics, Biology,

Chemistry, And Engineering (Studies in Nonlinearity). Westview Press, 2001.

[7] Jinliang Wang et al. “Qualitative and bifurcation analysis using an SIR model with a saturatedtreatment function”. In: Math. Comput. Modelling 55.3-4 (2012), pp. 710–722. issn: 0895-7177. doi: 10.1016/j.mcm.2011.08.045. url: https://doi.org/10.1016/j.mcm.2011.08.045.

[8] Isaac Mwangi Wangari and Lewi Stone. “Analysis of a heroin epidemic model with saturatedtreatment function”. In: J. Appl. Math. (2017), Art. ID 1953036, 21. issn: 1110-757X. doi:10.1155/2017/1953036. url: https://doi.org/10.1155/2017/1953036.

[9] Xu Zhang and Xianning Liu. “Backward bifurcation of an epidemic model with saturatedtreatment function”. In: J. Math. Anal. Appl. 348.1 (2008), pp. 433–443. issn: 0022-247X.doi: 10.1016/j.jmaa.2008.07.042. url: https://doi.org/10.1016/j.jmaa.2008.07.042.

19


Recommended