Introduction to Simulation
Chapter 1
System
The term system is derived from the Greek word systema,
which means an organized relationship among functioning
units or components.
System exists because it is designed to achieve one or more
objectives.
We come into daily contact with the transportation system,
the telephone system, the accounting system, the production
system, and for two decades the computer system.
There are more than a hundred definitions of the word
system, but most seem to have a common thread that
suggests that a system is an orderly grouping of
interdependent components linked together according to a
plan to achieve a specific objective.
System
The study of the systems concepts, then, has
three basic implications:
1. A system must be designed to achieve a
predetermined objective
2. Interrelationships and interdependence must
exist among the components
3. The objectives of the organization as a whole
have a higher priority than the objectives of its
subsystems.
System
Klir* gives a collection of 24 definitions one such
definition is “ A system is a collection of
components wherein individual components are
constrained by connecting interrelationships such
that the system as a whole fulfills some specific
functions in response to varying demands”
*Klir, George J. , an approach to general systems
theory, New York: Van Nostrand Reinhold Co,
1969
Some keywords to know …
System
It is a collection of entities that act and interact
together toward the accomplishment of some
logical end (computer, network, communication
systems, queuing systems etc.)
Simulation
It is an experiment in a computer where the real
system is replaced by the execution of the
program
It is a program that mimics (imitate) the behaviour
of the real system
Some keywords to know …
Model
It is a simplification of the reality
A (usually miniature) representation of something;
an example for imitation or emulation
A model can be Analytical (Queuing Theory) or by
Simulation.
Performance evaluation (of a system)
It means quantifying the service delivered by the
System
Experimental, Analytical, or by simulation
Introduction
System
· A system exists and operates in time and space.
Model
· A model is a simplified representation of a system at
some particular point in time or space intended to
promote understanding of the real system.
Simulation
· A simulation is the manipulation of a model in such a
way that it operates on time or space to compress it,
thus enabling one to perceive the interactions that
would not otherwise be apparent because of their
separation in time or space.
10
Examples
Models of the system
Real System (Motherboard)
Examples
Simulation models of the system
Examples
Example
Models of the System
Examples
Models of the system
Circuit Simulator
Concept of Simulation
Simulation is the representation of a real life
system by another system, which depicts the
important characteristics of the real system and
allows experimentation on it.
In another word simulation is an imitation of the
reality.
Simulation has long been used by the
researchers, analysts, designers and other
professionals in the physical and non-physical
experimentations and investigations.
16
Simulation
“A simulation is the imitation of the operation of
a real world process or system over time.
Whether done by hand or on a computer,
simulation involves the generation of an
artificial history of a system and the
observation of that artificial history to draw
inferences concerning the operating
characteristics of the real system.”
Why Simulate?
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
17
Modeling
• “Modeling is the use of mathematical techniques,
specialized hardware and engineering judgment to
create a representative stand for a real world
environment, device, system or behavior.”
•Modeling of system could be categorized into 2
main tasks:
-Establishing model structure: determines system
boundaries, identify attributes, entities and
activities of system.
-Supplying the data: provide the values for the
attributes and define relationship involved in the
activities.
When to use Simulation? When Simulation is
appropriate tool?
Following are some of the purposes for which
simulation may be used.
1. Simulation is very useful for experiments with the
internal interactions of a complex system, or of a
subsystem within a complex system.
2. Simulation can be employed to experiment with new
designs and policies, before implementing
3. Simulation can be used to verify the results obtained
by analytical methods and reinforce the analytical
techniques.
4. Simulation is very useful in determining the
influence of changes in input variables on the
output of the system.
5. Simulation helps in suggesting modifications in the
system under investigation for its optimal
performance.
6. Simulation models designed for training allow
18
learning without cost and disruption of on-the-job
learning.
When not to use Simulation?
When Simulation is not appropriate tool?
•When problem can be solved using common
sense.
•If problem can be solved analytically.
•If it is easier to perform direct experiments.
•If cost exceeds savings.
•If resources or time are not available.
•If data is not available.
•If simulation cannot be verified and validated.
•If managers have unreasonable expectations.
•If system behavior is too complex or can’t be
defined.
Types of Simulation Models
System model
deterministic stochastic
static dynamic static dynamic
Monte Carlo
simulation
continuous discrete continuous discrete
Continuous Discrete-event Continuous Discrete-event
simulation simulation simulation simulation
Types of Simulation Models
Simulation models can be classified as being static or
dynamic, deterministic or stochastic and discrete or
continuous.
A Static simulation model represents a system, which does
not change with time or represents the system at a particular
point in time.
Dynamic simulation models represent systems as
they change over time.
Deterministic models have a known set of inputs,
which result into unique set of outputs.
In Stochastic model, there are one or more random
input variables, which lead to random outputs.
System in which the state of the system changes
continuously with time are called Continuous systems
while the systems in which the state changes abruptly at
discrete points in time called Discrete systems.
20
Stochastic vs. Deterministic
Stochastic simulation: a simulation that contains
random (probabilistic) elements,
Examples
Inter-arrival time or service time of customers at a restaurant
or store
Amount of time required to service a customer
Output is a random quantity (multiple runs required
to analyze output)
Deterministic simulation: a simulation containing
no random elements
Examples
Simulation of a digital circuit
Simulation of a chemical reaction based on differential
equations
Output is deterministic for a given set of inputs
Static vs. Dynamic Models
Static models
Model where time is not a significant variable
Examples
Determine the probability of a winning solitaire hand
Static + stochastic = Monte Carlo simulation
Statistical sampling to develop approximate solutions to
numerical problems
Dynamic models
Model focusing on the evolution of the system under
investigation over time
Main focus of this course
Differences between static
modeling and dynamic modeling
The most notable difference between static and
dynamic models of a system is that while a dynamic
model refers to runtime model of the system, static
model is the model of the system not during runtime.
Another difference lies in the use of differential
equations in dynamic model
Dynamic models keep changing with reference to
time whereas static models are at equilibrium of in a
steady state.
Static model is more structural than behavioral while
dynamic model is a representation of the behavior of
the static components of the system.
Differences between static
modeling and dynamic modeling
Static modeling includes class diagram and object
diagrams and help in depicting static constituents of the
system.
Dynamic modeling on the other hand consists of sequence
of operations, state changes, activities, interactions and
memory.
Static modeling is more rigid than dynamic modeling as it is
a time independent view of a system.
It cannot be changed in real time and this is why it is
referred to as static modeling.
Dynamic modeling is flexible as it can change with time as
it shows what an object does with many possibilities that
might arise in time.
Continuous vs. Discrete
Discrete
State of the system is viewed as changing at discrete
points in time
An event is associated with each state transition
Events contain time stamp
Continuous
State of the system is viewed as changing
continuously across time
System typically described by a set of differential
equations
Types of Models
Models used in system studies have been
classified in many ways.
The classification that will be used here are
illustrated in the Figure 1.
. Types of models
Figure 1.
Models
Physical Mathematical
Static Dynamic Static Dynamic
Numerical Analytical Analytical Numerical
System
Simulation
Types of models
Models will first be separated into physical
models or mathematical models.
Physical models are based on some
analogy between such systems as
mechanical and electrical or electrical and
hydraulic.
In a physical model of a system, the system
attributes are represented by such
measurements as a voltage or the position of
a shaft.
Types of models
The system activities are reflected in the
physical laws that drive the model.
Mathematical models use symbolic
notation and mathematical equation to
represent a system.
The system attributes are represented by
variables, and the activities are represented
by mathematical functions that interrelate the
variables.
•Steps in simulation study
1. Problem formulation
2. Setting of objectives and overall project plan
3. Model conceptualization
4. Data collection
5. Model translation
6. Verified
7. Validated
8. Experimental design
9. Production runs and analysis
10. More runs
11. Documentation and reporting
12. Implementation
30
Problem formulation: Every study should
begin with a statement of the problem. If the
statement is provided by policymakers, or
those that have the problem, the analyst must
ensure that the problem being described is
clearly understood. If a problem statement is
being developed by the analyst, it is important
that the policymaker understand and agree
with the formulation. Although not shown in the
figure there are occasions where the problem
must be reformulated as the study progresses.
Setting of objectives and overall project
plan: The objective indicate the questions to be
answered. At this point, a determination should
be made concerning whether simulation is the
appropriate methodology for the problem as
formulated and objectives as stated. The
overall project plan should include a statement
of the alternative systems to be considered and
of a method for evaluating the effectiveness of
these alternatives. It should also include the
plans for the study in terms of the number of
people involved, the cost of the study, and the
number of days required etc.
Model conceptualization: The construction of a
model of a system is probably as much art as
science. The art of modeling is enhanced by an
ability to abstract the essential features of a
problem, to select and modify basic assumption
results. Thus, it is best to start with a simple model
and build toward greater complexity. It is not
necessary to have a one to one mapping between
the model and the real system. It is advisable to
involve the model user in model conceptualization.
Data collection: There is a constant interplay
between the construction of the model and the
collection of the needed input data. As the
complexity of the model changes, the required
data elements can also change. Also, since data
collection takes such a large portion of the total
time required to perform simulation, it is necessary
to begin it as early as possible, usually together
with the early stages of model building. The
objective of study dictates, in a large way, the kind
of data to be collected.
Model translation: Most real world systems
results in models that require a great deal of
information storage and computation, so the
model must be entered into a computer
recognizable format. We use the word
“program” even though it is possible to
accomplish the desire result in many instances
with little or no actual coding. The modeler
must decide whether to program the model in
simulation language, such as GPSS/H, or to
use special purpose simulation software.
Verified: Verification pertains to the computer
program prepared for the simulation model. Is
the computer program performing properly?
With complex models, it is difficult, if not
impossible, to translate the model successfully
in its entirety without a good deal of debugging;
if the input parameters and logical structure of
model are correctly represented in the
computer, verification has been completed. For
the most part, common sense is used in
completing this step.
Validated: Validation usually is achieved
through the calibration of the model, an
iterative process of comparing the model
against the actual system behavior and using
the discrepancies between the two, and the
insight gained, to improve the model. This
process is repeated until model accuracy is
judged acceptable.
Experimental design: The alternatives that
must be simulated must be determined. Often,
the decisions concerning which alternatives to
simulate will be a function of runs that have
been completed and analyzed. For each
system design that is simulated, decisions
need to be made concerning the length of the
initialization period, the length of simulation
runs, and the replication to be made of each
run.
Production runs and analysis: Production
runs and their subsequent analysis are used to
estimate measures of performance for the
system designs that are being simulated.
More runs: Given the analysis of runs that
have been completed, the analyst determines
whether additional runs are needed and what
design those additional experiments should
follow.
Documentation and reporting: There are two
types of documentation: program and progress.
Documentation is necessary to understand how
the model operate. Model users can change
parameters if required to determine the
relationship between input parameters and output
measures of performance. The result of all the
analysis should be reported clearly and concisely
in a final report. This will enable model users to
review the final formulation, the alternative system
that were addressed, the criterion by which the
alternatives were compared, the results of the
experiments, and the recommended solution to
the problem.
Implementation: The success of
implementation phase completely depends
upon how well the previous 11 steps are
performed. It is also contingent upon how
thoroughly the analyst has involved the
ultimate model user during the entire
simulation process. If the model user has been
thoroughly involved during the model building
process and if the model user understands the
nature of the model and its output, likelihood of
a vigorous implementation is enhanced.
STEPS IN A SIMULATION STUDY
Model
No
conceptualization Experimental
Design
Setting of Yes
Problem objectives Model Yes
Verified? Validated? Production runs
formulation and overall translation
project plan and analysis
No
Yes Yes
Data No More runs?
collection
No
Documentation
Implementation and reporting
31
Phases In Simulation Study
This process is divide into four phases
Phase1: Problem Formulation: This includes
problem formulation step.
Phase2:Model Building:This includes model
construction, data collection, programming, and
validation of model.
Phase3: Running the Model: This includes
experimental design, simulation runs and
analysis of results.
Phase4: Implementation: This includes
documentation and implementation.
32
Model Development Life Cycle
Define goals, objectives of study
Develop conceptual model
Develop specification of model Fundamentally
an iterative
process
Develop computational model
Verify model
Validate model 35
MODEL CONCEPTUALIZATION
Real World System
Assumed system
Conceptual model
Logical model
34
Develop Specification Model
A more detailed specification of the model
including more specifics
Collect data to populate model
Traffic example: Road geometry, signal timing,
expected traffic demand, driver behavior
Empirical data or probability distributions often used
Development of algorithms necessary to include
in the model
Example: Path planning for vehicles
Develop Computational Model
Executable simulation model
Software approach
General purpose programming language
Special purpose simulation language
Simulation package
Approach often depends on need for
customization and economics
Where do you make your money?
Defense vs. commercial industry
Other (non-functional) requirements
Performance
Interoperability with other models/tools/data
Verification
Did I build the model right?
Does the computational model match the
specification model?
Largely a software engineering activity
(debugging)
Not to be confused with correctness (see
model validation)!
Validation
Did I build the right model?
Does the computational model match the
actual (or envisioned) system?
Typically, compare against
Measurements of actual system
An analytic (mathematical) model of the system
Another simulation model
By necessity, always an incomplete activity!
Often can only validate portions of the model
If you can validate the simulation with 100%
certainty, why build the simulation?
Advantages of Simulation
Simulation helps to learn about real system, without having
the system at all. For example the wind tunnel testing of the
model of an aeroplane does not require a full sized plane.
Many managerial decision making problems are too complex
to be solved by mathematical programming.
In many situations experimenting with actual system may not
be possible at all. For example, it is not possible to conduct
experiment, to study the behavior of a man on the surface of
moon. In some other situations, even if experimentation is
possible, it may be too costly and risky,
In the real system, the changes we want to study may take
place too slowly or too fast to be observed conveniently.
Computer simulation can compress the performance of a
system over years into a few minutes of computer running
time.
40
Advantages of Simulation
Conversely, in systems like nuclear reactors where millions
of events take place per second, simulation can expand the
time to required level.
Through simulation, management can foresee the difficulties
and bottlenecks, which may come up due to the introduction
of new machines, equipments and processes. It thus
eliminates the need of costly trial and error method of trying
out the new concepts.
Simulation being relatively free from mathematics can easily
be understood by the operating personnel and non-technical
managers. This helps in getting the proposed plans accepted
and implemented.
Simulation Models are comparatively flexible and can be
modified to accommodate the changing environment to the 41
real situation.
Advantages of Simulation
Simulation technique is easier to use than the mathematical
models, and can be used for wide range of situations.
Extensive computer software packages are available, making
it very convenient to use fairly sophisticated simulation
models.
Simulation is a very good tool of training and has
advantageously been used for training the operating and
managerial staff in the operation of complex system.Space
engineers simulate space flights in laboratories to train the
future astronauts for working in weightless environment.
Airline pilots are given extensive training on flight simulators,
before they are allowed to handle real planes.
42
Disadvantages of Simulation
Model building requires special training. It is an art that is
learned over time and through experience. Furthermore, if
two models are constructed by two competent individuals,
they may have similarities, but it is highly unlike that they will
be the same.
Simulation results may be difficult to interpret. Since most
simulation outputs are essentially random variables, it may
be hard to determine whether an observation is a result result
of system interrelations or randomness.
Simulation is used in some cases when an analytical solution
is possible, or even preferable.
Simulation modeling and analysis can be time consuming
and expensive.
43
Areas of Applications
Manufacturing: Design analysis and optimization of
production system, materials management, capacity
planning, layout planning, and performance evaluation,
evaluation of process quality.
Business: Market analysis, prediction of consumer behavior,
and optimization of marketing strategy and logistics,
comparative evaluation of marketing campaigns.
44
Areas of Applications
Military:Testing of alternative combat strategies, air
operations, sea operations, simulated war
exercises, practicing ordinance effectiveness,
inventory management.
Healthcare applications; such as planning of health
services, expected patient density, facilities
requirement, hospital staffing , estimating the
effectiveness of a health care program.
45
Areas of Applications
Communication Applications: Such as network
design, and optimization, evaluating network
reliability, manpower planning, sizing of message
buffers.
Computer Applications: Such as designing
hardware configurations and operating system
protocols, sharing networking. Client/Server
system architecture
Economic applications: such as portfolio
management, forecasting impact of Govt. Policies
and international market fluctuations on the
economy. Budgeting and forecasting market 46
fluctuations.
Areas of Applications
Transportation applications: Design and testing of
alternative transportation policies, transportation
networks-roads, railways, airways etc. Evaluation of
timetables, traffic planning.
Environment application: Solid waste management,
performance evaluation of environmental programs,
evaluation of pollution control systems.
Biological applications; Such as population genetics
and spread of epidemics.
Business process Re-engineering: Integrating business
process re-engineering with image –based work flow,
using process modeling and analysis tool.
47
A few more applications …
War gaming: test Flight Simulator Transportation systems:
strategies; training improved operations;
urban planning
Games
Parallel computer systems: Computer communication
developing scalable software network: protocol design
Monte Carlo Simulation
• Static + stochastic = Monte Carlo simulation
• Statistical sampling to develop approximate solutions to
numerical problems
• It is an experiment on chance (use of probability)
• Uses random numbers and requires decision making
under uncertainties
• A bakery keeps records of a popular brand of cake:
Daily Demand: 0 15 25 35 45 50
Probabilty: 0.01 0.15 0.20 0.50 0.12 0.02
Given set of Random Numbers:
48,78,09,51,56,77,15,14,68 and 09
i) Using these sequences, simulate demand for next 10
days.
ii) Also find stock situation if owner made 35 cake/day.
iii) Also find average daily demand on the basis of
simulated data.
Daily Demand Probability Cumulative Random Number
Probability Interval
0 0.01 0.01 00
15 0.15 0.16 01-15
25 0.20 0.36 16-35
35 0.50 0.86 36-85
45 0.12 0.98 86-97
50 0.02 1.00 98-99
Day Random Simulated Stock
Number Demand
1 48 35 0
2 78 35 0
3 09 15 20
4 51 35 0
5 56 35 0
6 77 35 0
7 15 15 20
8 14 15 20
9 68 35 0
10 09 15 20
Total Total Stock= 80
Demand=270