System Dynamics Models: Basic System Dynamics Model Formulation


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: Basic System Dynamics Model Formulation

  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 9 Basic System Dynamics Model Formulation ‘He who would learn to fly one day must first learn to stand and walk and run and climb and dance; one cannot fly into flying.’ 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 Predefined Functions Following simple functions are extremely useful in SD models1 : Time is a predefined 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 predefined 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 predefined 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 predefined 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 floor 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 1E-6, then it return 0.0. 1Vensim notations and definitions are followed here. Other packages have equivalent as well as different functions. Equivalent versions of this chapter written for other packages are available online. 119
  3. 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 1E-6, 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 first 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 floors. 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, different types of GRAPH function in Powersim,. . . ) allow to easily specify non-linear relationships between two vari- ables. They can be entered graphically or using couples. Specific points that require attention are the y and x values equal 0 and 1 and as well as extreme values. For multiplicative effects, the normal y value is equal to 1 and for additive effects, 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 predefined 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 STEP-like behaviors: STEP, RAMP, PULSE with a memory structure, IF THEN ELSE, WITH LOOKUP, GET XLS DATA, GET XLS LOOKUP. Similarly, SIN, PULSE TRAIN, STEP-STEP, 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 fluctuations or seasonal behaviors. And XIDZ, ZIDZ, MIN, MAX, MINMAX, Softmin, Softmax, and IF THEN ELSE are alternatives for setting floors and/or ceilings. The least discrete functions that allow for good enough a representation of the real effect should be chosen. Often, submodels could be formulated that endogenously generate the effect 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 differences be- tween them are (i) their different 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. 4. c⃝ 2013 by Erik Pruyt HOP: Basic SD Model Formulation Figure 9.1: A 1st order material delay as a stock-flow structure (left) and as a function (right) material delays and information delays to differ significantly, due to their fundamentally different structures and conservation principles. Figure 9.1 shows a first order material delay structure. The input of the delay structure is the inflow of new SD workshoppers. The output of the delay structure is the outflow 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 first order delay thus corresponds to a traditional outflow 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. Predefined delay functions are especially useful for higher order delays, which are mostly used since first 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 inflow of a material delay needs to be nonnegative. Figure 9.2: A 1st order information delay as a stock-flow structure (left) and as a function (right) Figure 9.2 shows a first order information delay structure. The smoothed variable is the smoothed equivalent of the variable to be smoothed. The flow equation is the same as the flow equation of the classic flow 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 infinite 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. 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 different orders and types of delays are not shown here on purpose: in exercise 10.4 you have to discover for yourself what the effects of all sorts of delays on all sorts of inputs are. 9.3 Core Model Structures Many models contain archetypical stock-flow and feedback loop structures that are very similar for very different topics. Examples are: Aging chains and recycling chains; Co-flow structures; Diffusion / 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 Non-linearities SD models and SD model behaviors are (almost always) nonlinear. Nonlinearities are often included in SD models by means of non-linear (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 e-book. Additional (non-mandatory) chapters: V. Model Formulation | | | | | | | | | | | | | | | | | | | | | | |STOP | 122 | | | | | | | | | | | | | | |$| | |
  6. 6. 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: