Escolar Documentos
Profissional Documentos
Cultura Documentos
Mike Geller
Department of Systems
Engineering and Engineering
Management
Charles V. Schaefer Jr. School of
Engineering
Stevens Institute of Technology
Hoboken, New Jersey 07030
mgeller@stevens.edu
Lesson Objectives
Lesson Objectives
Introduction to Simulation
Introduction to Process Generators
Examples
Next Lessons
Queuing Theory
More Examples
Simulation in Practice
Getting Started
The beginning is
the most important
part of the work
(Plato, 400 B.C.)
Physical
Model
Mathematical
Model
Analytical
Solution
Simulation
What is a Model?
A model is a physical, mathematical or
logical representation of a system,
entity, phenomenon, or process.
There is no movement in a model.
Example: a plastic replica of a car, or a
mathematical equation that predicts
the probability of an event occurring
DOD Modeling and Simulation Information Analysis Center (MSIAC)
5
What is Modeling?
Classification of
Models
Physical
ConceptualMathematical
10
Classification of
Models
Physical
ConceptualMathematical
Static
Dynamic
11
Static Models
A model of a system in
which there is no change.
12
Dynamic Models
A model of a system in which
there is change, such as the
occurrence of events over time
or the movement of objects
through space.
Example: a model of a bridge
that is subjected to a
moving load to
determine
characteristics of the
DOD bridge
Modeling and
Simulation
Information Analysis Center (MSIAC)
under
changing
13
Dynamic Models
Over Time
Inputs
f(t)
Output(s)
Constants
Variables
14
Classification of
Models
Mathematical
Static
Dynamic
Continuous
Discrete
15
Continuous Models
A mathematical or
computational model
whose
output
variables change in a
continuous manner.
16
Continuous Models
EX
A
X1(t)
X2(t)
Sum
Divide
X3(t)
X4(t)
Integrator
MP
LE
y(t)
X
Multiply
y(t) =
(X1(t) +X2(t))
X3(t)X4(t)
17
Discrete Models
A
mathematical
or
computational
model
whose output variables
take on only discrete
values. a model that predicts an
Example:
organizations
inventory levels based on
varying
shipments and receipts
IEEE Standard Glossary of Modeling and Simulation Std 610.3-1989
18
What is a Simulator?
A device, computer
program, or system
that performs
simulation.
19
What is Simulation?
Simulation is the implementation of a
model over time.
It shows how the model works.
It is a technique used for testing, analysis,
or training, where a model can represent
real world systems or concepts.
A simulation moves. You can see the
model(s) in the simulation moving
whether it shows military units moving
DOD Modeling and Simulation Information Analysis Center (MSIAC)
20
Definitions
SIMULATION: a technique that imitates the operation of a realworld system as it evolves over time. Results obtained are
SAMPLE observations of sample STATISTICS.
The process of designing a mathematical or logical model of a
real-system and then conducting computer-based experiments with the
model to describe, explain, and predict the behavior of the real system
Definitions
EVENT DRIVEN SIMULATION
An event is an occurrence in a system at which
changes to a system occur.
Events take place at an instance of time.
A system is modeled by defining the events that
occur in the system and describe what takes
place at certain times.
Simulation is the only way to represent (model, test,
design, etc.) complex systems
Customer
Arrival
(Activity)
(Activity)
(Event)
(Event)
Simple
Queuing
Model
Service
Service
Waiting
Customer
Departure
End of
Service
(Activity)
(Event)
(Event)
26
Outputs
Analysis
Model
Generator
System
Data
Historical
Estimated
Hypothesis
Stochastic
Random
f(t)
Variables
time
Decision
Experiment
Hypothesis Testing
Entertainment
27
Types of
Modeling & Simulation (M&S)
Physical Models
Conceptual Models
Mathematical Models
Static Models
Dynamic Models
Continuous Systems M&S
Stochastic M&S
Continuous M&S
Systems Dynamics M&S
Discrete-event Systems M&S
Statistical M&S
Monte Carlo simulation
28
Comparisons
Discrete Event
Dynamic simulation (time
sensitive)
Event driven
Using attributes, unique
characteristics are assigned to
items which can then tracked
throughout the model
Blocking, balking, reneging
easily handled
Variability (associated with time)
captured easily
Manufacturing, service,
business processes, strategic
thinking, networks, systems
engineering, etc.
Animation is used great
verification/validation tool
Monte Carlo
Static simulation not time
axis
Random numbers must be
repeated for each
query/junction
Event driven is difficult
Blocking, balking, and
reneging is very difficult
Difficult to capture variability
as a function of time
Advantages of Simulation
The advantages of simulation are:
1) Once the model is explained, most people can
understand it and accept its results as legitimate
representations of the system under consideration (a
simulation is more "intuitive"),
2) Simulation can be used for complex, real-world
situations or conditions that are not included in
analytical models,
3) We can simulate extended periods of time in a
short period of time on a computer,
4) It is much less expensive to build something in
a computer language and experiment with the model
than it is to construct the physical system for
experimentation,
Advantages of Simulation
The advantages of simulation are:
5) Simulation allows for easier "what-if" analysis
and variations on the existing model (sensitivity
analysis),
6) Relatively straight forward; minimum cost,
7) Easier to apply than analytical methods,
8) Greater flexibility in representing the real
system - fewer simplifying assumptions,
9) Precludes loss of people lives & damage to the
environment, and
10) Model can be used repeatedly.
Disadvantages of Simulation
1) Is not an optimizer,
2) Does not lead to fundamental understanding (we
observe outcomes on a process, but may not
understand why the outcomes are as they are),
3) An abused analytical tool that is often used in lieu
of physical models,
4) The best simulation languages (most complex)
and models can be expensive and require a great
investment in time to learn the simulation program,
5) Simulation models do not provide optimal
solutions.
6) Only the conditions that are included in the model
can be examined, and
7) You may not discover fundamental relationships
that are sometimes illuminated by analytical models.
SPECIFY PERFORMANCE
CRITERIA, DECISION RULES, &
CRITICAL SYSTEM PARAMETERS
DEVELOP COMPUTER MODEL
VALIDATE MODEL
DESIGN EXPERIMENT
PERFORM SIMULATION
SIMULATION OUTPUT IN FORM
OF OPERATING STATISTICS
SIMULATION
COMPLETE?
YES
ANALYZE SIMULATION RESULTS
VALIDATE MODEL
DESIGN EXPERIMENT
PERFORM SIMULATION
SIMULATION OUTPUT IN FORM
OF OPERATING STATISTICS
SIMULATION
COMPLETE?
YES
ANALYZE SIMULATION RESULTS
37
The M&S
What are you modeling?
Process
Whats the System?
FORMULATE PROBLEM
SPECIFY PERFORMANCE
CRITERIA, DECISION RULES, &
CRITICAL SYSTEM
PARAMETERS
EX
E
L
P
M
A
Designing
a
Model
What are you modeling?
Rolling Dice?
A Dice Game?
What to include? ... What to exclude?
39
EX
E
L
P
M
A
Designing
a Model
What are you modeling?
EX
AM
PL
E
Glass?
Current water level?
Desired water level?
Faucet position?
Person filling glass?
Based on: Senge, The Fifth Discipline
VALIDATE MODEL
DESIGN EXPERIMENT
PERFORM SIMULATION
SIMULATION OUTPUT IN FORM
OF OPERATING STATISTICS
SIMULATION
COMPLETE?
YES
ANALYZE SIMULATION RESULTS
41
Develop
Model
DEVELOP MODEL
Desired
water level
EX
AM
P
LE
Person
Faucet
position
1.Conceptual
Model
E.g., Causal
Gap between
DiagramCurrent and Desired
2.More detailed
Model as
Applicable
Needed for
EX
AM
PL
E
Water Flow
Level
Current
water level
Based on: Senge, The Fifth Discipline
VALIDATE MODEL
DESIGN EXPERIMENT
Why?
PERFORM SIMULATION
SIMULATION OUTPUT IN FORM
OF OPERATING STATISTICS
SIMULATION
COMPLETE?
YES
ANALYZE SIMULATION RESULTS
43
Inputs Generated,
Expected Outputs
Why?
Make sure this correlates
with your Problem Statement
VALIDATE MODEL
DESIGN EXPERIMENT
PERFORM SIMULATION
SIMULATION OUTPUT IN FORM
OF OPERATING STATISTICS
SIMULATION
COMPLETE?
YES
ANALYZE SIMULATION RESULTS
44
VALIDATE MODEL
DESIGN EXPERIMENT
PERFORM SIMULATION
SIMULATION OUTPUT IN FORM
OF OPERATING STATISTICS
SIMULATION
COMPLETE?
YES
ANALYZE SIMULATION RESULTS
45
VALIDATE MODEL
DESIGN EXPERIMENT
PERFORM SIMULATION
Describe your
Simulation
Results
Show
Meaningful
Plots
SIMULATION
COMPLETE?
YES
ANALYZE SIMULATION RESULTS
46
VALIDATE MODEL
DESIGN EXPERIMENT
PERFORM SIMULATION
SIMULATION
COMPLETE?
YES
ANALYZE SIMULATION RESULTS
47
Results !!
VALIDATE MODEL
Develop Conclusions
Lessons Learned,
Recommendations,
Next Steps as
appropriate
DESIGN EXPERIMENT
PERFORM SIMULATION
Model
SIMULATION OUTPUT IN FORM
Strengths/Weaknes
OF OPERATING STATISTICS
ses
Make sure that your
Experiments/Results
correlate with your
Problem Statement
SIMULATION
COMPLETE?
YES
T .5
H .5
T .5
T .5
PROB
# HEADS
H .5
1/8
T .5
H .5
1/8
1/8
2
2
1/8
1/8
T .5
H .5
1/8
1/8
T .5
1/8
T .5
H .5
# HEADS (X)
P(X)
1/8
3/8
4/8 = .500
3/8
7/8 = .875
1/8
8/8 = 1.00
RANDOM #
RANGE
0 x <0.125
0.125 x <0.5
0.5 x < 0.875
0.875 x 1.0
F(x)
f(x)
3/8
1
7/8
1/8
4/8
CDF
1/8
3 X
1.00
<20
20%
X = 14
>20
>90
10%
X = 18
10%
X = 17
40%
X = 15
<90
>80
<80
20%
X = 16
<60
>60
.90 1.0
.80 - <.90
.60 - <.80
1.0
.9
.8
.6
.20 - <.60
0 - <.20
.2
0
RANDOM
NUMBER
14
15
16
17
18
55
Verification:
1. Determining that a simulation computer program performs as
intended
2. Translating the flow chart and assumptions for a model into a
correctly working program.
Validation:
Determining whether the conceptual simulation model (as opposed
to the computer program) is an accurate representation of the
system under study.
(If a model is NOT valid, then any conclusions derived from the
model will be of doubtful value.)
Number of Trials
Exponential CDF
0.8
Value
0.4
0.2
0
0
10
20
30
40
Data Point
0.8
0.6
Average
0.6
0.4
0.2
0
0
10
20
Data Point
30
40
Process Generators
12
1
Time
Between
Truck
Arrivals,
Hours
12
10
Frequency
0.75
8
6
0.50
0.25
2
0
21
12
24 30
0
0.5
0.25
0.75 1.0
Time Between Truck Arrivals, Hours
a. Sorted Observations
30/30
1.0
Cumulative
Probability
b. Histogram
0.8
21/30
24/30
Uniform
Random
Variable
Time Between
Truck Arrivals
(hours)
0.6
12/30
0.4
0.2
0
0.25
0.5
0.75
1.0
0
0.40
0.70
0.80
<
<
<
<
r
r
r
r
<
<
<
<
0.40
0.70
0.80
1.00
d. Process Generator
0.25
0.50
0.75
1.00
CALLING POPULATION:
CALLING POPULATION:
Size: Infinite
Size: Infinite
Pattern: Normal (20,8.5)
Pattern: Normal (20,8.5)
MD88:
8/92 8.7%
MD88:
8/92
8.7%
747:
27/92 29.3%
747:
27/92 29.3%
767:
57/92
62.0%
767:
57/92
62.0%
Attitude: Impatient (4% Abort)
Attitude: Impatient (4% Abort)
FLIGHT
SCHEDULES?
STORAGE
REQUIREMENTS?
SERVER:
SERVER:
Structure - Three Servers
Structure - Three Servers
Distribution - Exponential
Distribution - Exponential
747: = 4 AC/hr
747:
= 4 AC/hr
767: = 10 AC/hr
767:
= 10 AC/hr
MD88: = 20 AC/hr
MD88: = 20 AC/hr
Discipline: FCFS
Discipline: FCFS
QUEUE:
QUEUE:
Length - Unlimited
Length - Unlimited
(max of 10 will never
(max of 10 will never
be exceeded; Avg
be exceeded; Avg
Arrivals = 10/hr)
Arrivals = 10/hr)
AIRCRAFT MIX?
UNLOADING
EQUIPMENT?
LOGPACS:
600 cubic feet
747:
20 / AC
767:
10 / AC
MD88: 5 / AC
Process Generator
If there truly is not pattern then,
Demand
40
50
60
70
80
90
Probability
1/6 = .1667
1/6 = .1667
1/6 = .1667
1/6 = .1667
1/6 = .1667
1/6 = .1667
Role of Die
1
2
3
4
5
6
D = Sales Demand
Q = Boxes Purchased
Process Model
1. Determine order
quantity
2. Role the die (serves as
a random number
generator).
3. Determine demand from
model.
4. Record the profit.
5. Run enough times to
assume a normal
distribution.
Assume Order
Quantity
Profit Model
N<?
Repeat for
Various Qs and
Determine Optimum
Amount
Profit
Stop
Random
Number
Daves Results
Class Problem 1
As a newly assigned Operations Engineer, you have
developed a Self Service Supply Center (SSSC) for your
factory. You have one supply clerk to process the paper
work for the customers.
Classic Infinite
Queuing Problem
Event Driven Simulation
r1
IA Time
Total
At
Wait
Queue
Clock
Cashier
Time
Length
Time
Time
r2
Service
Depart
Time
Time
Clock
In
After Entry
System
0.06
0.93
0.47
0.72
0.3
0.83
0.97
11
0.35
0.96
14
0.17
10
10
0.2
15
0.82
13
13
0.16
16
0.63
15
15
0.5
18
0.68
17
17
0.03
19
10
0.98
21
21
0.07
22
0.8
2.6
Summary - Benefits
Solve a wide variety of complex problems
Incorporate risk analysis
Capture variability of many inputs, outputs,
and processes
Limited optimization abilities
Most widely used decision tool
Summary Limitations
Most abused decision science tool
Cannot be used for optimization
Data is more difficult to develop than model
Can be hard to explain risk and stochastic
variability to decision makers
Questions?