Simulation
Simulation
Simulation
– Simulation is “method
of last resort?” Maybe
…
– But with simulation
there’s no need (or less
need) to “look where
the light is”
Work With the System?
– Advantage — unquestionably
looking at the right thing
But it’s often impossible to do so in
reality with the actual system
– System doesn’t exist
– Would be disruptive, expensive, or
dangerous
Slide 4 of 23
Computer Simulation
• Methods and applications to imitate or mimic real
systems usually via computer.
• No longer regarded as the approach of “last
resort”.
• Today, it is viewed as an indispensable problem-
solving methodology for engineers, designers,
and managers.
• Can be used to study simple models but should
not use it if an analytical solution is available
• Real power of simulation is in studying complex
models
Slide 5 of 23
Applications of Simulation
• Applies in many fields and industries
– Manufacturing facility
– Bank operation
– Airport operations (passengers, security, planes, crews, baggage)
– Transportation/logistics/distribution operation
– Hospital facilities (emergency room, operating room, admissions)
– Computer network
– Freeway system
– Business process (insurance office)
– Criminal justice system
– Chemical plant
– Fast-food restaurant
– Supermarket
– Theme park
– Emergency-response system
Slide 6 of 23
Advantages of Simulation
• Flexibility to model things as they are (even if messy and
complicated) - Allows uncertainty, nonstationarity in
modeling
• New policies, operating procedures can be explored
without disrupting ongoing operation of the real system.
• New hardware designs, physical layouts, transportation
systems can be tested without committing resources for
their acquisition.
• Time can be compressed or expanded to allow for a
speed-up or slow-down of the phenomenon
• Advances in simulation software, computing and
information technology are all increasing popularity of
simulation
Slide 7 of 23
The Bad News
• Don’t get exact answers, only approximations,
estimates
• Model building requires special training.
• Simulation modeling and analysis can be time
consuming and expensive.
• Simulation results can be difficult to interpret.
• Get random output (RIRO) from stochastic
simulations
Statistical design, analysis of simulation experiments
Slide 8 of 23
SIMULATION vs. OPTIMIZATION
In an optimization model, the values of the
decision variables are outputs that will
maximize (or minimize) the value of the
objective function.
In a simulation model, the values of the
decision variables (controllable ones) are
inputs. The model evaluates the objective
function for a particular set of values and
provides various performance measures.
RIRO (Random input Random Output)
Simulation Model Taxonomy
The System:
A Simple Processing System
Machine
(Server)
Arriving Departing
7 6 5 4
Blank Parts Finished Parts
Queue (FIFO) Part in Service
• General intent:
Estimate expected production
Waiting time in queue, queue length, proportion of time
machine is busy
• Time units
Can use different units in different places … must declare
Be careful to check the units when specifying inputs
Declare base time units for internal calculations, outputs
Be reasonable (interpretation, roundoff error)
Chapter 2 – Fundamental Slide 11 of 46 Simulation with
Model Specifics
• Initially (time 0) empty and idle
• Base time units: minutes
• Input data (assume given for now …), in minutes:
Part Number Arrival Time Interarrival Time Service Time
1 0.00 1.73 2.90
2 1.73 1.35 1.76
3 3.08 0.71 3.39
4 3.79 0.62 4.52
5 4.41 14.28 4.46
6 18.69 0.70 4.36
7 19.39 15.52 2.07
8 34.91 3.15 3.36
9 38.06 1.76 2.37
10 39.82 1.00 5.38
11 40.82 . .
. . . .
. . . .
• Stop when 20 minutes of (simulated) time have
passed
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
4
3
Q(t) graph 2
1
0
0 5 10 15 20
2
B(t) graph 1
0
0 5 10 15 20
Time (Minutes)
Interarrival times 1.73, 1.35, 0.71, 0.62, 14.28, 0.70, 15.52, 3.15, 1.76, 1.00, ...
Service times 2.90, 1.76, 3.39, 4.52, 4.46, 4.36, 2.07, 3.36, 2.37, 5.38, ...
Note
substantial
variability
across
replications
• Confidence intervals for expected values:
In general, X tn 1,1 / 2s / n
For expected total production, 3.80 (2.776)(1.64 / 5 )
3.80 2.04
Chapter 2 – Fundamental Slide 28 of 46 Simulation with
Steps in a Simulation Study
• Understand the system
• Be clear about the goals
• Formulate the model representation
• Translate into modeling software
• Verify “program”
• Validate model
• Design experiments
• Make runs
• Analyze, get insight, document results
Introduction 30
Steps in a Simulation
Project
Data Collection:Input Data Modeling
Introduction 33
Simulation Languages
• ARENA, Extend, AweSim, Micro Saint,
GPSS/SLX, SIMPLE++, SIMUL8 and etc.
Less flexibility
Easier to learn
More costly
Slide 34 of 23
SPECIAL PURPOSE
SIMULATION PACKAGES
NETWORK II.5: Simulator for computer
systems
MEDMODEL: Health Care
OPNET: Simulator for communication networks,
including wireless networks
SIMFACTORY: Simulator for manufacturing
operations
Advantages: Short learning cycle, No programming
Disadvantages: High Cost, Limited Flexibility
Introduction 35
Two Simulation Modeling Approaches
1. Event-Scheduling Approach
2. Process-Interaction Approach
Validation
Simulation Model
(Conceptual Model)
Verification
Simulation Program
Revise
Compare
revised model
First revision
Real of model
to reality
System Revise
Compare 2nd
revised model Second
revision
to reality of model
Revise
<Iterative process of calibrating a model>
04/14/2020 41
What can we conclude?
04/14/2020 42
Steps in a Simulation
Project
Experimental Design in Simulation
• There is a huge amount of literature on
experimental design and most of it is applicable
to simulation.
• Experimental design allows us to efficiently
explore the relationship between inputs and
outputs.
• In experimental design terminology, the input
parameters and structural assumptions are called
factors (qualitative, quantitative, controllable,
uncontrollable) and the output performance
measures are called responses.
Experimental I/O Examples
Example Inputs (factors) Outputs
(responses)
Chemical reaction Pressure Yield
Temperature
Catalyst
concentration
Growing tomatoes Fertilizer Yield
Soil pH Hardiness
Seed hybrid
Water
Simulation of a Job dispatch rule Throughput
manufacturing Number of Time in system
system machines Utilizations
Machines’ reliability Queue sizes
Mean downtimes
What Outputs (Responses) to
Collect?
There are typically two types of
output:
Discrete-Time Output Data
Continuous-Time Output Data
Discrete-time Output Data
Wi
1 2 3 .................................. N
i
Continuous-time Output Data
Can jump into system at any point in time (real,
continuous time) and take a “snapshot” of something-
there is no natural first or second observation.
2
Q (t )
1
0
t T
DIDO Vs. RIRO Simulation
Inputs: Cycle Interarrival Batch
times times sizes
Simulation Model
RIRO
X 1
X 1
X 2
X 3
X 4
X 5
Simulation with ARENA©
• What is ARENA©?
Arena is a Microsoft Windows based application
package for simulation modeling and analysis. It
is a product of Rockwell Software, Inc.
Current version: 14.5 (2014)
4 .35 2 .30
7 .25 4 .40
10 .30 6 .20
20 .10 8 .10
Using the random number sequence: 92, 44, 15, 97, 21, 80,
38, 64, 74, 08 estimate:
– the average customer waiting time ,
– average idle time of the assistant,
– the average time a car spends in the system.