System Dynamics
Modeling
in AnyLogic
This presentation is a part of
AnyLogic Standard Training Program
© The AnyLogic Company | www.anylogic.com
System Dynamics Jay Forrester ’50s
• Stocks, flows
̶ Interacting feedback loops
Sales
Potential
Clients
clients
+ +
B R
Sales +
+ Sales from
from Word of
Advertizing B Mouth Adoption
+ +
Advertizing + + Fraction
effectiveness Contact
Rate
Bass Diffusion Model
© The AnyLogic Company | www.anylogic.com 2
System Dynamics Jay Forrester ’50s
• Stocks, flows
̶ Interacting feedback loops
Продажи
The equivalent mathematical model:
Потен-
циальные
d( Potential clients )/dt = - Sales Клиенты
клиенты
d( Clients )/dt = Sales
+ + Всё
B R Word of Mouth
Sales = Sales from Advertizing + Sales from население
Продажи Продажи +
Sales from Advertizing = Potential clients * Advertizing effectiveness
+ из-за из-за устной
-
рекламы
Sales from Word of Mouth =B рекламы
+ Эффективность
Clients
+ * Contact Rate * + устной рекламы
( Potential clients / (Potential clients + Clients+) ) * Adoption
Эффективность Частота Fraction
рекламы контактов
Bass Diffusion Model
© The AnyLogic Company | www.anylogic.com 3
System Dynamics excels at certain things…
A B
Cause and Effect
• Representing Causality and relationships
• System dynamics allow you to represent non-physical
relationships too
• Morale -> Productivity, Advertising -> Perception,
© The AnyLogic Company | www.anylogic.com 4
System Dynamics excels at certain things…
A B
Delays
• It takes time for certain effects
• This can be from the nature of the elasticity between
variables or from the effects of other mitigating effects
• Advertising -> Perception, Actions -> Reputation, Fame -> Perception
© The AnyLogic Company | www.anylogic.com 5
System Dynamics excels at certain things…
Market
Share
Marketing
Expense Revenues
Feedback Effects
• “Practically” unique to System Dynamics, but common in
the real world
• A logic error in excel
• Reinforcing Feedback Loops and Correcting Feedback
© The AnyLogic Company | www.anylogic.com 6
Stock & flow elements in AnyLogic
© The AnyLogic Company | www.anylogic.com 7
Built-in functions you can use
Mathematical functions
abs(x) cos(x) exp(x) floor(x) limit(min,x,max) log(x)
max(a,b) min(a,b) pow(x) round(x) sin(x) sqrt(x) tan(x) …
Special system dynamics functions
delay() delay1() delay3() delayInformation()
delayMaterial() forecast() npv() npve() smooth() ramp()
smooth3() trend() …
X delay( X, T, a )
time T time
See full list of functions in AnyLogic Help -> Advanced Modeling with
Java -> AnyLogic functions -> System dynamics functions
© The AnyLogic Company | www.anylogic.com 8
Table function (lookup table)
Allows to import simple two-column data table into the
model and use it as a function: myTable( x )
Supports various interpolations and approximation
No interpolation Step interpolation
Linear interpolation Cubic spline
interpolation
© The AnyLogic Company | www.anylogic.com 9
Arrays (“subscripts”)
• Some problems require multidimensional data
d ( population)
= +immigration − emigration
dt
population
population immigration emigration
immigration
regions
gender
population immigration emigration
• AnyLogic supports array variables and equations
– May have any number of dimensions
– All arithmetic operations and most functions are supported
– All operations are element-by-element, unlike in linear algebra
© The AnyLogic Company | www.anylogic.com 10
Object-oriented SD modeling
• Originally classical SD tools:
Only allowed you to build one large flat stock & flow diagram
which easily could become unmanageable
• AnyLogic:
Naturally suggests you to build well-structured models
You can build hierarchical models
You can create reusable components of SD models
Icon Instance 1
public
Instance 2
public,
external
© The AnyLogic Company | www.anylogic.com 11
Import of Vensim® models
© The AnyLogic Company | www.anylogic.com 12
The Sacred Book of System Dynamics Modeler
John Sterman
“Business Dynamics:
Systems Thinking and Modeling
for a Complex World”
2000. McGraw Hill, 1008 pages
http://www.anylogic.com/business-dynamics-book-models
© The AnyLogic Company | www.anylogic.com 13
© The AnyLogic Company | www.anylogic.com 14