System Dynamics Models: Elementary System Dynamics Modeling
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 5
Elementary System Dynamics
Modeling
‘Our social systems are far more complex and harder to understand than our technological
systems. Why, then, do we not use the same approach of making models of social systems and
conducting laboratory experiments on those models before we try new laws and government
programs in real life? The answer is often stated that our knowledge of social systems is
insuﬃcient for constructing useful models. But what justiﬁcation can there be for the apparent
assumption that we do not know enough to construct models but believe we do know enough
to directly design new social systems by passing laws and starting new social programs?
I am suggesting that we do indeed know enough to make useful models of social systems.
Conversely, we do not know enough to design the most eﬀective social systems directly without
ﬁrst going through a modelbuilding experimental phase. But I am conﬁdent, and substantial
supporting evidence is beginning to accumulate, that the proper use of models of social
systems can lead to far better systems, and to laws and programs that are far more eﬀective
than those created in the past.’ (Forrester 1971, p126)
5.1 Elementary Model Building
As argued in chapter 1, SD is an iterative method for modeling –using mental models and spe
ciﬁc structural elements (positive and negative feedback loops and causally linked stock/ﬂow/delay
structures), hard and soft variables, and logical parameter estimates– and simulating the dynamic
behavior of problem/clientcentered models to study, explain and/or manage the complex dynamic
behavior of aggregate socialtechnical systems in order to dissolve problematic aspects of complex
issues. Let us focus now on some of the building blocks in view of building small and simple
models.
The Constitutive Elements
Stocks
Stocks are state variables, i.e. they are the memory of the system and of each individual
feedback loop. At least one stock –or a delay which consists of at least one stock– is needed in
each feedback loop since equations in a loop need to be calculated in each numeric integration
step from starting points or system memories. Stocks start from an initial value but are, during
a simulation run, only aﬀected by their inﬂows and outﬂows: they can be increased by increasing
their inﬂows as well as by decreasing their outﬂows, and they can be decreased by decreasing
their inﬂows as well as by increasing their outﬂows (Meadows 2009, p22). Stock variables are thus
85
3.
RUNUP: Intro to Quantitative SDM c⃝ 2013 by Erik Pruyt
deﬁned by their inﬂows, outﬂows, and initial values. A stock variable is in fact the accumulation of
its inﬂows minus its outﬂows over time, starting from its initial value. Mathematically speaking,
stocks are thus integral equations: the stock variable x in Figure 5.1 is equal to the amount in the
stock x0 at t0 plus the integral over the diﬀerence of the inﬂow(s) ax and outﬂow(s) bx over the
time interval considered:
x = x0 +
t∫
t0
(+ax − bx) dt
Figure 5.1: A basic stock/ﬂow diagram with a stock, a ﬂow, an auxiliary variable and a constant
The behavior of stock variables diﬀers from the behavior of other ﬂow and auxiliary variables
precisely due to the fact that they are integral equations. They generally change slowly, even when
their inﬂows or outﬂows change heavily or abruptly. Stocks thus buﬀer and delay. They could
consequently be used as shock absorbers (Meadows 2009, p23) both to the inﬂow side and to the
outﬂow side: stocks allow inﬂows and outﬂows to be independent, decoupled and temporarily out
of balance with each other (Meadows 2009, p24).
The number of independent stocks (and delays) determines the order of the system. Endoge
nous oscillations require at least a second order system. Hence, systems with just 1 stock or delay
cannot oscillate endogenously.
Flows
Only ﬂows that enter or leave a stock variable aﬀect it during simulation. Although these
ﬂows are preferably labeled and visualized either as inﬂows or as outﬂows, they can also –unless
protected for example with a max(. . . ,0) or softmax function (see chapter 9)– become negative,
thus turning an outﬂow into an inﬂow and vice versa. Flows can also connect two stock variables,
ﬂowing out of a ﬁrst stock and ﬂowing into a second stock. Since a stock variable corresponds
to the integral of all its inﬂows and outﬂows, the inverse is also true: the net ﬂow, i.e. the sum
of all ﬂows connected to a stock, describes the state changes of the stock over time. That is,
the net ﬂow corresponds to a diﬀerential equation in spite of the fact that it is not written as a
diﬀerential equation in the equation editor. In fact, a normal equation must be speciﬁed for each
ﬂow variable. Following ﬂow equations are often used:
1. flow = (variable−stock)/constant. This is a classic ﬂow proportional to a deﬁcit involving
the corresponding stock. The variable could for example be a desired level that is aimed
for or information that is smoothed. And the constant could for example be the smoothing
time.
2. flow = coefficient ∗ stock. This is a ﬂow proportional to the corresponding stock. The
coeﬃcient could for example be 1/average residence time in the stock.
3. flow = normal flow+effect. This is an additive ﬂow independent from the corresponding
stock. Note that the normal ﬂow and the eﬀect have the same units as the ﬂow.
4. flow = normalflow ∗ effect. This is a multiplicative ﬂow independent from the corre
sponding stock. Note that the normal ﬂow has the same units as the ﬂow and that the
multiplicative eﬀect must be dimensionless. This equation is often used for percentage
changes and/or when it should be possible to shut the ﬂow down (coeﬃcient = 0).
                      STOP

86
              $  
4.
c⃝ 2013 by Erik Pruyt RUNUP: Intro to Quantitative SDM
Flow equations are not limited to these ‘common’ ﬂow equations. Special functions such as
the ones discussed in chapter 9 are commonly used in ﬂow equations too. Be careful though with
complicated equations and net ﬂows, especially in case of multiplicative eﬀects. In fact, it is wise
to work as little as possible with net ﬂows. Also avoid causal links between ﬂows, except in case
of coﬂows and delay functions using stockﬂow structures (see chapter 9). Finally, all ﬂows into
and out of the same stock variable need to have the same units.
Auxiliaries
Auxiliary variables help to keep ﬂow equations simple and understandable. Moreover, use
of auxiliary variables which closely correspond to real world system elements allows one to keep
models understandable. Auxiliaries require equations to be speciﬁed, often with special functions
such as the ones in chapter 9. They are called hard variables if the relations are well known and
completely determined, else they are called soft variables. System dynamicists believe it is better
to include soft variables than to omit them. For including them using assumptions, allows one
to explore the eﬀects of assumptions, and hence, generate insights and understanding. Omitting
them is equivalent to ‘saying they have zero eﬀect – probably the only value that is known to be
wrong!’ (Forrester 1961, p57).
Parameters and Constants
Although there are only few real constants, like real physical constants, there are many variables
that can be assumed to remain about constant over a simulation run for a particular model and
for a particular time horizon1
. Examples are conversion factors (e.g. ‘productivity’), reference
values (e.g. the ‘normal delivery delay’), average lifetimes or residence times, adjustment times,
et cetera. They can be included in a model by means of exogenous parameters if they are not or
hardly inﬂuenced by other model variables.
Their values can be distilled from real data and from knowledge about processes. However,
mostly they are uncertain or inaccurate as are models and systems. Hence, it is recommended to
test the sensitivity of the model to small and even large parameter changes (see chapter 13). The
same is true for initial values. They are mostly inaccurate or uncertain and require –especially for
highly nonlinear/chaotic models– sensitivity and uncertainty analyses.
Elementary Model Building and Model Speciﬁcation
Stock variables are usually very important variables. Hence, it makes sense to ﬁrst model
a stock variable or a set of stock variables, then connect inﬂows and outﬂows that inﬂuence
this/these stock variable(s), as well as separately modeled initial value(s). Subsequently add
auxiliaries and parameters/constants that inﬂuence the ﬂows, and connect them by means of
causal links. Simultaneously or subsequently specify the equations. And then simulate and test
the ﬁrst iteration model (see next two subsections).
It is best to build models iteratively: start with a very small model, and gradually extend
it. Ways to keep this iterative way of modeling manageable are to: (i) model/simulate/test one
subsystem at a time and gradually include other subsystems, (ii) gradually build in submodels,
that is, ﬁrst include a submodel as an exogenous parameters/variable, then replace the exogenous
parameter/variable by an endogenous variable (e.g. a graph function), and ﬁnally, turn the en
dogenous variable into a full submodel if needed, and (iii) ﬁrst use simple structures and functions
and gradually reﬁne them (most likely making them more complex) along the way.
1Depending on the time horizon, one and the same process or element of a system could be modeled as a
constant (for short time horizons compared to the inherent time horizon of the process), as a stock variable (for
simulation time horizons that are similar to the inherent time horizon of the process), or as an auxiliary variable
(for simulation time horizons that dwarf the inherent time horizon of the process). Constants do not, or hardly,
change compared to the time horizon considered, stocks change slowly compared to the time horizon considered,
and auxiliaries change instantly compared to the time horizon considered. For example, large glaciers hardly change
on a daily time scale, change slowly on a time horizon of decades to centuries, but change rapidly/instantly on
geological time scales.
                      STOP

87
              $  
5.
RUNUP: Intro to Quantitative SDM c⃝ 2013 by Erik Pruyt
In fact, it is good practice to include as little as possible, but not less than necessary. System
dynamicists try to distil the very essence of issues (Coyle and Alexander 1997, p213), capture the
essence in a structure of the model that is as small as possible by eliminating superﬂuous details
and aggregating what could possibly be aggregated.
5.2 Elementary Model Simulation
SD allows the simulation of systems and policies over time in such a way that the behavior of the
model unfolds continuously over time. Only the dynamics of extremely small and/or wellknown
systems (of up to three stocks, and only few feedback loops) could possibly be solved analytically,
be assessed without simulation, or be derived by analogy to similar ‘archetypes’. The dynamics
of large and/or illknown systems requires numerical simulation. Hence, most SD models require
numeric integration.
Attention needs to be paid to the combination of the numerical integration method and the
step size used. Numerical integration methods commonly included in SD packages are Euler,
RungeKutta4 (RK4), and RungeKutta4 auto (RK4 auto). Euler is best for models with very
discrete functions. But for many models and patterns, Euler is insuﬃciently precise unless a very
small time step is chosen. RK4 is best for continuous models with, possibly, oscillatory behavior
without large changes in the speed of dynamics. And RK4 auto is best for continuous models with
large variations in the speed of dynamics.
There are a few rules of thumb for choosing an appropriate step size given the numeric inte
gration method. Moreover, the step size should be chosen such that time is fully covered, that is,
if time is n periods of length dt from t0 then time should be equal to t0 + n ∗ dt. The step size
should be such that crucial simulation times are ‘visited’, e.g. if a very discrete pulse occurs at
t = 0.25, then the time step should be smaller or equal to 0.25 and t=0.25 should be calculated,
as would be the case with a time step of 0.125, or 0.0625, et cetera. It is even better to start with
a time step of less than 1/4th the smallest time constant or delay time in the model and simulate
it. Then cut the time step in half and run the model again. If the two behaviors are identical or
almost fully converge, then the largest of the two time steps was good enough, else the smallest
time step should be halved again, et cetera. If there are delays in the model, then the time step
should also be smaller than the delay constant divided by 4 times the order of the delay. The step
size should not be chosen arbitrarily small: smaller step sizes take more time to compute and for
small step sizes there is a tradeoﬀ between integration errors and roundoﬀ errors. The largest
acceptable time step should thus be determined, chosen, and tested.
Apart from the integration method and the time step, one also needs to specify the start time
and ﬁnal time of the simulation. With regard to the total time horizon, i.e. Final Time  Initial
Time, SD is oriented towards the very long term future, that is, very long term for the system
under study2
. Hence, it remains to be tested whether the time horizon chosen is actually too short
by also simulating beyond the assumed long term time horizon.
Simulating the model numerically, one obtains the behavior of a run. System dynamicists are
interested in this overall pattern of behavior of a run or an ensemble of runs, not so much in exact
point or path predictions:
‘[System dynamicists] are much more interested in general dynamic tendencies; un
der what conditions the system as a whole is stable or unstable, oscillating, growing,
declining, selfcorrecting, or in equilibrium’ (Meadows and Robinson 1985, p34).
The overall dynamic behavior of a run strongly depends on the dominance of feedback loops and
the shifts in dominance between them. The dynamic complexity of real systems arises because
2In relation to the time problem of SD models (especially the issue of choosing a time horizon), Perelman (1980,
p79) argues that a very broad time perspective needs to be taken because of the fact that ‘[t]he cause of a current
problem may lie in the distant past, and therefore may be insoluble by current actions[, that t]he solution to a
problem within one future time horizon may contain the seeds of catastrophe in a longer time horizon[, that] a
nearterm disaster may be the best hope for the longterm future’.
                      STOP

88
              $  
6.
c⃝ 2013 by Erik Pruyt RUNUP: Intro to Quantitative SDM
systems are dynamic, tightly coupled, governed by feedback, nonlinear, historydependent, self
organizing, adaptive, counterintuitive, policy resistant and characterized by tradeoﬀs (Sterman
2000, p22).
5.3 Elementary Model Testing
Before starting to interpret the behavior of a model and/or performing policy analyses with
the model, one ﬁrst needs to turn to model testing. Model testing is a process to uncover errors,
improve models, learn, and build conﬁdence in the usefulness of models for particular purposes and
in the recommendations that follow from modeling studies. Model testing is not about ‘proving’
a model is right –after all, all models are wrong (Sterman 2002a). However, some models may
not just be wrong, they may be erroneous, may be used erroneously, or may simply be useless for
the intended purpose. Identifying erroneous modeling and simulation are among the purposes of
model testing. Another purpose of SD model testing is to test whether SD models generate the
right outputs for the right reasons, for SD models are supposed to be operational causal models.
That is, all model variables need to correspond to system elements and each relation is assumed
to be causal. However, the most important purposes are to learn and to build conﬁdence in the
model and its usefulness for the intended purpose.
Model testing consists of model veriﬁcation and model validation. Model veriﬁcation refers
to testing whether the model is incorrectly coded or simulated incorrectly, that is, whether it
has been coded incorrectly (equations, submodels, and the whole model), whether the units are
inconsistent (dimensional analysis3
), or whether there are numerical errors (due to the use of an
inappropriate combination of numeric integration method and step size).
Model validation refers to the entire range of tests to check whether a model meets the objec
tives of the modeling study. As such, validation is really about building conﬁdence in its ﬁtness
for purpose, that is, conﬁdence of the modeler/analysist as well as of the client/audience. Hence,
clients, model users, and users of model results should somehow be involved in model validation.
Some of the main questions to be addressed together with the clients/audience are:
• Are the boundaries, structures and parameters adequate?
• Does the model allow to generate the behaviors it should be able to generate for the right
reasons?
• Does the model generate plausible behaviors under extreme conditions?
• Does the sensitivity of the model to changes in parameters, functions, boundaries, et cetera
correspond to the sensitivity of the real system to corresponding changes?
There are many validation tests. Extremely important ones are boundary and in/direct struc
ture assessment tests (are the boundary and structure appropriate?), extreme condition tests (does
the model make sense under extreme conditions?), and sensitivity analysis (is the model sensitive
to small changes in parameters, functions,. . . ?). For more on model testing, see chapter 13.
5.4 Elementary Policy Analysis, Design and Testing
Important objectives of most SD studies are to enable virtual experimentation, to learn from
these experiments and to design system structures and policies that result in improved system
behavior. When designing policies to improve system behavior, one should be creative within the
real world boundaries and structural limits, and only change in the model what could also be
changed in the real world.
3Dimensional analysis, i.e. analyzing the units of left hand side and right hand side of the equation, is very easy
and useful for identifying missing factors/terms and detecting potential errors.
                      STOP

89
              $  
7.
RUNUP: Intro to Quantitative SDM c⃝ 2013 by Erik Pruyt
There are several approaches for designing and testing policies. Iteratively and interactively4
changing structures and parameters and testing the eﬀects of these changes is by far the eas
iest approach from a technical point of view, but not necessarily the most informative from a
policy analytical point of view. Other approaches rely heavily on mathematics, control engi
neering, sampling and machine learning, and/or optimization techniques. These techniques are
beyond the introductory level of this ebook and will be dealt with in a followup book. The
intuitive/interactive/iterative approach of changing loops, structures and parameters is focused
on here.
Intelligently playing with policies and models is a function of experience with the real system
as well as of experience with SD modeling and simulation. Innovative structural policies can very
often be distilled from the structure of a model. Possible modelbased structural changes –in
decreasing order of eﬀectiveness– include:
1. adding/breaking/changing feedback loops related to information ﬂows, decision routines,
boundaries of responsibility,. . .
2. adding/breaking/changing (physical) stockﬂow structures;
3. strengthening/weakening feedback loops and/or ﬂow variables;
4. changing high leverage policy parameters, i.e. parameters that can be controlled by those
involved and that have large eﬀects for relatively small changes. The latter can be identiﬁed
by means of sensitivity analysis (see chapter 13).
5.5 Elementary Interpretation
A SD model is ‘a simpliﬁcation of reality designed to be a tool for thought about questions’
(Coyle 2001, p357). Model runs, scenarios, and policy runs could thus be used to support reﬂection
and dialogue, they should not be used as truth sayers, or in the words of Barabba (1994): ‘never
say a model says’. SD model runs are interpreted in terms of their behavior patterns, which are
in fact qualitative in nature. The most important outcomes of the modeling process are often
increased insight and deeper understanding. And policies are mostly assessed in terms of their
capacity to signiﬁcantly and robustly improve behavior patterns.
Additional (nonmandatory) chapters:
III. Introduction to System Dynamics
V. Model Formulation
4by using the experience and intuition of both system actors and analysts
                      STOP

90
              $  
8.
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:
Clipping is a handy way to collect and organize the most important slides from a presentation. You can keep your great finds in clipboards organized around topics.
Be the first to comment