Download as pdf or txt
Download as pdf or txt
You are on page 1of 52

TECH 517: Strategic System

Dynamics
Understanding Epidemics Using
VensimPLE

For use with Vensim PLE, version 8.1.1


A simple
model that
captures the
dynamics of
an infectious
disease-
Covid 19

2
A simple
model that
captures the
dynamics of
an infectious
disease-
Covid 19

3
Getting Started…

4
Step 1: Open A New Model

5
Step 2: Initial Settings

6
Step 3: Save As “Covid_model_step_1”

Covid_model_step_1

7
Step 4: Load Italy_Covid_Cases.vdfx
Before beginning to develop your model, make sure the COVID data is loaded. Download
«Italy_Covid_Cases.vdfx»if you haven’t already and place the file in the same directory as
your model.

8
----Warning----
• We will compare our simulation data to the actual/historical
data in this file, so variable names need to match EXACTLY

• To access the data, you must use variable names exactly as


specified in this tutorial.

9
Step 5: Population Susceptible to Covid
(stock/level)

VensimPLE then returns an empty text box and


a blinking cursor. Type the variable name
Population Susceptible to Covid and then hit
the return key. If the variable name does not fit
comfortably within the stock, you can re-size
the stock by “grabbing” the circular handle in
the lower right corner (place the mouse at the
corner to allow you to change modes, then
hold down the left mouse button) and moving
the mouse.
10
Step 6: Population Infected with Covid
(stock/level)

11
Step 7: Infection Rate (flow/rate)

First click in center of Then click in center of


this stock this stock 12
Step 8: Infectivity and Contacts Between
Infected and Uninfected Persons. (auxilary)

13
Step 9: Add Causal Arrow

First click on the “Arrow” button to


select the causal arrow tool. Now,
click and release on the variable
Infectivity and then click and
release again on Infection Rate. Do
the same for Contacts Between
Infected and Uninfected Persons
and Infection Rate. Make sure your
causal arrows actually end on the
word Infection Rate. They should
not be attached to the stocks.

14
Step 10: Right-click on Arrow “handle”
to Add Polarity

15
Step 11: Contacts Between Infected
and Uninfected People with sign

16
Step 12: Complete the Rest
of the Model + Label the Loops

17
Use comment tool to add labels

18
Step 13: Specify Equations

Highlighting
indicates that
the equation
for that
variable is
incomplete.

19
Exogeneous and Endogeneous
Variables
• Variables in SD models are classified as either
exogenous or endogenous:
– Exogenous variables are defined independent of other
variables of the model.
• They are functions of time (i.e., Exogenous Variable = f(t)).
• Of course the exogenous variables may be constants, in
which case they are called parameters.
– Endogenous variables are influenced by other
variables in the system
• Endogenous Variable = f(x, y, z), where x, y, z are other
variables in the model

20
Step 14: Define Infection Rate

21
Step 15: Define Population Susceptible
to COVİD

22
Step 16: Define Susceptible Contacts
Step 17: Define Contacts Between Infected and
Uninfected People
Step 18: Define Probability of Contact with Infected
Person

23
Step 19: Define Total Population

Note first that there are no inputs to this parameter, just as we specified in the
diagram, indicating that Total Population will be a constant. But what value should
that constant take? The data suggests that in the relevant portion of Italy the Total
Population was about 240500 persons, so enter that value into the equation box.
Remember to specify units of measure and provide a comment.

24
Step 20: Define Contact Frequency
Step 21: Define Infectivity

Following this example, complete the equations for the other two
parameters, Contact Frequency (Persons/Day) and Infectivity
(dimensionless – ie, enter Dmnl). Contact Frequency represents the
number of contacts between infected and uninfected people every day.
Infectivity represents the probability that each episode of contact results in
transmission of the infection.

25
Step 22: Define Population Infected
with Covid
Be careful !!!
Initial value of Infected with Covid should be 1 because of calculation of probabality of
cantact with infected person

26
Time Out and Run

27
Plotting Results

It should be selected

28
Optional: Permanent Graph
Use: I/O Object or Custom Graph

29
Step 23: Add Variables in the Dataset

Use the “Level” tool to create a new stock


called Cumulative Reported Cases, placing
it a few inches below the current
structure. Then use the “Rate” tool to
create an inflow to that stock. Call this
flow New Reported Cases. As new cases
are reported, the cumulative number of
cases increases.

30
Step 24: Add Infection Rate
(as a shadow variable)

31
Step 25: Add Causal Link and Polarity

32
Step 26: Define New Reported Cases

33
Step 27: Define Cumulative Reported
Cases

34
Step 28: Units Check

35
Step 29: Error!!!

36
Step 30: Redefine Contact Frequency
Alas, you have been intentionally led astray so that the teaching team can demonstrate
how to debug unit errors! The problem is that the equation for Susceptible Contacts is
not dimensionally consistent: The right and left sides of the equation have different
units. Susceptible Contacts is measured in contacts per day, but, in the current
formulation, multiplying the Population Susceptible to Covid by the Contact Frequency
yields a value with units of Persons*Person/Day.

The cause of the problem is that unit of measure for Contact Frequency is incorrect.
The Contact Frequency represents the number of contacts each person makes per day,
not the total number of contacts that occurs in the susceptible population (which is
captured by the variable Susceptible Contacts).

To fix this problem, change the units of measure for contact frequency to be
Persons/Person/Day. (Vensim should equate Person/Persons/People, following
settings in the Model>Settings>Units Equiv menu.) After you do this, run the units
check again. When you are done click OK

37
Step 31: Units Check – A. O. K.

38
Step 32: Rename Case – “Base” and
Run

39
Step 33: Plot Cumulative Reported
Cases

40
Step 34: Try Higher Contact Frequency

To change the contact frequency for this simulation, click on Contact


Frequency and its current value will appear in a box. Type in a larger value
(for instance, double the original value) and hit return. Before simulating,
make sure you change the name of the simulation so that you can compare
the two different runs.

41
Step 35: Change Run Name
Select a name that helps describe the changes you made, for
example, “High Contact Frequency.”

42
Step 36: Displaying Multiple Runs

43
Step 37: Synthesim

44
Step 38: You’re done!

45
Most Frequently Encountered
Questions Regarding the Tutorial

46
How to document “equation listing”
Left hand side of Vensim main screen, click on “DOCUMENT ALL” to copy all Vensim
Equations for your model

47
Most Popular Questions: I can’t open the Italy Covid Case

48
Debugging Units Check Errors
- Default Model Settings - Correct Model Settings

49
Debugging Units Check Errors

Covid
Covid

Covid =
Covid People

Covid People

Covid

Covid
Covid

50
Floating Point Error

• It may be a couple of things. You may have unrealistic values for some of
the parameters, e.g. infectivity. Check your time step, dt ,of the
simulation. Make sure value of probabilities are defined btw 0-1.
– E.g. setting “infectivity” to a start value of 20 (by assuming 20%), instead of 0.2

51
Any Questions or Comments?

TA: Sema Comez, scomez19@ku.edu.tr

Instructor: Dr. Ozge Karanfil, okaranfil@ku.edu.tr

You might also like