






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Modeling and simulation modeling 1
In this chapter we will talk about modeling in general, types of models, and then focus on simulation modeling.
Modeling is one of the ways to solve problems that appear in the real world. In many cases we cannot afford finding the right solutions by experimenting with real objects: building, destroying, making changes may be too expensive, dangerous, or just impossible. If this is so, we leave the real world and go up to the world of models, see Figure 1.1. We build a model of a real system: its representation in a modeling language. This process assumes abstraction: we throw away the details that (we think) are irrelevant to the problem we are trying to solve and keep what we think is important. The model is always less complex than the original system.
Figure 1.1 Modeling
2 The Big Book of Simulation Modeling · Multimethod Modeling with AnyLogic 8
The phase of building the model, that is mapping the real world to the world of models, choosing the abstraction level and the modeling language (= the method) is a less formalized thing in the whole process of using models to solve problems. This is still more an art than a science.
Having built the model (or sometimes even while building the model), we start to explore and understand the structure and behavior of the original system, test how the system will behave under various conditions, play and compare different scenarios, optimize. When we find the solution we are looking for, we map that solution back to the real world.
The whole modeling thing is actually about finding the way from the problem to its solution through a risk-free world where we are allowed to make mistakes, undo things, go back in time, and start all over again.
There are many different types of models that we build. Consider Figure 1.2. Everybody builds mental models every day. A mental model is your understanding of how things work in the real world: friends, family, colleagues, car drivers, town where you live, things that you buy, economy, sports, politics, your own body. Decisions like what to say to your kid, what to eat for breakfast, who to vote for, or where to take your girlfriend tonight are all based on mental models.
Figure 1.2 Types of models
An org chart of a company drawn using boxes with arrows is a model. You can use it to explain the structure of the organization, you can move people from one position
Boxes and arrows
Formulas on a sheet of paper
Physical models
Spreadsheets Computer simulation models
Mental models
4 The Big Book of Simulation Modeling · Multimethod Modeling with AnyLogic 8
Figure 1.3 Analytical model (Excel spreadsheet)
The technology behind the spreadsheet-based modeling is simple: there are cells where you enter the model inputs and there are other cells where you view the outputs. The output values are linked to the input ones via chains of formulas and, in more complex models, scripts. Various add-ons allow you to perform parameter variation, Monte Carlo, or optimization experiments.
There is, however, a large class of problems where the analytic (formula-based) solution does not exist or is very hard to find. This class, in particular, includes dynamic systems featuring:
X 1 X 2 X 3 X 4
Y Y Y Y
Formulas and scripts
Inputs Outputs
Modeling and simulation modeling 5
Formulas that are good for expressing static dependencies between variables, fail to work when it comes to describing the systems with dynamic behavior. This is the time for another modeling technology that is specifically designed for analyzing dynamic systems, namely for simulation modeling.
The simulation model is always an executable model : you can run it and it will build you a trajectory of the systems state changes over time. You can consider a simulation model as a set of rules that tell how to obtain the next state of the system from the current state. Those rules can be of many different forms: differential equations, statecharts, process flowcharts, schedules, etc. The outputs of the model are produced and observed as the model is running.
Figure 1.4 Simulation model
Simulation modeling is done with special software tools that employ simulation- specific languages, both graphic and textual. It typically requires some training and learning. But the efforts invested in adoption of simulation technology pay off when you need to perform high quality analysis of a system with dynamic behavior.
People (especially those who count themselves as Excel professionals and have some programming background), nevertheless, sometimes still try to build spreadsheet models of dynamic systems. As they feel the need to capture more details, they inevitably start reproducing the functionality of simulators in Excel. The models become huge and unmanageable. These monsters are full of code, they're slow, they have very short lifetimes, and they are usually soon discarded.
To illustrate the power of simulation and to better understand the limits of analytical modeling it is worth spending some time on queuing theory. Queuing theory is a mathematical approach to the analysis of dynamic systems with queues,
X 1 X 2 X 3 X 4
Y Y Y Y
Rules to obtain the next state of the system from the current state
…
… …
…
time
Trajectory of the system in time
Inputs Outputs
Modeling and simulation modeling 7
another formula for the waiting time that is valid in case of arbitrary distributed service time: Pollaczek–Khinchine formula.
Suppose now that there is not one but three cashiers in the bank. This does not seem to be a big change in the service system. The analytic solution however starts look scary, see case M/M/K. And, moreover, it exists only in the case of exponentially distributed service time. For any other distribution there are no formulas.
And this is it. Any further complication of the bank service process does not have an analytic solution.
8 The Big Book of Simulation Modeling · Multimethod Modeling with AnyLogic 8
Figure 1.6 Queuing models of a bank
Arrivals
Queue Server (cashier)
Poisson stream (independent arrivals)
Service time exponentially distributed
Arbitrary distribution of service time
Complex operations like collect new credit card
Simple operations like check cashing
Average queue length*: L = λ W (Little's law)
Average waiting time: μ λ
ρ −
W =
where Cz is coefficient of variation of service time
Average waiting time:
( ) 2 ( 1 )
1 2
2
μ ρ
λ −
= z
C W
Multiple ( K ) cashiers
Service time exponentially distributed
0 !( 1 )
( ) P K
K P
K
ρ
ρ −
=
1 1
0
(^0)!
( ) !( 1 )
( ) − −
=
−
K
i
K i
i
K K
K P
ρ ρ
ρ
Average waiting time: μ ( 1 − ρ )
= K
P W
Arbitrary distribution of service time
Analytic solution does not exist
M/M/
M/G/
M/M/K
M/G/K
Pollaczek–Khinchine formula:
*These formulas are valid for all cases
Any further complication of the service process
Analytic solution does not exist
10 The Big Book of Simulation Modeling · Multimethod Modeling with AnyLogic 8
Simulation modeling, on the contrary, can handle service systems of any complexity. Simulation models scale well: adding more details to the service process or making a local change is captured by a corresponding incremental or local change in the simulation model rather than by re-creation of the model from scratch. At the top of Figure 1.7 you can see the simulation model for a bank with an arbitrary number of cashiers, Poisson arrivals and service time with the empirical distribution (M/G/K). At the bottom of Figure 1.7 the model is extended to include printing in a certain percent of cases and sharing a printer between cashiers.
There are six advantages to simulation modeling:
Simulation modeling has accumulated a large number of success stories in a very wide and diverse range of applications. And, as new modeling methods and technologies are being developed, and as computer power grows, simulation penetrates new areas.
Modeling and simulation modeling 11
Figure 1.8 Applications of simulation
In Figure 1.8 some applications of simulation are shown sorted by the abstraction level of the corresponding models. The models at the bottom are physical-level models where real-world objects are represented with maximum details. At this level we do care about physical interaction, dimensions, speeds, distances, timings. Anti-lock braking system of a car, evacuation of football fans from a stadium, car traffic at an intersection controlled by a traffic light, soldier interaction on a battlefield would be examples of problems that require modeling at a low abstraction level.
The models at the top of the chart are highly abstract. Individual objects are typically replaced there by aggregates. For example, instead of modeling each individual consumer we model the number of consumers, maybe divided into several categories; we model the number of jobs instead of individual jobs, etc. Correspondingly, interaction between the model objects is raised to a high level. In these models the amount of money invested into advertising may directly influence sales, and we do not model the intermediate steps in that causal dependency.
And there are models whose abstraction level is intermediate between low and high. For example, in a model of a hospital emergency department physical space may matter as we do care how long it takes to walk from the emergency care room to X-ray, but physical interaction between people walking in the building is irrelevant because we assume there are no congestions in the building. In a model of a business process or a call center we model the sequence and duration of
High abstraction level (minimum details, macro level, strategic level)
Low abstraction level (maximum details, micro level, operational level)
Medium abstraction level (medium details, meso level, tactical level)
Aggregates, feedback loops, high level influences, …
Individual objects, exact sizes, speeds, distances, timing…
Social systems Market and competition Project management
Ecosystems
Human resources Fleet management
Transportation
Supply chains
Warehouses
Multimodal terminals Airports Rail yards (^) Manufacturing
Battlefield ^ Traffic (microscopic) Pedestrian movement Computer hardware Control systems
Business processes
Call centers
Economics
Hospitals