Seite - 122 - in Programming for Computations – Python - A Gentle Introduction to Numerical Simulations with Python
Bild der Seite - 122 -
Text der Seite - 122 -
122 4 SolvingOrdinaryDifferentialEquations
Thenew,extendeddifferential equationswith theV quantitybecome
S0 D ˇSI C R pS; (4.36)
V 0 DpS; (4.37)
I 0 DˇSI I; (4.38)
R0 D I R: (4.39)
Weshall refer to thismodelas theSIRVmodel.
The new equation forV 0 poses no difficulties when it comes to the numerical
method. InaForwardEuler schemewesimplyaddanupdate
VnC1 DVnCp tSn :
Theprogramneeds tostoreV.t/ inanadditionalarrayV, andtheplottingcommand
must be extendedwithmore arguments to plot V versus t aswell. The complete
code is found in thefileSIRV1.py.
Using p D 0:0005 andp D 0:0001 as values for the vaccine efficiency pa-
rameter, the effect of vaccination is seen in Fig. 4.13 (other parameters are as in
Fig. 4.11).
Fig.4.13 Theeffect ofvaccination:pD0:0005 (left)andpD0:0001 (right)
Programming for Computations – Python
A Gentle Introduction to Numerical Simulations with Python
- Titel
- Programming for Computations – Python
- Untertitel
- A Gentle Introduction to Numerical Simulations with Python
- Autoren
- Svein Linge
- Hans Petter Langtangen
- Verlag
- Springer Open
- Datum
- 2016
- Sprache
- englisch
- Lizenz
- CC BY-NC 4.0
- ISBN
- 978-3-319-32428-9
- Abmessungen
- 17.8 x 25.4 cm
- Seiten
- 248
- Schlagwörter
- Programmiersprache, Informatik, programming language, functional, imperative, object-oriented, reflective
- Kategorie
- Informatik