INTRODUCTION TO MODELLING
AND SIMULATION
Goals Of This Course
History of Modeling and Simulation
Introduce Modeling
Introduce Simulation
Develop an Appreciation for the Need for
Simulation
“Learn by Doing”--Lots of Case Studies
History of Modeling and Simulation
LIVE
REHERSAL
GAMES
VIRTUAL
REALITTY
INTEROPERABILITY
SYSTEMS
ANALYSIS
DISCRETE
ENTERTAINMENT
What Is A Model ?
A Representation of an object, a
system, or an idea in some form
other than that of the entity
itself.
(Shannon)
Types of Models:
Physical
(Scale models, prototype plants,…)
Mathematical
(Analytical queueing models, linear
programs, simulation)
MATHEMATICAL MODEL
• An abstract and simplified representation of a
system
• Specifies
– Important components
– Assumptions/approximations about how the system
works
• Not an exact re-creation of the original system!
• If model is simple enough, study it with Queuing
Theory, Linear Programming, Differential
Equations...
• If model is complex, Simulation is the only way!!!
GETTING ANSWERS FROM MODELS
MODEL
Operating Policies
•Single queue, parallel servers
•FIFO
Input Parameters
•No of servers
•Inter-arrival Time Distribution
•Service Time Distributions
Output Parameters
•Waiting Times
•System Size
•Utilizations
(X) (Y)
Y = f (X)
ACTUAL SYSTEM
STOCHASTIC MODELS
• Randomness or uncertainty is inherent
• Example: Bank with customers and tellers
ACTUAL SYSTEM
µ
µ
µ
QUEUEING MODEL
λ
APPLICATIONS
Systems – facility or process, actual or planned
Examples
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
CLASSIFICATION OF SIMULATION MODELS
Static (Monte Carlo) Dynamic Systems
Represents the system at a particular point
in time
IID observations
Represents the system behaviour over time
Continuous Simulation:
• (Stochastic) Differential Equations
Discrete Event Simulation:
• System quantities (state variables) change
with events
• Estimation of π
• Risk Analysis in Business
• Water Level in a Dam
• Queueing Systems
• Inventory Systems
HOW TO SIMULATE
• By hand
– Buffon Needle and Cross Experiments (see Kelton et
al.)
• Spreadsheets
• Programming in General Purpose Languages
– Java, UML
• Simulation Languages
– SIMAN
• Simulation Packages
– Arena, MAYA, STELLA
Issue: Modeling Flexibility vs. Ease of Use
A Simulation of a system is the operation of a
model, which is a representation of that system
The imitation of the operation of a real-world
process or system over time…
– Most widely used tool for decision making
– Usually on a computer with appropriate software
– An analysis (descriptive) tool – can answer what if
questions
– A synthesis (prescriptive) tool – if complemented by
other tools
WHAT IS SIMULATION?
Applied to complex systems that are impossible
to solve mathematically
We shall focus on one form of simulation
modelling – discrete-event simulation modelling
The model is amenable to manipulation which
would be impossible, too expensive, or too
impractical to perform on the system which it
portrays.
The operation of the model can be studied, and,
from this, properties concerning the behavior of
the actual system can be inferred.
WHAT IS SIMULATION?
Applications:
Designing and analyzing manufacturing systems
Evaluating and testing H/W and S/W
requirements for a computer system
Evaluating a new military weapons system or
tactics
Determining ordering policies for an inventory
system
Designing communications systems and message
protocols for them
Applications:(continued)
Designing and operating transportation facilities
such as freeways, airports, subways, or ports
Evaluating designs for service organizations such
as hospitals, post offices, or fast-food restaurants
Analyzing - financial or economic systems
Predicting what is to come in the future based on
what you have now
Steps In Simulation and
Model Building
1. Define an achievable goal
2. Put together a complete mix of skills on
the team
3. Involve the end-user
4. Choose the appropriate simulation tools
5. Model the appropriate level(s) of detail
6. Start early to collect the necessary input
data
Steps In Simulation and Model
Building(cont’d)
7. Provide adequate and on-going
documentation
8. Develop a plan for adequate model
verification
(Did we get the “right answers ?”)
9. Develop a plan for model validation
(Did we ask the “right questions ?”)
10. Develop a plan for statistical output
analysis
Define An Achievable Goal
“To model the…” is NOT a goal!
“To model the…in order to select/determine
feasibility/…is a goal.
Goal selection is not cast in concrete
Goals change with increasing insight
Put together a complete
mix of skills on the team
We Need:
-Knowledge of the system under
investigation
-System analyst skills (model formulation)
-Model building skills (model Programming)
-Data collection skills
-Statistical skills (input data representation)
Put together a complete
mix of skills on the team(continued)
We Need:
-More statistical skills (output data analysis)
-Even more statistical skills (design of
experiments)
-Management skills (to get everyone pulling
in the same direction)
INVOLVE THE END USER
-Modeling is a selling job!
-Does anyone believe the results?
-Will anyone put the results into action?
-The End-user (your customer) can (and
must) do all of the above BUT, first he
must be convinced!
-He must believe it is HIS Model!
Choose The Appropriate Simulation
Tools
Assuming Simulation is the appropriate
means, three alternatives exist:
1.Build Model in a General Purpose
Language
2.Build Model in a General Simulation
Language
3.Use a Special Purpose Simulation Package
The Role of Computers in Simulation
 General-purpose languages
Visual Basic, C++, Java
 Special-purpose simulation languages
GPSS/H, SLAM II, SIMSCRIPT II.5
1. require less programming
2. more efficient and easier to check
for errors
3. have random number generators
built in
 Special Purpose Simulation Package
Extend, AutoMod, ALPHA/Sim, SIMUL8,STELLA, Arena, AweSim!, SLX, etc.
MODELLING W/ GENERAL PURPOSE
LANGUAGES
Advantages:
– Little or no additional software cost
– Universally available (portable)
– No additional training (Everybody knows…(language X) ! )
– Open source and free
Disadvantages:
– Every model starts from scratch
– Very little reusable code
– Long development cycle for each model
– Difficult verification phase
GEN. PURPOSE LANGUAGES USED
FOR SIMULATION
FORTRAN
– Probably more models than any other language.
PASCAL
– Not as universal as FORTRAN
MODULA
– Many improvements over PASCAL
ADA
– Department of Defense attempt at standardization
C, C++, Java
– Object-oriented programming language
MODELING W/ GENERAL
SIMULATION LANGUAGES
Advantages:
– Standardized features often needed in modeling
– Shorter development cycle for each model
– Much assistance in model verification
– Very readable code
Disadvantages:
– Higher software cost (up-front)
– Additional training required
– Limited portability
GENERAL PURPOSE SIMULATION
LANGUAGES
GPSS
– Block-structured Language
– Interpretive Execution
– FORTRAN-based (Help blocks)
– World-view: Transactions/Facilities
SIMSCRIPT II.5
– English-like Problem Description Language
– Compiled Programs
– Complete language (no other underlying
language)
– World-view: Processes/ Resources/ Continuous
GEN. PURPOSE SIMULATION
LANGUAGES (continued)
MODSIM III
– Modern Object-Oriented Language
– Modularity Compiled Programs
– Based on Modula2 (but compiles into C)
– World-view: Processes
SIMULA
– ALGOL-based Problem Description Language
– Compiled Programs
– World-view: Processes
GEN. PURPOSE SIMULATION
LANGUAGES (continued)
SLAM
– Block-structured Language
– Interpretive Execution
– FORTRAN-based (and extended)
– World-view: Network / event / continuous
CSIM
– process-oriented language
– C-based (C++ based)
– World-view: Processes
MODELING W/ SPECIAL-PURPOSE
SIMUL. PACKAGES
Advantages
– Very quick development of complex models
– Short learning cycle
– No programming--minimal errors in usage
Disadvantages
– High cost of software
– Limited scope of applicability
– Limited flexibility (may not fit your specific
application)
SPECIAL PURPOSE PACKAGES USED FOR SIMULATION
NETWORK II.5
– Simulator for computer systems
OPNET
– Simulator for communication networks, including wireless
networks
COMNET III
– Simulator for communications networks
SIMFACTORY
– Simulator for manufacturing operations
MAYA
– Simulator for computer systems
STELLA
– Simulator for manufacturing operations, computer systems etc
GIS
THE REAL COST OF SIMULATION
Many people think of the cost of a simulation only
in terms of the software package price.
There are actually at least three components to
the cost of simulation:
1. Purchase price of the software
2. Programmer / Analyst time
3. “Timeliness of Results”
ADVANTAGES OF SIMULATION
• When mathematical analysis methods are not
available, simulation may be the only
investigation tool
• When mathematical analysis methods are
available, but are so complex that simulation may
provide a simpler solution
• Allows comparisons of alternative designs or
alternative operating policies
• Allows time compression or expansion
DISADVANTAGES OF SIMULATION
• For a stochastic model, simulation estimates the
output while an analytical solution, if available,
produces the exact output
• Often expensive and time consuming to develop
• An invalid model may result with confidence in
wrong results.
The Nature of Simulation
• Impediments to acceptance, use of
simulation
–Models of large systems are usually very
complex
• But now have better modeling software … more general,
flexible, but still (relatively) easy to use
–Can consume a lot of computer time
• But now have faster, bigger, cheaper hardware to allow for
much better studies than just a few years ago … this trend
will continue
• However, simulation will also continue to push the
envelope on computing power in that we ask more and
more of our simulation models
The Nature of Simulation cont…
–Impression that simulation is “just
programming”
• There’s a lot more to a simulation study than just “coding”
a model in some software and running it to get “the
answer”
• Need careful design and analysis of simulation models –
simulation methodology
Pitfalls with Computer Simulation
• Failure to have a well-defined set of objectives at the
beginning of the simulation.
• Failure to have the entire project team involved at the
beginning of the study.
• Inappropriate level of model detail.
• Failure to communicate with management throughout
the course of the simulation study.
• Misunderstanding of simulation by the management.
• Treating simulation as if it were primarily an exercise
in computer programming.
• Failure to have people with a knowledge of simulation
methodology and statistics on the modeling team.
Pitfalls with Computer Simulation
• Failure to collect good system data, e.g. not enough
data to create a good model.
• Inappropriate simulation software.
• Belief that easy-to-use simulation tools require a
significantly lower level of technical competence.
• Failure to account correctly for sources of randomness
in the system under consideration.
• Using arbitrary random distributions as input to the
simulation.
• Analyzing the output from the simulation using
formulas that assumes independence.
Pitfalls with Computer Simulation
• Making single replication of a particular system
design and treating the output statistics as true
answers.
• Failure to have warm up period, if the steady
state behavior of a system is of interest.
• Comparing alternative system designs on the
basis of one replica for each design.
• Using wrong performance measures.

Modelling simulation (1)

  • 1.
  • 2.
    Goals Of ThisCourse History of Modeling and Simulation Introduce Modeling Introduce Simulation Develop an Appreciation for the Need for Simulation “Learn by Doing”--Lots of Case Studies
  • 3.
    History of Modelingand Simulation LIVE REHERSAL GAMES VIRTUAL REALITTY INTEROPERABILITY SYSTEMS ANALYSIS DISCRETE ENTERTAINMENT
  • 4.
    What Is AModel ? A Representation of an object, a system, or an idea in some form other than that of the entity itself. (Shannon)
  • 5.
    Types of Models: Physical (Scalemodels, prototype plants,…) Mathematical (Analytical queueing models, linear programs, simulation)
  • 6.
    MATHEMATICAL MODEL • Anabstract and simplified representation of a system • Specifies – Important components – Assumptions/approximations about how the system works • Not an exact re-creation of the original system! • If model is simple enough, study it with Queuing Theory, Linear Programming, Differential Equations... • If model is complex, Simulation is the only way!!!
  • 7.
    GETTING ANSWERS FROMMODELS MODEL Operating Policies •Single queue, parallel servers •FIFO Input Parameters •No of servers •Inter-arrival Time Distribution •Service Time Distributions Output Parameters •Waiting Times •System Size •Utilizations (X) (Y) Y = f (X) ACTUAL SYSTEM
  • 8.
    STOCHASTIC MODELS • Randomnessor uncertainty is inherent • Example: Bank with customers and tellers ACTUAL SYSTEM µ µ µ QUEUEING MODEL λ
  • 9.
    APPLICATIONS Systems – facilityor process, actual or planned Examples 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
  • 10.
    CLASSIFICATION OF SIMULATIONMODELS Static (Monte Carlo) Dynamic Systems Represents the system at a particular point in time IID observations Represents the system behaviour over time Continuous Simulation: • (Stochastic) Differential Equations Discrete Event Simulation: • System quantities (state variables) change with events • Estimation of π • Risk Analysis in Business • Water Level in a Dam • Queueing Systems • Inventory Systems
  • 11.
    HOW TO SIMULATE •By hand – Buffon Needle and Cross Experiments (see Kelton et al.) • Spreadsheets • Programming in General Purpose Languages – Java, UML • Simulation Languages – SIMAN • Simulation Packages – Arena, MAYA, STELLA Issue: Modeling Flexibility vs. Ease of Use
  • 13.
    A Simulation ofa system is the operation of a model, which is a representation of that system The imitation of the operation of a real-world process or system over time… – Most widely used tool for decision making – Usually on a computer with appropriate software – An analysis (descriptive) tool – can answer what if questions – A synthesis (prescriptive) tool – if complemented by other tools WHAT IS SIMULATION?
  • 14.
    Applied to complexsystems that are impossible to solve mathematically We shall focus on one form of simulation modelling – discrete-event simulation modelling The model is amenable to manipulation which would be impossible, too expensive, or too impractical to perform on the system which it portrays. The operation of the model can be studied, and, from this, properties concerning the behavior of the actual system can be inferred. WHAT IS SIMULATION?
  • 15.
    Applications: Designing and analyzingmanufacturing systems Evaluating and testing H/W and S/W requirements for a computer system Evaluating a new military weapons system or tactics Determining ordering policies for an inventory system Designing communications systems and message protocols for them
  • 16.
    Applications:(continued) Designing and operatingtransportation facilities such as freeways, airports, subways, or ports Evaluating designs for service organizations such as hospitals, post offices, or fast-food restaurants Analyzing - financial or economic systems Predicting what is to come in the future based on what you have now
  • 17.
    Steps In Simulationand Model Building 1. Define an achievable goal 2. Put together a complete mix of skills on the team 3. Involve the end-user 4. Choose the appropriate simulation tools 5. Model the appropriate level(s) of detail 6. Start early to collect the necessary input data
  • 18.
    Steps In Simulationand Model Building(cont’d) 7. Provide adequate and on-going documentation 8. Develop a plan for adequate model verification (Did we get the “right answers ?”) 9. Develop a plan for model validation (Did we ask the “right questions ?”) 10. Develop a plan for statistical output analysis
  • 19.
    Define An AchievableGoal “To model the…” is NOT a goal! “To model the…in order to select/determine feasibility/…is a goal. Goal selection is not cast in concrete Goals change with increasing insight
  • 20.
    Put together acomplete mix of skills on the team We Need: -Knowledge of the system under investigation -System analyst skills (model formulation) -Model building skills (model Programming) -Data collection skills -Statistical skills (input data representation)
  • 21.
    Put together acomplete mix of skills on the team(continued) We Need: -More statistical skills (output data analysis) -Even more statistical skills (design of experiments) -Management skills (to get everyone pulling in the same direction)
  • 22.
    INVOLVE THE ENDUSER -Modeling is a selling job! -Does anyone believe the results? -Will anyone put the results into action? -The End-user (your customer) can (and must) do all of the above BUT, first he must be convinced! -He must believe it is HIS Model!
  • 23.
    Choose The AppropriateSimulation Tools Assuming Simulation is the appropriate means, three alternatives exist: 1.Build Model in a General Purpose Language 2.Build Model in a General Simulation Language 3.Use a Special Purpose Simulation Package
  • 24.
    The Role ofComputers in Simulation  General-purpose languages Visual Basic, C++, Java  Special-purpose simulation languages GPSS/H, SLAM II, SIMSCRIPT II.5 1. require less programming 2. more efficient and easier to check for errors 3. have random number generators built in  Special Purpose Simulation Package Extend, AutoMod, ALPHA/Sim, SIMUL8,STELLA, Arena, AweSim!, SLX, etc.
  • 25.
    MODELLING W/ GENERALPURPOSE LANGUAGES Advantages: – Little or no additional software cost – Universally available (portable) – No additional training (Everybody knows…(language X) ! ) – Open source and free Disadvantages: – Every model starts from scratch – Very little reusable code – Long development cycle for each model – Difficult verification phase
  • 26.
    GEN. PURPOSE LANGUAGESUSED FOR SIMULATION FORTRAN – Probably more models than any other language. PASCAL – Not as universal as FORTRAN MODULA – Many improvements over PASCAL ADA – Department of Defense attempt at standardization C, C++, Java – Object-oriented programming language
  • 27.
    MODELING W/ GENERAL SIMULATIONLANGUAGES Advantages: – Standardized features often needed in modeling – Shorter development cycle for each model – Much assistance in model verification – Very readable code Disadvantages: – Higher software cost (up-front) – Additional training required – Limited portability
  • 28.
    GENERAL PURPOSE SIMULATION LANGUAGES GPSS –Block-structured Language – Interpretive Execution – FORTRAN-based (Help blocks) – World-view: Transactions/Facilities SIMSCRIPT II.5 – English-like Problem Description Language – Compiled Programs – Complete language (no other underlying language) – World-view: Processes/ Resources/ Continuous
  • 29.
    GEN. PURPOSE SIMULATION LANGUAGES(continued) MODSIM III – Modern Object-Oriented Language – Modularity Compiled Programs – Based on Modula2 (but compiles into C) – World-view: Processes SIMULA – ALGOL-based Problem Description Language – Compiled Programs – World-view: Processes
  • 30.
    GEN. PURPOSE SIMULATION LANGUAGES(continued) SLAM – Block-structured Language – Interpretive Execution – FORTRAN-based (and extended) – World-view: Network / event / continuous CSIM – process-oriented language – C-based (C++ based) – World-view: Processes
  • 31.
    MODELING W/ SPECIAL-PURPOSE SIMUL.PACKAGES Advantages – Very quick development of complex models – Short learning cycle – No programming--minimal errors in usage Disadvantages – High cost of software – Limited scope of applicability – Limited flexibility (may not fit your specific application)
  • 32.
    SPECIAL PURPOSE PACKAGESUSED FOR SIMULATION NETWORK II.5 – Simulator for computer systems OPNET – Simulator for communication networks, including wireless networks COMNET III – Simulator for communications networks SIMFACTORY – Simulator for manufacturing operations MAYA – Simulator for computer systems STELLA – Simulator for manufacturing operations, computer systems etc GIS
  • 33.
    THE REAL COSTOF SIMULATION Many people think of the cost of a simulation only in terms of the software package price. There are actually at least three components to the cost of simulation: 1. Purchase price of the software 2. Programmer / Analyst time 3. “Timeliness of Results”
  • 34.
    ADVANTAGES OF SIMULATION •When mathematical analysis methods are not available, simulation may be the only investigation tool • When mathematical analysis methods are available, but are so complex that simulation may provide a simpler solution • Allows comparisons of alternative designs or alternative operating policies • Allows time compression or expansion
  • 35.
    DISADVANTAGES OF SIMULATION •For a stochastic model, simulation estimates the output while an analytical solution, if available, produces the exact output • Often expensive and time consuming to develop • An invalid model may result with confidence in wrong results.
  • 36.
    The Nature ofSimulation • Impediments to acceptance, use of simulation –Models of large systems are usually very complex • But now have better modeling software … more general, flexible, but still (relatively) easy to use –Can consume a lot of computer time • But now have faster, bigger, cheaper hardware to allow for much better studies than just a few years ago … this trend will continue • However, simulation will also continue to push the envelope on computing power in that we ask more and more of our simulation models
  • 37.
    The Nature ofSimulation cont… –Impression that simulation is “just programming” • There’s a lot more to a simulation study than just “coding” a model in some software and running it to get “the answer” • Need careful design and analysis of simulation models – simulation methodology
  • 38.
    Pitfalls with ComputerSimulation • Failure to have a well-defined set of objectives at the beginning of the simulation. • Failure to have the entire project team involved at the beginning of the study. • Inappropriate level of model detail. • Failure to communicate with management throughout the course of the simulation study. • Misunderstanding of simulation by the management. • Treating simulation as if it were primarily an exercise in computer programming. • Failure to have people with a knowledge of simulation methodology and statistics on the modeling team.
  • 39.
    Pitfalls with ComputerSimulation • Failure to collect good system data, e.g. not enough data to create a good model. • Inappropriate simulation software. • Belief that easy-to-use simulation tools require a significantly lower level of technical competence. • Failure to account correctly for sources of randomness in the system under consideration. • Using arbitrary random distributions as input to the simulation. • Analyzing the output from the simulation using formulas that assumes independence.
  • 40.
    Pitfalls with ComputerSimulation • Making single replication of a particular system design and treating the output statistics as true answers. • Failure to have warm up period, if the steady state behavior of a system is of interest. • Comparing alternative system designs on the basis of one replica for each design. • Using wrong performance measures.