Page - 226 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition
Image of the Page - 226 -
Text of the Page - 226 -
226 8 SolvingOrdinaryDifferentialEquations
Let the mathematical functionS(t) count how many individuals, at time t, that
have the possibility to get infected. Here, t may count hours or days, for instance.
These individuals make up a category called susceptibles, labeled as S. Another
category, I, consists of the individuals that are infected. Let I(t) count how many
thereare in categoryI at time t. An individualhaving recoveredfromthe disease is
assumedtogainimmunity.Thereisalsoasmallpossibility thatan infectedwilldie.
Ineither case, the individual is movedfrom the I category to a categorywe call the
removed category, labeled with R. We letR(t) count the number of individuals in
theRcategoryat time t.Thosewhoenter theRcategory,cannotleavethiscategory.
Tosummarize,thespreadingofthisdiseaseisessentiallythedynamicsofmoving
individuals fromthe S to the Iand then to theR category:
We can use mathematics to more precisely describe the exchange between the
categories.The fundamental idea is todescribe the changes that takeplaceduringa
small time interval,denotedbyΔt.
Ourdiseasemodel isoftenreferred toasacompartmentmodel,wherequantities
are shuffled between compartments (here a synonym for categories) according to
some rules. The rules express changes in a small time intervalΔt, and from these
changeswecanletΔtgotozeroandobtainderivatives.Theresultingequationsthen
gofromdifferenceequations(withfiniteΔt) todifferentialequations(Δt→0).
We introduce a uniform mesh in time, tn = nΔt, n = 0,.. .,Nt, and seek S
at the mesh points. The numerical approximation toS at time tn is denoted bySn.
Similarly, we seek the unknown values of I(t) and R(t) at the mesh points and
introduce a similar notation In andRn for the approximations to the exact values
I(tn)andR(tn).
In the time interval Δt we know that some people will be infected, so S will
decrease. We shall soon argue by mathematics that there will be βΔtSI new
infectedindividualsin this timeinterval,whereβ isaparameterreflectinghoweasy
people get infected during a time interval of unit length. If the loss inS isβΔtSI,
wehave that thechange inS is
Sn+1 −Sn=−βΔtSnIn . (8.9)
DividingbyΔt and lettingΔt →0, makes the left-handside approachS′(tn) such
thatweobtainadifferentialequation
S′ =−βSI . (8.10)
The reasoning in going from the difference equation (8.9) to the differential
equation(8.10) followsexactly thestepsexplainedinSect. 8.2.1.
BeforeproceedingwithhowI andRdevelopsin time, letusexplain theformula
βΔtSI.WehaveS susceptiblesandI infectedpeople.ThesecanmakeupSI pairs.
Now, suppose that during a time interval T we measure that m actual pairwise
meetings do occur among n theoretically possible pairings of people from the S
Programming for Computations – Python
A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition
- Title
- Programming for Computations – Python
- Subtitle
- A Gentle Introduction to Numerical Simulations with Python 3.6
- Volume
- Second Edition
- Authors
- Svein Linge
- Hans Petter Langtangen
- Publisher
- Springer Open
- Date
- 2020
- Language
- English
- License
- CC BY 4.0
- ISBN
- 978-3-319-32428-9
- Size
- 17.8 x 25.4 cm
- Pages
- 356
- Keywords
- Programmiersprache, Informatik, programming language, functional, imperative, object-oriented, reflective
- Category
- Informatik