Simulation and Modeling Simulation and Modeling: CPE428/CSC425
Simulation and Modeling Simulation and Modeling: CPE428/CSC425
Lecturers:
CAI Wentong HUANG Shell Ying
aswtcai@ntu edu sg
aswtcai@ntu.edu.sg assyhuang@ntu edu sg
assyhuang@ntu.edu.sg
Office: N4-B2A-03 Office: N4-02B-38
Introduction 1
Why use simulations?
• It may be too difficult, hazardous, or expensive to observe a
real, operational system
• Parts of the system may not be observable (e.g., internals of a
silicon chip or biological system)
Uses of simulations
• Analyze systems before they are built
Reduce number of design mistakes
Optimize design
• Analyze operational systems
• Create virtual environments for training, entertainment
Applications – System Analysis
3
Applications – On-line Decision Aids
interactive
simulation
environment
live analysts and
data decision makers
feeds
situation forecasting tool
database (fast simulation)
5
Course overview
• This course is primarily about the modeling and analysis of the
real-world systems using computer simulation
• In addition, we will also study doing the same thing
mathematically, if possible (?)
• This course focuses on discrete-event system simulation
• Various methods and techniques will be studied in this course
so that you will learn many useful skills in dealing many real-life
systems and problems
Introduction 6
Course overview
• Structure of the course
Introduction to modeling and simulation
Some pprogramming
g g
Di
Discrete
t eventt system
t simulation
i l ti skills
Simulation software – Arena
Statistical models in simulation Modeling and
Input modeling and output analysis Basic simulation
Queuing models mathematics
Comparing alternative system configurations
Variance-reduction techniques Basic probability
Experimental design and statistics
• Reference books
Discrete-event System Simulation, J. Banks, etc, Prentice Hall
International 5th Edition,
International, Edition 2010
Simulation Modeling and Analysis, A. M. Law and W. D. Kelton, McGraw
Hill, 4th Edition, 2007
• Marks:
M k courseworkk (30%) + exam (70%)
Introduction 7
Course overview
• Course Schedule
Introduction 8
Introduction
• The nature of simulation
• Systems,
Systems models,
models and simulation
Basic concepts, their relations, etc.
• Major
M j steps
t in
i a goodd simulation
i l ti study
t d
• Advantages, disadvantages, and pitfalls of simulation
Introduction 9
The nature of simulation
• Simulation: Imitate the operations (behavior) of a real-world system or
process over time, usually via computer programs, to evaluate and improve
system performance. Simulation involves the generation of an artificial
history of a system and the observation of that artificial history to draw
inferences concerning the operating properties of the real system.
Introduction 10
The nature of simulation
• If the model structure is simple enough, it can be “solved” by mathematical
methods, e.g., by differential calculus, probability theory, algebra, etc. –
analytical solution
• However, many real-world systems are so complex that models of these
systems are virtually impossible to solve analytically.
Must be studied via numerical, computer-based simulation, i.e., evaluate
model numerically and collect data to estimate model characteristics.
• Example: A manufacturing company considering extending its plant plant, want to
know whether the potential gain in productivity would justify the construction
cost
Build it and see if it works out?
Simulate current and expanded operations, and compare their results.
With computer simulation
simulation, we could also investigate many other issues
along the way, quickly and cheaply
Introduction 11
The nature of simulation
• Simulation applications
Very broad: Simulation is consistently ranked as one of the most
important techniques to study real-life complex systems. It has just too
many applications.
The Winter Simulation Conference (WSC,
(WSC www.wintersim.org)
www wintersim org) serves as
an excellent way to learn about the latest information on simulation
applications and theory. Some areas of the recent WSC include:
Manufacturing
M f i A Applications,
li i S
Semiconductor
i d M
Manufacturing,
f i
Construction Engineering and Project Management, Military
Applications, Logistics and Supply Chain, Transportation and Traffic,
Business Process Simulation, Health Care, etc.
Some new areas for computer simulation applications:
Human behavior modeling and simulation (e (e.g.,
g computer games)
Risk analysis (insurance, portfolio analysis, etc.)
Introduction 12
Systems, models, and simulation
• Some Basic Concepts
System: a group of objects that are joined together in some regular
interaction or interdependence toward the accomplishment of some
purpose.
Entity:
y an entityy is an object
j of interest in the system.
y
Attribute: an attribute is a property of an entity
Activity: an activity represents a time period of specified length which
may change the state of a system
State of a system: collection of variables and their values necessary to
y
describe the system at that time
Event: an instantaneous occurrence that may change the state of a
system
Introduction 13
Systems, models, and simulation
• An Example
A bank: suppose we are interested in the average customer
waiting time in the bank
System - the bank
customer waiting
Introduction 14
Systems, models, and simulation
• Different Types of Systems
Discrete System
State variables change instantaneously at separated points in time
or departs
Continuous System
S
State
a e variables
a ab es cchange
a ge co
continuously
uous y as a function
u c o o
of time
e
Example: an airplane, state variables like position, velocity change
continuously
We
W will
ill ffocus on di
discrete
t systems
t iin thi
this course
Introduction 15
Systems, models, and simulation
• Different ways to study a system
Introduction 16
Systems, models, and simulation
• Different types of simulation models: a model is a representation of a
system for the purpose of studying the system.
Static
St ti vs. dynamic
d i model:
d l a static
t ti modeld l iis used
d tto representt a system
t iin
which time simply plays no role, e.g., Monte Carlo simulation; a dynamic
model represents a system as it evolves over time, e.g., a simulation
model of a fighter jetjet.
Deterministic vs. stochastic model: if a simulation model does not
contain any probabilistic components, it is called deterministic;
otherwise,
th i it iis called
ll d stochastic.
t h ti
In queueing systems, the arrival times of customers are random
variables.
Continuous vs. discrete model: similar to continuous system vs. discrete
system
• Most operational
p models are dynamic,
y , stochastic,, and discrete – will be
called discrete-event simulation models. In this course, we will focus on
these models. Many real-life systems can be modeled as discrete-event
models.
Introduction 17
Steps in a good simulation study
4 7 Design
Formulate problem Construct a computer
1 experiment
and plan the study program and verify
Analyze
Conceptual 6 Programmed 9 output data
3 model valid? model valid?
Yes Yes
No No Document,
10 present and use
p
Introduction 18
When simulation is appropriate
• When simulation is appropriate ? general guidelines:
Decisions should be of operational (quantitative) nature
How to motivate the people? Hard to model and simulate.
Activities and events should be interdependent and variable
Deterministic systems? No need to use simulation, better find
analytical solution.
The cost impact of the decision should be greater than the
cost of doing the simulation
The
Th cost to experiment
i on the
h actuall system should
h ld bbe
(much) greater than the cost of simulation
Introduction 19
Economic justification of simulation
• Cost of making changes at subsequent stages of system development
Concept
p Design
g Implementation
p Operation
p
Cost
When simulation
is conducted System stage
• Comparison of cumulative system costs with and without simulation
Cost without
Syystem costs
simulation
Cost with simulation
Introduction 20
Impediments to the acceptance and
use of simulation
• Models of large systems are usually very complex which may require
considerable
id bl effortff t and
d expertise
ti tto b
build
ild
However, now we have better modeling software - more general, flexible,
and easy y to use
• Simulation can consume a lot of computer time, e.g., the simulation of a
complex semi-conductor manufacturing system can easily take days or even
weeks of non
non-stop
stop computing on a modern computer
However, computing speed increases very fast - this trend will continue.
In addition,, advanced computing
p g techniques
q mayy be used,, such as
parallel and distributed computing.
• The (wrong) impression that simulation is “just programming”
There’s
Th ’ a llott more tto a simulation
i l ti study
t d th
than jjustt ““coding”
di ” a model
d l iin some
software and running it to get “the answer”
Need careful design and analysis of simulation models → simulation
methodology
th d l and
d ttechniques
h i
Introduction 21
Advantages, disadvantages, and
pitfalls of simulation
• Advantages
g
Simulation is often the only type of investigation method for complex,
real-world systems
Easy to compare alternatives
Easy
E to
t control
t l experimental
i t l conditions
diti
Can study system with a very long time frame
• Disadvantages
St
Stochastic
h ti simulations
i l ti produce
d only
l estimates
ti t nott exactt ““answer””
Simulation models can be expensive to develop
Simulations usually produce large volumes of output which need to be
summarized and statistically analyzed
• Pitfalls
Failure to identify objectives clearly at the beginning
Inappropriate level of detail (both ways)
Inadequate design and analysis of simulation experiments
Inadequate education, training
Introduction 22