Lab 2 - Model a Complex System From Scratch
Lab 2 - Model a Complex System From Scratch
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 1
Let's protect the environment
Lecture notes are subject to change before
the class for further improvement
(Ver. 7 March 2025)
Acknowledgement
The preparation of this module has been made possible by the support from IE2141
teaching team, and the past teaching materials developed by A/Prof. Aaron Chia.
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 2
Learning Outcome
▪ With a system dynamics model on Epidemics, practicing on
modelling a complex system from scratch, understanding each
component’s roles and impact, and conducting experiment with
various coping strategies.
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 3
Introduction – Epidemics
An epidemic is the rapid spread of disease to a large number of people in a given
population within a short period of time. An epidemic may be restricted to one
location; however, if it spreads to other countries or continents and affects a
substantial number of people, it may be termed a pandemic. The declaration of an
epidemic usually requires a good understanding of a baseline rate of incidence;
epidemics for certain diseases, such as influenza, are defined as reaching some
defined increase in incidence above this baseline.
Epidemics are in the news, from AIDS to Ebola, SARS, etc. They are important
dynamics to understand, both in how people should behave individually to protect
themselves from being infected, and in understanding which policies might be
enacted to protect the whole population.
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 4
Introduction – Epidemics
Coronavirus disease (COVID-19) is an infectious disease caused by a newly discovered
coronavirus. Most people infected with the COVID-19 virus will experience mild to
moderate respiratory illness and recover without requiring special treatment. Older people,
and those with underlying medical problems like cardiovascular disease, diabetes, chronic
respiratory disease, and cancer are more likely to develop serious illness.
Suppose you are a member of a team of scientists who are studying the rapid spread of a
major disease. You know how many people have the disease and you also know how the
disease is spread. Now you are interested in studying future likely scenarios and the
measures needed.
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 5
Part 1 – Basic Epidemics Model
Lab Assignment 2 – Question 1-5
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 6
Part 1 – Basic Epidemics Model
▪ The epidemics scenario is described as follows.
1) We have in total 1,000,000 people, and only 1 person has been infected
in the beginning (namely we have 999,999 healthy people at the
beginning);
2) Each infected person comes into contact with 10 other people each day;
3) Each time an infected person comes into contact with an uninfected
person, there is a 5% chance the disease will be transmitted.
▪ With demonstration from the lab TAs, build the system dynamics
model on the next slide.
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 7
Part 1 – Basic Epidemics Model
Model setting: 60 Days with DT = 1/4
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 8
Part 1 – Basic Epidemics Model
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 9
Part 1 – Basic Epidemics Model
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 10
Part 1 – Basic Epidemics Model
▪ Pay attention to the following equation:
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 11
Part 1 – Basic Epidemics Model – Full Model
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 12
Part 2 – Modelling Recovery
Lab Assignment 2 – Question 6-8
**Remember to save your Part 1 Model as a separate file!
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 13
Part 2 – Modelling Recovery
▪ Consider an Expected Time to Recover as 7 Days, with
demonstration from the lab TAs, extend the system dynamics model
as follows
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 14
Part 3 – Modelling Quarantine
Lab Assignment 2 – Question 9-10
**Remember to save your Part 2 Model as a separate file!
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 15
Part 3 – Modelling Quarantine
▪ Consider a PCR Test can be used to detect an infected person.
Those who are tested positive will be put on quarantine until recovery.
▪ The Number of Contact will be effectively reduced for the persons on
quarantine (i.e., infected and tested population).
▪ With demonstration from the lab TAs, extend the system dynamics
model as on the next slide.
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 16
Part 3 – Modelling Quarantine
(2) Calculate the
Recovery Rate with a
Model Setting: 365 days material delay
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 18
Part 3 – Modelling Quarantine
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 19
Part 3 – Modelling Quarantine
(3) Model “Recover” as two delay flows
Here we assume the “Recovery Rates” for both tested and untested
are the same, which is not true once the order of the delay > 1 (with
memory of being tested), although the same rate can be a good
approximation.
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 20
Part 3 – Modelling Quarantine
(4) Update infection rate calculation
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 21
Submission – Lab Assignment 2
▪ Follow the instructions in each part, build and run the SD Model,
based on initial values and equations mentioned in the slides;
▪ This assignment will due 2 days after the lab session. You are
encouraged to complete this in class.
Run the simulation for 60 Days with DT = 1/4, and observe the quantities of (1)
Uninfected Population, (2) Infected Population, (3) New Infections, and (4) Infection
Rate. Map them to the graphs as shown below. (10 marks)
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 23
Lab Assignment #2
Question 2 – Refer to Part 1 Model
Consider the transition from Uninfected Population to Infected Population as a Time
Delay, which of the following best described the type of the delay? (10 marks)
A. First-order material delay
B. Higher-order material delay
C. First-order information delay
D. Higher-order information delay
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 24
Lab Assignment #2
Question 3 – Refer to Part 1 Model
Consider the transition from Uninfected Population to Infected Population as a Time
Delay, which of the following represents its Expected Delay Time. (10 marks)
A. 1 / Uninfected_Population
B. 1 / Infected_Population
C. 1 / Infection_Rate
D. 1 / New_Infections
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 25
Lab Assignment #2
Question 4 – Refer to Part 1 Model
What is the impact if the Probability of Infection on Contact increases from 0.05 to
0.1? (10 marks)
A. Less people will be infected in the end
B. More people will be infected in the end
C. The infection outbreak will start earlier
D. The infection outbreak will start later
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 26
Lab Assignment #2
Question 5 – Refer to Part 1 Model
What is the impact if the Number of Contacts per person per day is reduced by 20%?
(10 marks)
A. Less people will be infected in the end
B. More people will be infected in the end
C. The infection outbreak will start earlier
D. The infection outbreak will start later
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 27
Lab Assignment #2
Question 6 – Refer to Part 2 Model
Run the simulation for 180 Days with DT = 1/4. What is the number of uninfected
population at the end of the simulation? (10 marks)
A. 0
B. 32.1k
C. 968k
D. 1000k
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 28
Lab Assignment #2
Revise the delay structure as shown, what should be the equation for “Recover”, so
that the delay behavior is equivalent to the previous model? (10 marks)
A. DELAY(New_Infections, Expected_Time_to_Recover, 0)
B. DELAY(New_Infections, Expected_Time_to_Recover, 1)
C. DELAYN(New_Infections, Expected_Time_to_Recover, 1, 0)
D. DELAYN(New_Infections, Expected_Time_to_Recover, 2, 0)
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 29
Lab Assignment #2
Question 8 – Refer to Part 2 Model
What is the impact if the “Expected Time to Recover” reduces from 7 to 3.5 Days? (10
marks)
A. The infection speeds up, and the number of uninfected population stabilizes at the
same value
B. The infection speeds up, and the number of uninfected population stabilizes at a higher
value
C. The infection slows down, and the number of uninfected population stabilizes at a
higher value
D. The infection slows down, and the number of uninfected population stabilizes at the
same value
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 30
Lab Assignment #2
Question 9 – Refer to Part 3 Model
The reason for using a ‘Ghost Function’ does NOT include: (10 marks)
C. Create two variables with different values but with the same name
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 31
Lab Assignment #2
Question 10 – Refer to Part 3 Model
Note that the PCR test is expensive. Assuming all other parameters remain the same
as configured, what is the minimum “Test Capacity” required to cope the epidemics in
the best way? (10 marks)
A. 4000
B. 5000
C. 6000
D. 7000
E. 8000
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 32
Let's protect the environment
Lecture notes are subject to change before
the class for further improvement
THANK YOU
The preparation of this module has been made possible by
the support from IE2141 teaching team, and the past
teaching materials developed by A/Prof. Aaron Chia.
IE2141 Systems Thinking and Dynamics – ISEM Department, National University of Singapore 33