0% found this document useful (0 votes)
69 views56 pages

Introduction To Model & Simulation-7th Sem

Uploaded by

om.work466
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views56 pages

Introduction To Model & Simulation-7th Sem

Uploaded by

om.work466
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 56

Modeling and Simulation

Basic Introduction
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.
 The behavior of a system as it evolves over time is studied by
developing a simulation model.
 This model usually takes the form of a set of assumptions
concerning the operation of the system.
 These assumptions are expressed in mathematical, logical,
and symbolic relationships between the entities, or objects
of interest, of the system.
 Once developed and validated, a model can be used to
investigate a wide variety of "what if" questions about the
real-world system.
WHEN SIMULATION IS THE APPROPRIATE
TOOL
 Simulation enables the study of, and experimentation
with, the internal interactions of a complex
system or of a subsystem within a complex system.
 Informational, organizational, and environmental
changes can be simulated, and the effect of these
alterations on the model's behavior can be observed.
 The knowledge gained during the designing of a
simulation model could be of great value toward
suggesting improvement in the system under
investigation.
1. Changing simulation inputs and observing the resulting outputs can
produce valuable insight into which variables are the most important and
into how variables interact.
2. Simulation can be used as a pedagogical device to reinforce analytic
solution methodologies.
3. Simulation can be used to experiment with new designs or policies
before implementation, so as to prepare for what might happen.
4. Simulation can be used to verify analytic solutions.
5. Simulating different capabilities for a machine can help
determine the requirements on it.
6. Simulation models designed for training make learning
possible without the cost and disruption of on-the-job
instruction.
7.Animation shows a system in simulated operation so that
the plan can be visualized.
8. The modem system (factory, wafer fabrication plant,
service organization, etc.) is so complex that its internal
interactions can be treated only through simulation. `
Performance Evaluation
The simulation-generated data is used
to estimate the measures of performance of the system.

Performance
Evaluation

Performance Performance
Measurement Modeling

Analytic Modeling Simulation

6
Simulation Model

7
SYSTEMS AND SYSTEM ENVIRONMENT
 To model a system, it is necessary to understand the
concept of a system and the system boundary.
 A system is defined as a group of objects that are joined
together in some regular interaction or independence
toward the accomplishment of some purpose.
 An example is a production system manufacturing auto
machines, component parts, and workers operate jointly
along an assembly line to produce a high-quality
vehicle.
 A system is often affected by changes occurring outside
the system.
 Such changes are said to occur in the system
environment. 8
 In modeling system, it is necessary to decide on the
boundary between the system and its environment.
 This decision may depend on the purpose of the
study.
 In the case of the factory system for example the
factors controlling the arrival of orders may be
considered to be outside the influence of the factory
and therefore part of environment.
 If the effect of supply on demand is to be conceded,
there will be a relationship between factory output
and arrival of order. - this relationship must be
considered an activity of the system.
9
COMPONENTS OF A SYSTEM
 In order to understand and analyze a system, a number
of terms to be defined
 An entity is an object of interest in the system.
 An attribute is a property of an entity.
 An activity represent a time period of specified length.
 Example  If a bank is being studied, customers might
be one of the entities, the balance in their checking
account might be an attribute, and making deposits
might be an activity
 The collection of entities that compose a system for
one study might only be a subset of the overall system
for another study
 For example if the bank is being studied to determine the
number of tellers needed to provide for paying and receiving ,
the system can be defined as that portion of the bank consisting
of the regular tellers and the customers waiting in the line
 If the purpose of the study is expanded to determine the number
o special tellers needed (to prepare cashier's checks to sell
traveler' s checks etc. the definition of the system must be
expanded.

11
Terminology

 A system is defined as a group of objects that


interact with each other to accomplish some purpose
— A computer system: CPU, memory, disk, bus, NIC
— An automobile factory: Machines, components parts and
workers operate jointly along assembly line
 A system is often affected by changes occurring
outside the system: system environment
— Hair salon: arrival of customers
— Warehouse: arrival of shipments, fulfilling of orders
 Effect of supply on demand: relationship between factory
output from supplier and consumption by customers

12
Terminology

 Entity
— An object of interest in the system: Machines in factory
 Attribute
— The property of an entity: speed, capacity, failure rate
 State
— A collection of variables that describe the system in any
time: status of machine (busy, idle, down,…)
 Event
— An instantaneous occurrence that might change the state
of the system: breakdown

13
Simulation Modeling

 Develop a simulation program that implements a


computational model of the system of interest
Example  Artificial Neural Network
 Run the simulation program and use the data
collected to estimate the performance measures of
interest (often involves the use of randomization)
 A system can be studied at an arbitrary level of detail

14
Advantages of Simulation

 New policies and procedures can be explored without


disrupting the ongoing operation of the real system
 New designs can be tested without committing
resources for their acquisition
 Time can be compressed or expanded to allow for a
speed-up or slow-down of the phenomenon under
study
 Insight can be obtained about the interactions of
variables, and which ones have the most impact on
system performance
 Can obtain answers to “What if…” questions
15
Disadvantages of Simulation

 Model building requires special training


— Vendors of simulation software have been actively
developing packages that contain models that only need
input (templates), which simplifies things for users
 Simulation results can be difficult to interpret
— Need proper statistical interpretation for output analysis
 Simulation modeling and analysis can be time-
consuming and expensive, both for the modeler, as
well as in compute time (if not done judiciously)

16
When Simulation Is Not Appropriate

 When the problem can be solved by common sense


 When the problem can be solved analytically
 When it is easier to perform direct experiments
 When cost of simulations exceeds (expected) savings
for the real system
 When system behavior is too complex (e.g., humans)

17
Common Mistakes in Simulation

 Poor (pseudo) random number generators


— Best to use well-known or well-understood generator
 Improper selection of seeds for PRNG
— Short periods; same seeds for all streams
 Inappropriate level of detail:
— More detail  more time  more bugs
— More parameters ≠ more accurate
 Improperly handled initial conditions (warmup)
 Improperly handled ending conditions (cooldown)
 Run-length too short to achieve steady-state
— Need proper output analysis, confidence intervals
18
Types of Simulations

 Monte Carlo simulation


 Time-stepped simulation
 Trace-driven simulation
 Discrete-event simulation
 Continuous simulation

19
Classification of Simulation Models

Static vs. dynamic

Static: E.g., Simulation solution to integral  f ( x )dx


Dynamic: Systems that evolve over time; simulation of traffic
system over morning or evening rush period
Deterministic vs. stochastic
Deterministic: No randomness; solution of complex differential
equation in aerodynamics
Stochastic (Monte Carlo): Operations of grocery store with
randomly modeled, arrivals (customers) and purchases
Continuous vs. discrete
Continuous: Differential equations; “smooth” motion of object
Discrete: Events occur at discrete times; queuing networks
Simulations Continue …
 Models can be classified as being mathematical or physical.
 A mathematical model uses symbolic notation and mathematical
equations to represent a system.
 *** A simulation model is a particular type of mathematical
model of a system
 Simulation models may be further classified as being static or
dynamic, deterministic or stochastic, and discrete or continuous.
 A static simulation model, sometimes called a Monte Carlo
simulation, represents a, system at a particular point in time.
 Dynamic simulation models represent systems as they change
over time. The simulation of a bank from 9:00 A.M. to 4:00
P.M. is an example of a dynamic simulation.
Simulations continue…
 Simulation models that contain no random variables are
classified as deterministic.
 Deterministic models have a known set of inputs, which
will result in a unique set of outputs.
 Deterministic arrivals would occur at a dentist's office if all
patients arrived at the scheduled appointment time.
 A stochastic simulation model has one or more random
variables as inputs. Random inputs lead to random
outputs.
 Since the outputs are random, they can be considered only
as estimates of the true characteristics of a model.
 The simulation of a bank would usually involve random
inter-arrival times and random service times
POISSON PROCESSES
Poisson Process

24
In probability theory and statistics, the
exponential distribution is the probability
distribution of the time between events in a
Poisson point process, i.e., a process in which
events occur continuously and independently at
a constant average rate. It is a particular case
of the gamma distribution.
Simulation Continue …

 Thus, in a stochastic simulation, the output measures-the


average number of people waiting, the average waiting
time of a customer-must be treated as statistical
estimates of the true characteristics of the system.
DISCRETE EVENT SYSTEM SIMULATION

 Discrete-event systems simulation is the modeling of


systems in which the state variable changes only at a
discrete set of points in time.
 The simulation models are analyzed by numerical
methods rather than by an analytical methods.
 Analytical methods employ the deductive reasoning of
mathematics to "solve" the model.
 For example, differential calculus can be used to
compute the minimum-cost policy for some inventory
models.
 Numerical methods employ computational procedures
to "solve" mathematical models.
27
DISCRETE EVENT SYSTEM SIMULATION Continue ..

 In the case of simulation models, which employ


numerical methods, models are "run" rather than
solved-that is, an artificial history of the system is
generated from the model assumptions, and
observations are collected to be analyzed and to
estimate the true system performance measures.

 Real-world simulation models are rather large, and the


amount of data stored and manipulated is vast, so such
runs are usually conducted with the aid of a computer.
However, much insight can be obtained by simulating
small models manually.
Discrete
System state
variable.

Continuous-system state variable.

29
STEPS IN A SIMULATION STUDY

30
STEPS IN A SIMULATION STUDY
Problem formulation.
 Every study should begin with a statement of the
problem. If the statement is provided by the
policymakers, or those that have the problem, the
analyst (System / Data) 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 policymakers
understand and agree with the formulation.
Setting of objectives and overall project plan
 The objectives indicate the questions to be answered by
simulation.
 At this point, a determination should be made concerning
whether simulation is the appropriate methodology for
the problem as formulated and objectives as stated.
 Assuming that it is decided that simulation is appropriate,
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.
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 assumptions that characterize the system, and then
to enrich and elaborate the model until a useful
approximation results.
 Thus, it is best to start with a simple model and build
toward greater complexity.
 However, the model complexity need not exceed that
required to accomplish the purposes for which the model
is intended.
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 a simulation, it is
necessary to begin it as early as possible, usually together
with the early stages of model building.
Model translation
 Most real-world systems result 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 term "program" even though it is possible to
accomplish the desired result in many instances with
little or no actual coding.
 The modeler must decide whether to program the model
in a simulation language, such as GPSSIH
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
 A model successfully in its entirety without a good deal of
debugging; if the input parameters and logical structure of
the model are correctly represented in the computer,
verification has been completed.
Validated?
 Validation usually is achieved through the
calibration of the model, an iterative process
of comparing the model against actual
system behavior and using the discrepancies
between the two, and the insights gained, to
improve the model.
 This process is repeated until model
accuracy is Judged acceptable.
Experimental design
 The alternatives that are to be simulated must be
determined.
 Often, the decision 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 number of replications
to 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.
 Simulation software including AutoStat (in AutoMod),
OptQuest (in several pieces of simulation software), Sim
Runner (in Pro Model), and WITNESS Optimizer (in
WITNESS).
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.
 Program documentation is necessary for numerous
reasons. If the program is going to be used again by the
same or different analysts.
 it could be necessary to understand how the program
operates. This Will create confidence in the program, so
that model users and policy makers can make decisions
based on the analysis.
Simulation Examples

 Monte Carlo simulation)


— Estimating π
— Craps (dice game)
 Time-stepped simulation
— Mortgage scenarios
 Trace-driven simulation
 Single-server queue (ssq1.c)
 Discrete-event simulation
-Witchcraft hair salon

42
Monte Carlo Simulation

Named after Count Montgomery de Carlo, who


was a famous Italian gambler and random-
number generator (1792-1838).

 Static simulation (no time dependency)


 To model probabilistic phenomenon
 Can be used for evaluating non-probabilistic
expressions using probabilistic methods
 Can be used for estimating quantities that are “hard”
to determine analytically or experimentally
45
Trace-Driven Simulation

 Trace = time-ordered record of events in system


 Trace-driven simulation = Trace input
 Often used in evaluating or tuning resource
management algorithms (based on real workloads):
— Paging, cache analysis, CPU scheduling, deadlock
prevention, dynamic storage allocation
 Example: Trace = start time + duration of processes
 Example: Trace = size in bytes of file written to disk
 Example: Trace = mobile device ID and call duration

46
Advantages of Trace-Driven Simulations

 Credibility
 Easy validation: compare simulation with
measurement
 Accurate workload: models correlation and
interference
 Fair comparison: better than random input
 Similarity to the actual implementation:
— trace-driven model is similar to the system
— can understand complexity of implementation

47
Disadvantages of Trace-Driven Simulations

 Complexity: more detailed


 Representativeness: workload changes with time,
equipment
 Data Collection: few minutes fill up a disk
 Instrumentation: granularity; intrusiveness
 Single Point of Validation: one trace = one point
 Difficult to change workload

48
Discrete-Event Simulation

 A simulation model with three features:


1. Stochastic:
some variables in the simulation model are random
2. Dynamic:
system state evolves over time
3. Discrete-Event:
changes in system state occur at discrete time instances

49
Discrete and Continuous Systems

 A continuous system is one in which the system state


changes continuously over time
— Example: Water level in River

50
Discrete-Event Simulation

 A simulation model in which system state evolves


over a discrete sequence of events in time
— System state changes only when an event occurs
— System state does not change between the events

Departure
Arrival

Arrival
Arrival

Restaurant Example 51
Continuous Simulation

 A simulation model in which system state evolves


continuously over time
— Time is divided to small time slices
— System state changes in every time slice

Dam Example 52
DES Model Development

 How to develop a simulation model:


1. Determine the goals and objectives
2. Build a conceptual model
3. Convert into a specification model
4. Convert into a computational model
5. Verify the model
6. Validate the model
 Typically an iterative process

53
Three Model Levels

 Conceptual Model
— Very high level (perhaps schematic diagram)
— How comprehensive should the model be?
— What are the state variables?
— Which ones are dynamic, and which are most important?
 Specification Model
— On paper: entitites, interactions, requirements, rules, etc.
— May involve equations, pseudocode, etc.
— How will the model receive input?
 Computational Model
— A computer program
— General-purpose programming language or simulation language?

54
Simulation Software

 General purpose programming languages


— Flexible and familiar
— Well suited for learning DES principles and techniques
— E.g., C++, Java
 Simulation programming languages
— Good for building models quickly
— Provide built-in features (e.g., queue structures)
— Graphics and animation provided
— Domain specific
 Network protocol simulation: ns2, Opnet
 Electrical power simulation: ETAP
 Design and engineering: Ansys, Autodesk
 Process simulation: Simul8
55
Verification and Validation

 Verification
— Computational model should be consistent with
specification model
— Did we build the model right?
 Validation
— Computational model should be consistent with the
system being analyzed
— Did we build the right model?
— Can an expert distinguish simulation output from system
output?

56

You might also like