System Dynamics Modelling
using Vensim
3 December 2015
Prof Mikhail Prokopenko
System: behaviour
System: interconnectivity
System Dynamics Definition
An approach to understanding the behaviour
of complex systems over time.
It deals with internal feedback loops and time
delays that affect the behaviour of the entire
system.
What makes system dynamics different from
other approaches to studying complex
systems is the use of feedback loops and
stocks and flows.
Stock and Flow Diagram
Black box diagram
Positive Feedback
- Exponential growth – More begets more – Less begets
less
- The “vicious cycle”
- Snowball rolling down a hill
- Bank account interest
Negative Feedback
- Goal seeking behaviour
- Pouring water into a glass
- Initial growth leads to an undersupply of resources
Dynamics of real systems
- Systems often combine feedbacks
- Growth and limitation
?
Modelling:
sensitivity to initial conditions
Butterfly effect:
sensitivity to initial conditions
http://demonstrations.wolfram.com/SensitivityToInitialConditionsInChaos/ http://pixshark.com/chaos-theory-butterfly-effect.htm
Core Concepts
•
Simple processes can generate complicated
behaviour
•
System dynamics provides unified approach for
understanding problems
•
Assists with your own mental models by making
dynamic problems explicit
– Accumulations (Stocks), Change (Flows),
Feedback (interactions between the two)
How assets build and decay
-
Accumulation itself changes according to inflow and
outflow
image:
http://fixingtheeconomists.wordpress.com/
- inflow > outflow: level rises
- outflow > inflow: level sinks
- outflow = inflow: no change
Identifying Stocks and Flows
-
How can you tell which concepts are stocks and which are
flows?
-
Stocks are quantities of material or other accumulations.
They are the states of the system.
-
The flows are the rates at which these system states
change. Imagine a river flowing into a reservoir. The
quantity of water in the reservoir is a stock.
-
If you drew an imaginary line across the point where the
river enters the reservoir, the flow is the rate at which water
passes the line.
Identifying Stocks and Flows
-
In epidemiology, prevalence measures the number or stock of people who have
a particular condition at any given time, while incidence is the rate at which
people come down with the disease or condition.
-
In December 1998 the prevalence of HIV/AIDS worldwide was estimated by the
United Nations AIDS program to be 33.4 million and the incidence of HIV
infection was estimated to be 5.8 million/year. That is, a total of 33.4 million
people were estimated to be HIV-positive or to have AIDS; the rate of addition to
this stock was 5.8 million people per year (16,000 new infections per day).
-
-
The net change in the population of HIV-positive individuals was estimated to be
3.3 million people per year due to the death rate from AIDS, estimated to be 2.5
million people per year in 1998.
The Snapshot Test
-
Stocks characterise the state of the system. To identify key stocks in a system,
imagine freezing the scene with a snapshot. Stocks would be those things you
could count or measure in the picture, including psychological states and other
intangible variables.
-
stock of water in a reservoir from a set of satellite images and topographic data,
but cannot determine whether the water level is rising or falling.
-
bank statement tells you how much money is in your account but not the rate at
which you are spending it now.
-
If time stopped, it would be possible to determine how much inventory a
company has or the price of materials but not the net rate of change in
inventory or the rate of inflation in materials prices.
Units
-
Units of measure can help distinguish stocks from flows. Stocks are usually
a quantity such as widgets of inventory, people employed, or Yen in an
account.
-
The associated flows must be measured in the same units per time period
e.g., the rate at which widgets are added per week to inventory, the hiring
rate in people per month, or the rate of expenditure from an account in
$/hour.
-
You are free to select any measurement system you like as long as you
remain consistent. You can measure the flow of production into inventory as
widgets per week, widgets per day, or widgets per hour.
Stocks Change Only
Through Their Rates
-
Stocks change only through their rates of flow, no causal link directly into a
stock.
-
A model for customer service: Customers arrive at some rate and accumulate
in a queue of Customers Awaiting Service (e.g., a restaurant)
-
When service is completed customers depart from the queue, decreasing the
stock of customers waiting for service.
-
Rate at which customers can be processed depends on the number of service
personnel, their productivity (in customers processed per hour per person), and
the number of hours they work (the workweek).
-
If the number of people waiting for service increases, employees increase their
The only way a stock can change is via its inflows and
outflows. In turn, the stocks determine the flows.
Stock change only through
rates
Stock change only through
rates
Auxiliary Variables
-
It is often helpful to define intermediate or auxiliary variables.
-
Auxiliaries consist of functions of stocks (and constants or exogenous
inputs).
-
For example, a population model might represent the net birth rate as
depending on population and the fractional birth rate; fractional birth
rate in turn can be modelled as a function of food per capita.
-
Ideally, each equation in your models should represent one main idea.
Don’t try to economise on the number of equations by writing long
ones that embed multiple concepts, they will be hard to understand.
-
Equations with multiple components and ideas are hard to change if
System Dynamics (Vensim):
System Dynamics (Vensim):
?
Vensim first steps
-
Vensim PLE Quick Reference and Tutorial
http://ocw.mit.edu/courses/sloan-school-of-
management/15-988-system-dynamics-self-study-fall-1998-spring-1999/readings/formulating.pdf
Developing Stock, Flow
and Feedback Structure
?
?
Predator – prey model
Predator – prey model
Predator – prey model
Predator – prey model
Predator – prey model
rabbit births = Rabbits * birth rate c
?
Predator – prey model
rabbit births = Rabbits * birth rate c
d
rabbit deaths = Rabbits * Foxes * catching rate d
Predator – prey model
rabbit births = Rabbits * birth rate c
rabbit deaths = Rabbits * Foxes * catching rate d
change in Rabbits = rabbit births - rabbit deaths
∆R = c R – d R F
Predator – prey model
fox birth rate
fox births
fox death rate
fox deaths
Fox
population
Predator – prey model
fox birth rate
fox growth
fox deaths
Fox
population
Predator – prey model
fox growth = Foxes * Rabbits * growth rate a
fox birth rate
fox growth
fox deaths
Fox
population
fox death rate b
Predator – prey model
fox growth = Foxes * Rabbits * growth rate a
fox birth rate
fox growth
fox deaths
Fox
population
fox deaths = Foxes * death rate b
fox death rate b
fox birth rate
Predator – prey model
fox growth = Foxes * Rabbits * growth rate a
fox birth rate
fox growth
fox deaths
Fox
population
fox deaths = Foxes * death rate b
fox death rate b
change in Foxes = fox growth – fox deaths
∆F = a F R – b F
fox birth rate
Predator – prey model
a
b
Predator – prey model
∆R = c R – d R F
∆F = a F R – b F
a
b
Predator – prey model:
Lotka-Volterra model
∆R = c R – d R F
∆F = a F R – b F
the simplest model of predator-prey interactions
∆R = c R – d R F
∆F = a F R – b F
Predator – prey model:
Equilibrium
Predator – prey model:
Equilibrium
0 = ∆R = c R – d R F
0 = ∆F = a F R – b F
0 = ∆R = c R – d R F
0 = ∆F = a F R – b F
c R = d R F
a F R = b F
Predator – prey model:
Equilibrium
c R = d R F
a F R = b F
F = c / d
R = b / a
Predator – prey model:
Equilibrium
Predator – prey model
F = c / d
R = b / a
a
b
?
Equilibrium population
sizes
Building the model
a
b
Equilibrium population
Population
300
225
150
75
0
0
100
200
300
400
500
600
700
800
900
1000
Time (seasons)
Equilibrium population
Population
1500
1125
750
375
0
0
100
200
300
400
500
600
700
800
900
1000
Time (seasons)
Equilibrium population
Selected Variables
300
2000
150
1000
0
0
0
100
200
300
400
500
600
700
800
900
1000
Time (seasons)
Foxes : Current
Rabbits : Current
Equilibrium population
Population
1500
1125
750
375
0
0
100
200
300
400
500
600
700
800
900
1000
Time (seasons)
Rabbits : Current
Foxes : Current
"eq-rabbits" : Current
"eq-foxes" : Current
Equilibrium population
•
Oscillations are observed in both population sizes
•
Oscillations occur around the equilibrium population values
•
Dynamic equilibrium (not static)
•
Oscillatory behaviour is similar to many natural,
socio-technological, and socio-economic systems
•
(Pure) competition between the species, when one species
(predator) grows at the expense of the other (prey)
•
Dynamics and equilibria of each population are affected by
dynamics of the others
Equilibrium population:
phase diagrams
Phases
300
225
150
75
0
250
360
470
580
690
800
910
1020
1130
1240
1350
Rabbits
Foxes : Current
Equilibrium population:
phase diagrams
Equilibrium population:
phase diagrams
Phases
300
225
150
75
0
250
360
470
580
690
800
910
1020
1130
1240
1350
Rabbits
Foxes : Current
Equilibrium population:
phase diagrams
Phases
300
225
150
75
0
250
360
470
580
690
800
910
1020
1130
1240
1350
Rabbits
Foxes : Current
?
117
Faculty of Engineering and IT: Complex Systems Research Cluster
Thank you!
Prof. Mikhail Prokopenko
Starting in 2017:
Master of Complex Systems (MCXS)
118