Transcript of "System Dynamics Models: Basic System Dynamics Model Formulation"
1.
Small System Dynamics Models
for Big Issues
Triple Jump towards RealWorld Dynamic Complexity
Erik Pruyt
                 
              $  
First time readers: start with the preface  
2.
Chapter 9
Basic System Dynamics Model
Formulation
‘He who would learn to ﬂy one day must ﬁrst learn to stand and walk and run and climb and
dance; one cannot ﬂy into ﬂying.’ Friedrich Nietzsche
This chapter is written for Vensim users. If you are not using Vensim: check here whether this
chapter is available for the software you are using.
9.1 Some Predeﬁned Functions
Following simple functions are extremely useful in SD models1
:
Time is a predeﬁned system variable which can be included as a shadow/snapshot variable.
Time is equal to Initial Time plus the time that has elapsed since the start of the run.
Time is especially useful together with SIN() to simulate (exogenous) seasonal phenomena,
and in combination with With Lookup() to simulate time series.
STEP(stepsize, steptime) is a predeﬁned function that allows to step up or down with a
particular stepsize at time = steptime.
RAMP(slope, ramp start time, ramp end time) is a predeﬁned function that allows to
ramp up linearly with a particular slope between the ramp start time and the ramp end
time, e.g. RAMP(2, 5, 20) is 0 until t=5, then a linear function from 0 to 30 between t=5
and t=20, and 30 afterwards.
SIN(arg) is the predeﬁned SINE function. It is particularly useful in combination with Time
to simulate exogenous seasonal phenomena.
MAX(x,y) returns the largest of two arguments. MAX(x,0) could be used as a ﬂoor at 0.
MIN(x,y) returns the smallest of two arguments. MIN(B, x) could be used as a ceiling at B.
ZIDZ(A,B) stands for Zero If Divided by Zero. It returns A/B unless if B is smaller than
1E6, then it return 0.0.
1Vensim notations and deﬁnitions are followed here. Other packages have equivalent as well as diﬀerent functions.
Equivalent versions of this chapter written for other packages are available online.
119
3.
HOP: Basic SD Model Formulation c⃝ 2013 by Erik Pruyt
XIDZ(A,B) stands for X If Divided by Zero. It returns A/B unless if B is smaller than 1E6,
then it return X.
MIN(B,MAX(x,A)) could be used to return values between a lower bound A and an upper
bound B.
IF THEN ELSE(condition, arg if true, arg if false) is a traditional if statement
that returns the ﬁrst argument (arg if true) if the condition is true, and the second ar
gument (arg if false) if the condition is false. Note that IF THEN ELSE functions are
extremely discrete.
SoftMin and SoftMax are less discrete, i.e. more continuous, structures using table functions
to set soft ceilings or soft ﬂoors.
PULSE(start,width) returns the value 1 starting from a start time on for a time interval
equal to width, and returns 0.0 at all other times.
PULSE TRAIN(start,width,tbetween,end) returns the value 1 starting from a start time
on for a time interval equal to width, and then repeats this pattern every tbetween time
until the end, and returns 0.0 at all other times.
RANDOM functions, e.g. Random Uniform(), returns a pseudo random number from a partic
ular distribution at each successive invocation during a run.
Random sampling draws a pseudo random number for a parameter or initial value from a
particular distribution for a parameter at each new run, not within the same run.
Table functions (LOOKUP and WITH LOOKUP functions in Vensim, diﬀerent types of GRAPH
function in Powersim,. . . ) allow to easily specify nonlinear relationships between two vari
ables. They can be entered graphically or using couples. Speciﬁc points that require attention
are the y and x values equal 0 and 1 and as well as extreme values. For multiplicative eﬀects,
the normal y value is equal to 1 and for additive eﬀects, the normal y value is equal to 0.
Using a with lookup function and Time allows one to introduce time series.
Note that many more predeﬁned functions are available in most SD software packages. Note
also that depending on the purpose, functions could be used in a supplementary way. Following al
ternative functions could for example be used for STEPlike behaviors: STEP, RAMP, PULSE with
a memory structure, IF THEN ELSE, WITH LOOKUP, GET XLS DATA, GET XLS LOOKUP.
Similarly, SIN, PULSE TRAIN, STEPSTEP, WITH LOOKUPS, IF THEN ELSE with MOD
ULO(Time) with/out delays, GET XLS DATA, GET XLS LOOKUP could be used in alternative
formulations for ﬂuctuations or seasonal behaviors. And XIDZ, ZIDZ, MIN, MAX, MINMAX,
Softmin, Softmax, and IF THEN ELSE are alternatives for setting ﬂoors and/or ceilings. The
least discrete functions that allow for good enough a representation of the real eﬀect should be
chosen. Often, submodels could be formulated that endogenously generate the eﬀect of exogenous
functions.
9.2 Delaying and Smoothing
First Order Material and Information Delays
For this introductory SD course/book, there are two important types of delays: the ‘material
delay’ type and the ‘information delay’ type, also known as smoothing. The main diﬀerences be
tween them are (i) their diﬀerent model structures, and (ii) that material delays conserve whatever
is delayed whereas information delays do not. In practice however, they generate the same output
as long as the delay times are equal and invariable. Variable delay time cause the behavior of
                      STOP

120
              $  
4.
c⃝ 2013 by Erik Pruyt HOP: Basic SD Model Formulation
Figure 9.1: A 1st
order material delay as a stockﬂow structure (left) and as a function (right)
material delays and information delays to diﬀer signiﬁcantly, due to their fundamentally diﬀerent
structures and conservation principles.
Figure 9.1 shows a ﬁrst order material delay structure. The input of the delay structure is
the inﬂow of new SD workshoppers. The output of the delay structure is the outﬂow of new
System Dynamicists which is equal to the value of the stock divided by the delay time average
time to turn SD Workshoppers into System Dynamicists. The output of this ﬁrst order delay
thus corresponds to a traditional outﬂow which is proportional to the perfectly mixed stock value
and inversely proportional to the delay time. Instead of modeling a delay structure, one could
also use the corresponding delay function. Predeﬁned delay functions are especially useful for
higher order delays, which are mostly used since ﬁrst order material delays are generally speaking
less appropriate for representing real world delays than 3rd
order delays or other, more complex,
delays. Note that, normally, the inﬂow of a material delay needs to be nonnegative.
Figure 9.2: A 1st
order information delay as a stockﬂow structure (left) and as a function (right)
Figure 9.2 shows a ﬁrst order information delay structure. The smoothed variable is the
smoothed equivalent of the variable to be smoothed. The ﬂow equation is the same as the ﬂow
equation of the classic ﬂow equation: (variable to be smoothed  smoothed variable)/smoothing
time. Smoothing averages out information (e.g. oscillations) but it also delays. The most recent
information receives more weight. The larger the smoothing time, the more smoothing occurs.
There is no conservation of the material/mass/information that goes in. And the input does not
need to be nonnegative.
Higher Order Material and Information Delays
Higher order delay and smoothing structures are obtained by cascading 1st
order delay struc
tures or 1st
order smoothing structures. A 3rd
order material delay is thus the cascading of 3 1st
order delays with their delay time divided by the order. The same is true for higher order smooth
ing: Figure 9.3 shows a 3rd
order smoothing structure and a 1st
order and 3rd
order smoothing
function. Figure 9.4 shows that the 3rd
order function and 3rd
order structure generate the same
behavior for a random input whereas the 1st
order smoothing function shows less smoothing.
The higher the order of a delay, the slower the initial response, but the closer the replication of
the input by the delayed response. Very high orders almost entirely replicate the input, although
with a delay equal to the delay time. A material delay of inﬁnite order, aka Delay Fixed (Vensim)
or Pipeline delay (Powersim), delays the input exactly with the delay time. That is, individual
items exit after the same delay time in the exact same order they entered. For more about delays,
                      STOP

121
              $  
5.
HOP: Basic SD Model Formulation c⃝ 2013 by Erik Pruyt
Figure 9.3: A 3rd
order smoothing structure, and 1st
order and 3rd
order smoothing functions
Figure 9.4: Response of a 3rd
order smoothing structure and 1st
order and 3rd
order smoothing
functions to a random normal input
see e.g. (Forrester 1961, Chapter 9, App D and H), (Hamilton 1980) and exercise 10.4 on page 126.
The typical behaviors generated by diﬀerent orders and types of delays are not shown here on
purpose: in exercise 10.4 you have to discover for yourself what the eﬀects of all sorts of delays on
all sorts of inputs are.
9.3 Core Model Structures
Many models contain archetypical stockﬂow and feedback loop structures that are very similar
for very diﬀerent topics. Examples are: Aging chains and recycling chains; Coﬂow structures;
Diﬀusion / Infection / Adoption / Transition structures; Learning curve structures; Demand with
price elasticity and substitution structures; and Second order oscillatory structures. They will be
pointed out in the feedback to individual exercises/cases and in the feedback across exercises/cases
of a chapter.
9.4 Nonlinearities
SD models and SD model behaviors are (almost always) nonlinear. Nonlinearities are often
included in SD models by means of nonlinear (table) functions. However, even if all equations in
models with one or more feedback loops are linear, then the behaviors are almost always nonlinear.
Nonlinearity is experienced and explored in almost all exercises and cases in this ebook.
Additional (nonmandatory) chapters:
V. Model Formulation
                      STOP

122
              $  
6.
Flexible EBook for Blended Learning with Online Materials
Although this ebook is ﬁrst and foremost an electronic case book, it is much more than just
a set of case descriptions: it is the backbone of an online blendedlearning approach. It consists
of 6 concise theory chapters, short theory videos, 6 chapters with about 90 modeling exercises
and cases, many demo and feedback videos, feedback sheets for each case, 5 overall chapters with
feedback, 5 chapters with multiple choice questions (with graphs or ﬁgures), hundreds of online
multiple choice questions, links to onsite lectures, past exams, models, online simulators, 126
slots for new exercises and cases, and additional materials for lecturers (slides, exams, new cases).
The fully hyperlinked eversion allows students (or anybody else for that matter) to learn –in a
relatively short time– how to build SD models of dynamically complex issues, simulate and analyze
them, and use them to design adaptive policies and test their robustness.
ISBN paperback version:
ISBN ebook version:
Be the first to comment