In this article, we will explore the basics of simulation and modeling. What is simulation? According to Claude, my favorite AI assistant, simulation is the imitation of real-world systems, states, or processes through computer or physical models. Wouldn’t it be incredibly useful if we could predict the real world through simulation?
This article is primarily based on the online open course Introduction to Modeling and Simulation from KAIST.
There are various public resources in the world. Notable examples include water, land, and oil. The tragedy of the commons refers to the economic and scientific situation where these shared resources, if not managed separately and consumed by individuals according to their own interests, will be depleted. This example is often used to explain simulation and modeling.
Let’s consider a scenario. There are two shepherds, each with their own flock of sheep. They are in a competitive relationship. Given that the pasture where the sheep can graze is limited, what choices should the shepherds make to maximize their own benefits?
While there are various choices, ultimately, the faster and more one consumes the shared resource (pasture) compared to the competitor, the more their benefits are maximized. If limited public goods are consumed through such choices, the result will inevitably be depletion.
How can we model this example? Let’s first define the important objects:
But unfortunately, this is not the end. We also need to define the attributes and relationships of each object:
The attributes/relationships defined here are just a part of what needs to be considered. There are many more factors to take into account.
A causal loop diagram is a tool for visually representing the causal relationships between variables in a system. It uses arrows to show relationships between variables, distinguishing between positive (+) and negative (-) relationships. When modeling for simulation, using a Causal Loop Diagram allows you to observe an abstracted view of the model.
There are three main components in a Causal Loop Diagram:
Positive/negative links can create loops, and there are two types of loops:
Without delays, modeling can be simplified and made to work ideally. However, most real-world problems include delays.
For example, if you keep placing orders because products haven’t arrived, you might end up with more products than expected. To resolve this, you might return some, but returns also have delays, which can cause similar problems as with the orders. This is called oscillations.
If the oscillations converge to the target value, the goal can be achieved, but if the error keeps growing, this is called the bullwhip effect. This is a common problem that can occur in supply chain management (SCM).
A system archetype is a conceptual model that describes recurring behavior patterns in organizations or systems. Understanding archetypes can help more easily identify and solve problems in complex systems.
You can find images and more detailed explanations of the examples below at System Archetype.
This type includes scenarios like the chicken game and arms races. There is a common factor between two loops, and this factor controls both loops. For example, if country A increases its military power, country B also needs to increase its military power, resulting in a continuous escalation effect on both sides.
This type explains the phenomenon where, in a situation with limited resources, when there are A and B, as more resources are invested in A, B’s power weakens. Both loops are reinforcing loops, but they go in different directions.
While Causal Diagrams were good for conceptually modeling scenarios, they pose challenges in terms of complexity and visibility when modeling actual complex problems. In other words, to develop from a qualitative model to a quantitative model, we need to evolve into a System Dynamics Model. This process includes mathematical definition of variables, setting initial values, and equation formulation.
You can find additional images and examples at System Dynamics.
Causal loop diagram:
Birth rate (+) --> Population --> (+) Birth rate
Population --> (+) Death rate --> (-) Population
System dynamics model:
Population(t) = Population(t-dt) + (Birth rate - Death rate) * dt
Initial Population = 1000
Birth rate = Population * Birth_rate_coefficient
Death rate = Population * Death_rate_coefficient
Birth_rate_coefficient = 0.03
Death_rate_coefficient = 0.02
In simulation, time can be modeled as continuous or discrete. A finite state machine is a model where the system has a finite number of states and transitions between states occur according to specific conditions.
These two concepts play important roles in modeling the dynamic behavior of various systems.
There are two main ways to model the flow of time in simulations:
The choice of time flow depends on the characteristics of the system being modeled and the purpose of the simulation.
A finite state machine is a mathematical model that represents the behavior of a system as a finite number of states and transitions between them.
You can find additional images and examples at Finite State Machine.
States: Waiting, Selection, Payment, Dispensing
Transitions:
Waiting -> Selection (Product button pressed)
Selection -> Payment (Money inserted)
Payment -> Dispensing (Payment completed)
Dispensing -> Waiting (Product dispensed)