System dynamics
Definition
◼ System Dynamics is mostly used
in long-term, strategic models
and assumes high level of
aggregation of objects being
modeled:
people, products, events, and other
discrete items are represented in
SD models by their quantities.
◼ In short: Quantities are
important, details are not 2
Definition
◼ Important things to know about system dynamics modeling:
• as long as the model works only with aggregates, the items in that same
stock are indistinguishable, they do not have individuality;
• the modeler must think in terms of global structural dependencies and must
provide accurate quantitative data for them.
3
Stock
◼ Stocks are used to represent the real-world processes:
E.g.: stocks of material, knowledge, people, money …
◼ In Anylogic, equations for stocks are constructed automatically from the
graphical structure, and can optionally be typed manually.
4
Flow
◼ Flows define rate of change of the stocks
How the value of stocks change in time.
◼ Flows may:
flow out of one stock and flow in another
flow into stock from “nowhere” (In this
case the cloud is drawn at the starting
point of the flow)
flow out from a stock to “nowhere” (In
this case the cloud is drawn at the end
point of the flow) 5
Examples of stocks and flows
6
Dynamic Variable and Parameter
◼ It is recommended to include variables and not only stocks and flows in the
model.
◼ Dynamic variables are intermediate concepts that consist of functions of
stocks or constants.
It is recommended to use a parameter if it is a constant.
◼ A dynamic variable should have a name and an equation
Ctrl+space is a helpful tool to find stocks, flows or other variables to
include in the equation
A dynamic variable value can be defined as an array if needed (e.g: for
coordinates…) 7
Link
◼ Link is used to define a dependency between elements of a stock and flow
diagram. There are two types of dependencies:
Some element (stock, flow, dynamic variable or parameter) is mentioned
in a formula of a flow or a dynamic variable. This type of a link is drawn
with a solid line:
Some element is mentioned in the initial value of the stock. This type of
link is drawn with a dotted line:
8
Loop
◼ Loop is just a graphical identifier that shows information about existing causal
dependencies.
◼ Loops can be:
Reinforcing: if one end up with the same result as the initial assumption
Balancing: if the result contradicts the initial assumption.
9
Dimensions
◼ Dimensions are used for defining dimensions of array variables.
◼ They can be:
Enumerations: A list of named items allowing yu to refer to the array
elements: E.G: Age can have the elements: Child, Teenager, Adult, Aged.
Ranges: ranges are interval definitions that can be used to specify
dimensions for array variables.
When you define an array using enumerations, you can refer to the
elements of the array using self-descriptive names of enumeration
elements. When defining arrays using numerical ranges, you access array
elements by index numbers. 10
Useful SD functions
◼ These functions can be used when defining an equation for the Flows,
Variables, etc…
◼ Delay(flow,delaytime) simply replicates the values of the flow after a duration
of delaytime, where:
flow can be a flow variable or a numeric expression
delaytime can be either a constant or a numeric expression
E.g: DiscardRate = delay(AdoptionRate, ProductLifeTime)
11
Useful SD functions
◼ pulse (double startTime, double pulseWidth) is a function that returns 1,
starting at startTime, and lasting for interval pulseWidth; 0 is returned at all
other times.
◼ Ramp(double slope, double startTime, double endTime) is a function that
start at 0 until startTime and then slopes upword until endTime and holds
constant.
◼ Step(double height, double stepTime) returns 0 until stepTIme and then
returns height
12
Useful SD functions
◼ Smooth(input, delayTime, initialValue) is the system dynamics function that
returns an exponential smooth of the input, where:
Input can be a flow variable or a numeric expression
Delaytime is either a constant pr a numeric expression
13