0% found this document useful (0 votes)
15 views

Vensim-Tutorial Stepbystep v.1

This document provides a tutorial for building a simple epidemiological model in Vensim PLE to simulate the spread of COVID-19. It walks through 34 steps to construct the basic stock and flow structure and equations. Key aspects covered include defining population groups as stocks, infection rates as flows, parameters like contact rates and infectivity, adding the model equations, exploring different scenarios by adjusting parameters, and comparing model output to real case data. Troubleshooting tips are provided for common issues like units check errors. The overall aim is to help users understand and apply system dynamics modeling to infectious disease transmission.

Uploaded by

Mark Dela
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Vensim-Tutorial Stepbystep v.1

This document provides a tutorial for building a simple epidemiological model in Vensim PLE to simulate the spread of COVID-19. It walks through 34 steps to construct the basic stock and flow structure and equations. Key aspects covered include defining population groups as stocks, infection rates as flows, parameters like contact rates and infectivity, adding the model equations, exploring different scenarios by adjusting parameters, and comparing model output to real case data. Troubleshooting tips are provided for common issues like units check errors. The overall aim is to help users understand and apply system dynamics modeling to infectious disease transmission.

Uploaded by

Mark Dela
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Understanding Epidemics Using

VensimPLE

For use with Vensim PLE, version 9.0.0


A simple model that captures the dynamics
of an infectious disease- Covid 19
A simple model that captures the dynamics
of an infectious disease- Covid 19
Getting Started…
Step 1: Open A New Model
Step 2: Initial Settings
Step 3: Save As “Covid_model_step_1”
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.
----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.
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.
Step 6: Population Infected with Covid
(stock/level)
Step 7: Infection Rate (flow/rate)

First click in center of Then click in center of


this stock this stock
Step 8: Infectivity and Contacts Between
Infected and Uninfected Persons. (auxilary)
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.
Step 10: Right-click on Arrow “handle”
to Add Polarity
Step 11: Contacts Between Infected
and Uninfected People with sign
Step 12: Complete the Rest
of the Model + Label the Loops
Use comment tool to add labels
Step 13: Specify Equations

Highlighting
indicates that
the equation
for that
variable is
incomplete.
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
Step 14: Define Infection Rate
Step 15: Define Population Susceptible
to COVİD
Step 16: Define Susceptible Contacts
Step 17: Define Contacts Between Infected and
Uninfected People
Step 18: Define Probability of Contact with Infected
Person
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.
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.
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
Time Out and Run
Plotting Results

It should be
selected
Optional: Permanent Graph
Use: I/O Object or Custom Graph
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.
Step 24: Add Infection Rate
(as a shadow variable)
Step 25: Add Causal Link and Polarity
Step 26: Define New Reported Cases
Step 27: Define Cumulative Reported Cases
Step 28: Units Check
Step 29: Error!!!
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
Step 31: Units Check – A. O. K.
Step 32: Rename Case – “Base” and
Run
Step 33: Plot Cumulative Reported Cases
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.
Step 35: Change Run Name
Select a name that helps describe the changes you made, for
example, “High Contact Frequency.”
Step 36: Displaying Multiple Runs
Step 37: Synthesim
Step 38: You’re done!
Most Frequently Encountered
Questions Regarding the Tutorial
How to document “equation listing”
Left hand side of Vensim
main screen, click on
“DOCUMENT ALL” to copy
all Vensim
Equations for your model
Most Popular Questions: I can’t open the Italy Covid Case
Debugging Units Check Errors
- Default Model Settings - Correct Model Settings
Debugging Units Check Errors

Covid
Covid

Covid =
Covid People

Covid People

Covid

Covid
Covid
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

You might also like