Introduction To Simulation
Introduction To Simulation
Introduction to Simulation
1.1
Contents
Introduction
Some examples
What is a simulation and how it is done?
What is a system?
What is a model?
Other simulation paradigms
Steps in a simulation study
1.2
Introduction to Simulation
1.3
Introduction to Simulation
Given a system, how do you evaluate its performance?
System
How to evaluate?
Measurements
Analysis
Simulation
Use existing
instance of the
system to
perform
performance
measurements.
Develop a
mathematical
abstraction of the
system and
derive formulas
which describe
the system
performance.
Develop a
computer
program which
implements a
model of the
system. Perform
experiments by
running the
computer
program.
1.4
Introduction to Simulation
How to study a system?
Measurements on an existing system
What to do, if system does not exist in reality?
What to do, if changes are very expensive or time consuming?
What to do, if system is not available?
Mathematical analysis
Good solutions, but only feasible for simple systems.
Real world systems are too complex, e.g., factory, computer, network, etc.
Simulation
Build the behavior of a system within a program
1.5
Introduction to Simulation
There are many open questions
What is a system?
What is a model?
What is performance and how to measure it?
On what does performance depend?
How to build a model?
How to numerically evaluate it?
How to interpret such results?
1.6
Some examples
1.7
Introduction to Simulation
Simulation is used to imitate the
real world
A soldier in a heavy-wheeled-vehicle
driver simulator
1.8
Introduction to Simulation
waiting time
Truck
Truck
Truck
Truck
Storehouse
Proposals
Truck
Truck
Truck
Problem
Park Slots
1.9
Introduction to Simulation
Experiment
Sliding of a ladder on the wall
A ladder is at the wall
We draw the bottom of the
ladder and the top of the ladder
is leant on the wall and slides
down.
Top
1.10
Introduction to Simulation
Variant: The ladder falls down from the wall
The resulting shape is convex
Top
Top
1.11
Introduction to Simulation
One intuitively thinks the driven shape will be concave.
However, the resulting shape is also convex.
Astonished?
Top
Top
1.12
Introduction to Simulation
Clients request some service from
a server over a network.
Client 1
Analysis
Performance of the server
Performance of the network
Network
(Internet)
Server
Client k
Attention
1.13
Introduction to Simulation
1.14
Introduction to Simulation
Mobile multi-hop ad-hoc
network (MANET)
Source node
Relay node
Destination node
1.15
Introduction to Simulation
For the analysis of a MANET
1.16
Introduction to Simulation
What about the probability
that a node is on point
p = (x,y) on the movement
area?
Uniformly distributed?
Since x and y are uniformly
selected.
1.17
1.18
Introduction to Simulation
What is a simulation?
A simulation is the imitation of the operation of a real-world
system over time.
S0
S1
S2
Time
How it is done?
Develop a model
Model consists of entities (objects)
Prof. Dr. Mesut Gne Ch. 1 Introduction to Simulation
1.19
internal interactions
Informational, organizational, and environmental changes
can be simulated to see the models behavior
Knowledge from simulations can be used to improve the
system
Observing results from simulation can give insight to
which variables are the most important ones
Simulation can be used as pedagogical device to
reinforce the learning material
Simulations can be used to verify analytical results, e.g.,
queueing systems
Animation of a simulation can show the system in action,
so that the plan can be visualized
1.20
1.21
Advantages of simulation
Policies, procedures, decision rules, information flows can be
1.22
Disadvantages of simulation
Model building requires training, it is like an art.
Compare model building with programming.
1.23
Manufacturing applications
Semiconductor manufacturing
Construction engineering and project management
Military applications
Logistics, supply chain and distribution applications
Transportation models and traffic
Business process simulation
Health care
Call-center
Computers and Networks
Games, Entertainment
...
1.24
What is a system?
1.25
Example:
Automobile factory
Machines, parts, and workers operate jointly to produce a vehicle
Computer network
User, hosts, routers, lines establish a network
1.26
Attention
It is important to decide on the boundary between the
system and the system environment
This decision depends on the purpose of the study
1.27
Components of a System
In order to understand and analyze a system, we need
some terms
General Terminology
Entity
Attribute
Activity
System state
Event
Endogenous
Exogenous
1.28
Entities
Attributes
Activities
Events
State Variables
Banking
Customers
Checkingaccount
balance
Making deposits
Draw money
Arrival;
departure
Number of busy
tellers
Number of waiting
customer
Rapid rail
Riders
Source
Destination
Traveling
Arrival at
station
Arrival at
destination
Number of riders
at each station
Number of rider in
transit
Production
Machines
Speed
Capacity
Breakdown rate
Welding
Stamping
Breakdown
Status of
machines
Communications
Messages
Length
Destination
Transmitting
Arrival at
destination
Number of waiting
messages to be
transmitted
Inventory
Warehouse
Capacity
Withdrawing
Demand
Levels of
inventory
Mobility model
Node
Position
Velocity
Travel
End of
movement
Position
Velocity
1.29
Customers waiting
Discrete Systems
Time
Head of water
Continuous Systems
Time
1.30
What is a model?
1.31
Model of a System
1.32
Model of a System
http://www.princeton.edu/~asce/const_95/ayasofya.html
Prof. Dr. Mesut Gne Ch. 1 Introduction to Simulation
1.33
Model of a System
http://www.crystalnebulae.co.uk/sunmodel.html
Prof. Dr. Mesut Gne Ch. 1 Introduction to Simulation
1.34
Model of a System
http://www.windows2universe.org/earth/Water/ocean_atmosphere_coupled_models.html
Prof. Dr. Mesut Gne Ch. 1 Introduction to Simulation
1.35
Model of a System
What is a model?
A model is a representation of a system for the purpose of
studying the system.
Approach
Input
System
Output
Consider only
those aspects of the
system that affect the
problem under investigation
Problem
Granularity of details
Models are not unique
I(t)
Model
O(t)
1.36
Model of a System
1.37
Model of a System
Physical model
Prototype of a system for the purpose of study.
1.38
Model of a System
Mathematical model
A mathematical model uses symbolic notation and
mathematical equations to represent a system.
1.39
Model of a System
1.40
Model of a System
System
How to study?
Mathematical Model
Analytical Model
Physical Model
Simulation
1.41
Model of a System
1.42
1.43
Gt Gr 2
PLdB (d ) = 10 log
2 2
(4 ) d
Assumptions:
Advantages:
Disadvantages:
-25
strong signal
-30
-35
-40
-45
-50
-55
weak signal
-60
10
15
20
distance from access point [m]
25
1.44
Application
process
Application Protocol
Application Layer
Presentation Protocol
Presentation
Layer
Session Protocol
Session Layer
Transport Protocol
Transport Layer
Application Layer
Presentation
Layer
Session Layer
Transport Layer
Network
Layer
Data Link
Layer
Network
Layer
Data Link
Layer
Physical Layer
Physical Layer
Physical Layer
Physical Layer
Network Layer
Host A
Router A
Router B
Network Layer
Host B
Internal Protocols
Prof. Dr. Mesut Gne Ch. 1 Introduction to Simulation
1.45
Application Layer
Dont exist
Transport Layer
Transport Layer
Network Layer
Internet Layer
Host-to-Network Layer
TCP/IP
1.46
Level 4
Level 3
Level 2
Level 1
Microarchitecture level
Hardware
Level 0
1.47
1.48
1.49
User/Application
Object
Packet
1.50
Principles of Modeling
Conceptualizing a model requires system knowledge, engineering
1.51
Simplicity
Credibility
Documentation
Efficiency
Verified
Code quality
Availability
1.52
Albert Einstein
1.53
Simulation Models
Simulation Model
A simulation model is a particular type of mathematical model
of a system.
1.54
Simulation Models
1.55
Simulation Models
Models
static
deterministic
dynamic
stochastic
deterministic
stochastic
Monte Carlo
Simulation
continuous
discrete
Discrete-event
Simulation
1.56
1.57
1.58
Request for
service i
Done
correctly
Rate
(Throughput)
Resources
(Utilization)
Done
Done
incorrectly
System
Cannot
do
Event k
Error j
Probability
Time between errors
1.59
User
request
System
response
Time
Response time
1.60
User
starts
request
User
finishes
request
System
starts
execution
System
starts
response
System
completes
response
User
starts next
request
Time
Think time
Reaction time
Response time
Response time
1.61
Metric
Nominal is best
Utility
Higher is better
Utility
Utility
Lower is better
Metric
Metric
1.62
1.63
1.64
differential equation
Typically involves
numerical solution of
these equations
No real difference to a
numerically based
mathematical solution
Typical example:
predator/prey systems
Let x(t) be the size of the
prey population
Let y(t) be the size of the
predator population
Interactions
dx
= r x(t ) a x(t ) y (t )
dt
dy
= s y (t ) + b x(t ) y (t )
dt
Parameters
x(0), y(0), a, b, r, s
Metrics
x(t), y(t)
Solve system of
differential equations
1.65
1.66
3. Model conceptualization
No general guide
Modeling tools in research, e.g., UML
4. Data collection
5. Model translation
6. Verified?
7. Validated?
8. Experimental design
12.Implementation
1.67
Phase 2:
Model building
and data
collection
Phase 3:
Run the model
Phase 4:
Implementation
1.68
Summary
1.69