Small System Dynamics Models
for Big Issues
Triple Jump towards Real-World Dynamic Complexity
Erik Pruyt
| | | | | | | | |...
Chapter 5
Elementary System Dynamics
‘Our social systems are far more complex and harder to understand than our t...
RUN-UP: Intro to Quantitative SDM c⃝ 2013 by Erik Pruyt
defined by their inflows, outflows, and initial values. A stock varia...
c⃝ 2013 by Erik Pruyt RUN-UP: Intro to Quantitative SDM
Flow equations are not limited to these ‘common’ flow equations. Sp...
RUN-UP: Intro to Quantitative SDM c⃝ 2013 by Erik Pruyt
In fact, it is good practice to include as little as possible, but...
c⃝ 2013 by Erik Pruyt RUN-UP: Intro to Quantitative SDM
systems are dynamic, tightly coupled, governed by feedback, nonlin...
RUN-UP: Intro to Quantitative SDM c⃝ 2013 by Erik Pruyt
There are several approaches for designing and testing policies. I...
Flexible E-Book for Blended Learning with Online Materials
Although this e-book is first and foremost an electronic case bo...
Upcoming SlideShare
Loading in...5

System Dynamics Models: Elementary System Dynamics Modeling


Published on

Published in: Education
  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

System Dynamics Models: Elementary System Dynamics Modeling

  1. 1. Small System Dynamics Models for Big Issues Triple Jump towards Real-World Dynamic Complexity Erik Pruyt | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |$| | | First time readers: start with the preface | |
  2. 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 insufficient for constructing useful models. But what justification 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 effective social systems directly without first going through a model-building experimental phase. But I am confident, 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 effective 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- cific structural elements (positive and negative feedback loops and causally linked stock/flow/delay structures), hard and soft variables, and logical parameter estimates– and simulating the dynamic behavior of problem/client-centered models to study, explain and/or manage the complex dynamic behavior of aggregate social-technical 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 affected by their inflows and outflows: they can be increased by increasing their inflows as well as by decreasing their outflows, and they can be decreased by decreasing their inflows as well as by increasing their outflows (Meadows 2009, p22). Stock variables are thus 85
  3. 3. RUN-UP: Intro to Quantitative SDM c⃝ 2013 by Erik Pruyt defined by their inflows, outflows, and initial values. A stock variable is in fact the accumulation of its inflows minus its outflows 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 difference of the inflow(s) ax and outflow(s) bx over the time interval considered: x = x0 + t∫ t0 (+ax − bx) dt Figure 5.1: A basic stock/flow diagram with a stock, a flow, an auxiliary variable and a constant The behavior of stock variables differs from the behavior of other flow and auxiliary variables precisely due to the fact that they are integral equations. They generally change slowly, even when their inflows or outflows change heavily or abruptly. Stocks thus buffer and delay. They could consequently be used as shock absorbers (Meadows 2009, p23) both to the inflow side and to the outflow side: stocks allow inflows and outflows 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 flows that enter or leave a stock variable affect it during simulation. Although these flows are preferably labeled and visualized either as inflows or as outflows, they can also –unless protected for example with a max(. . . ,0) or softmax function (see chapter 9)– become negative, thus turning an outflow into an inflow and vice versa. Flows can also connect two stock variables, flowing out of a first stock and flowing into a second stock. Since a stock variable corresponds to the integral of all its inflows and outflows, the inverse is also true: the net flow, i.e. the sum of all flows connected to a stock, describes the state changes of the stock over time. That is, the net flow corresponds to a differential equation in spite of the fact that it is not written as a differential equation in the equation editor. In fact, a normal equation must be specified for each flow variable. Following flow equations are often used: 1. flow = (variable−stock)/constant. This is a classic flow proportional to a deficit 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 flow proportional to the corresponding stock. The coefficient could for example be 1/average residence time in the stock. 3. flow = normal flow+effect. This is an additive flow independent from the corresponding stock. Note that the normal flow and the effect have the same units as the flow. 4. flow = normalflow ∗ effect. This is a multiplicative flow independent from the corre- sponding stock. Note that the normal flow has the same units as the flow and that the multiplicative effect must be dimensionless. This equation is often used for percentage changes and/or when it should be possible to shut the flow down (coefficient = 0). | | | | | | | | | | | | | | | | | | | | | | |STOP | 86 | | | | | | | | | | | | | | |$| | |
  4. 4. c⃝ 2013 by Erik Pruyt RUN-UP: Intro to Quantitative SDM Flow equations are not limited to these ‘common’ flow equations. Special functions such as the ones discussed in chapter 9 are commonly used in flow equations too. Be careful though with complicated equations and net flows, especially in case of multiplicative effects. In fact, it is wise to work as little as possible with net flows. Also avoid causal links between flows, except in case of co-flows and delay functions using stock-flow structures (see chapter 9). Finally, all flows into and out of the same stock variable need to have the same units. Auxiliaries Auxiliary variables help to keep flow 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 specified, 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 effects of assumptions, and hence, generate insights and understanding. Omitting them is equivalent to ‘saying they have zero effect – 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 influenced 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 non-linear/chaotic models– sensitivity and uncertainty analyses. Elementary Model Building and Model Specification Stock variables are usually very important variables. Hence, it makes sense to first model a stock variable or a set of stock variables, then connect inflows and outflows that influence this/these stock variable(s), as well as separately modeled initial value(s). Subsequently add auxiliaries and parameters/constants that influence the flows, and connect them by means of causal links. Simultaneously or subsequently specify the equations. And then simulate and test the first 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, first include a submodel as an exogenous parameters/variable, then replace the exogenous parameter/variable by an endogenous variable (e.g. a graph function), and finally, turn the en- dogenous variable into a full submodel if needed, and (iii) first use simple structures and functions and gradually refine 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. 5. RUN-UP: 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 superfluous 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 well-known 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 ill-known 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, Runge-Kutta4 (RK4), and Runge-Kutta4 auto (RK4 auto). Euler is best for models with very discrete functions. But for many models and patterns, Euler is insufficiently 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 trade-off between integration errors and round-off 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 final 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, self-correcting, 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 near-term disaster may be the best hope for the long-term future’. | | | | | | | | | | | | | | | | | | | | | | |STOP | 88 | | | | | | | | | | | | | | |$| | |
  6. 6. c⃝ 2013 by Erik Pruyt RUN-UP: Intro to Quantitative SDM systems are dynamic, tightly coupled, governed by feedback, nonlinear, history-dependent, self- organizing, adaptive, counterintuitive, policy resistant and characterized by trade-offs (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 first needs to turn to model testing. Model testing is a process to uncover errors, improve models, learn, and build confidence 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 confidence in the model and its usefulness for the intended purpose. Model testing consists of model verification and model validation. Model verification 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 confidence in its fitness for purpose, that is, confidence 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. 7. RUN-UP: 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 effects 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 e-book and will be dealt with in a follow-up 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 model-based structural changes –in decreasing order of effectiveness– include: 1. adding/breaking/changing feedback loops related to information flows, decision routines, boundaries of responsibility,. . . 2. adding/breaking/changing (physical) stock-flow structures; 3. strengthening/weakening feedback loops and/or flow variables; 4. changing high leverage policy parameters, i.e. parameters that can be controlled by those involved and that have large effects for relatively small changes. The latter can be identified by means of sensitivity analysis (see chapter 13). 5.5 Elementary Interpretation A SD model is ‘a simplification 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 reflection 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 significantly and robustly improve behavior patterns. Additional (non-mandatory) chapters: III. Introduction to System Dynamics V. Model Formulation 4by using the experience and intuition of both system actors and analysts | | | | | | | | | | | | | | | | | | | | | | |STOP | 90 | | | | | | | | | | | | | | |$| | |
  8. 8. Flexible E-Book for Blended Learning with Online Materials Although this e-book is first and foremost an electronic case book, it is much more than just a set of case descriptions: it is the backbone of an online blended-learning 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 figures), hundreds of online multiple choice questions, links to on-site 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 e-version 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 e-book version: