Professional Documents
Culture Documents
Simulation Notes Module - IV PDF
Simulation Notes Module - IV PDF
Module-IV: SIMULATION
1. Simulation (Definition):
i. Simulation means imitation of a situation or process.
ii. A simulation of a system is the operation of a model of the system.
iii. Simulation is used before an existing system is altered or a new system built, to reduce the chances
of failure.
iv. Define simulation as ‘an experiment performed on a mathematical model’.
v. Simulation is “the process of designing a model of a real system and conducting experiments with
this model for the purpose either of understanding the behavior of the system or of evaluating
various strategies for the operation of the system.”
vi. Basics of simulation, including structure, function, data generated, and its proper use.
vii. Simulation may be performed through;
1) solving a set of equations (a mathematical model),
2) Constructing a physical model,
3) Game (such as war-games), or a computer graphics model (such as an animation).
1) System: A group of objects that are joined together in some regular interaction or interdependence
toward the accomplishment of some purpose.
4) Activity: Represents a time period of specified length. Collection of operations that transform the
state of an entity. Example, making bank deposits.
5) Event: change in system state. Example arrival, beginning of a new execution, departure etc.
6) State Variables: Define the state of the system. Can restart simulation from state variables.
Example, length of the job queue.
1
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
2. System:
i. A system can be anything.
ii. A system is a collection of elements or components that are organized for a common purpose.
iii. A system is a potential source of data.
iv. An unit or process, which exists and operates in time and space through the interaction of its parts.
Components of System:
Entity : An object of interest in the system : Machines in factory
Attribute: The property of an entity : speed, capacity
Activity: A time period of specified length :welding, stamping
State Variables: A collection of variables that describe the system in any time : status of machine (busy,
idle, down,…)
Event: A instantaneous occurrence that might change the state of the system (e.g. breakdown.)
Endogenous: Activities and events occurring with the system (growing or originating from within an
System)
Exogenous: Activities and events occurring with the environment (growing or originating from outside an
organism)
Classification of a System:
2
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
We study the system by experimenting with it, but as far as concern with Simulation, we go for making a
model of it and then proceed for the simulation. According to system which is a potential source of data.so
an experiment is the process of extracting data from a system by exerting it through its inputs. Consider a
Bank is a system and their components are describes below;
Model:
3
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
Object Model
What is Modeling?
1. Continuous time models;(In continuous time models the state of a system changes continuously
over time.)
2. Discrete time models;(With discrete time models, the time axis is discretised i.e. The time-step used
in the discrete-time model is constant.)
3. Discrete event models.(In discrete-event models, the state is discretised and "jumps" in time. Events
can happen any time but only every now and then at (stochastic) time intervals.)
4
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
3. Types of Simulation:
Continuous-state simulation is applicable to systems where the notion of state is continuous and
typically involves solving (numerically) systems of differential equations. Circuit-level simulators
are an example of continuous-state simulation.
Discrete-event simulation is applicable to systems in which the state of the system changes at
discrete instants of time, with a finite number of changes occurring in any finite interval of time.
1) Deterministic models: In these models, input and output variables are not permitted to be
random variables and models are described by exact functional relationship.
2) Stochastic models: In these models, at least one of the variables or functional relationship
is given by probability functions.
3) Static models: These models do not take variable time into consideration.
4) Dynamic models: These models deal with time varying interaction.
1) Simulation models are comparatively flexible, and can be modified to adjust according to
the variation in the environments of real life situations.
2) Simulation is easier to use than mathematical models and is hence considered superior to
mathematical analysis.
3) Simulation techniques have the advantage of being relatively free from complicated
mathematics and hence, can be easily understood by the operating staff and also by non-
technical managers.
4) Simulation offers up a solution by performing virtual experimentation with a model of the
system without interfering with the real system. It thus bypasses complex mathematical
analysis.
5) Simulation compresses the performance of a system over several years, and hence performs
large calculations in a few minutes of computer running time.
5
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
6) By using simulation, management can foresee the difficulties and bottlenecks that may
arise due to addition of new machines or equipment, or by modifying a process. It
eliminates the need for costly trial and error methods of trying out a new concept on real
processes and equipment.
7) It is better to train people on a simulated model, rather than putting them to work
straightaway on the real system. Simulation develops the trainee making him experienced
and an expert, due to which the trainee now has sufficient confidence in handling the real
system.
1) Optimum results cannot be produced by simulation. Since the models only deal with
uncertainties, results of simulation are merely reliable approximations involving statistical
errors.
2) In many situations, it isn’t possible to quantify all the variables which play a role in the
system.
3) In large, complex problems involving many variables and their inter-relationships, the
capacity of the computer may not be enough to process the entire system.
4) Since computers are involved in simulation, it makes simulation a comparatively costlier
technique to use.
5) Simulation is sometimes applied to simple problems, due to over reliance on simulation,
when in fact the problems could be solved in an easier manner by some other technique
like mathematical analysis.
6
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
1) system entities,
2) input variables,
3) performance measures,
4) functional relationships.
Indeed, a simulation study is as good as the simulation model. Simulation modeling comprises the
following steps:
7
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
Step 2. Formulate the problem. Select the bounds of the system, and define overall objective of
the study and a few specific issues to be addressed.
Step 3. Collect and process real system data. Collect data on system specifications (e.g.,
bandwidth for a communication network), input variables, as well as performance of the existing
system.
Step 4. Formulate and develop a model. Develop schematics and network diagrams of the system
(How do entities flow through the system?). Translate these conceptual models to simulation
software acceptable form.
Step 5. Validate the model. Compare the model's performance under known conditions with the
performance of the real system.
Step 6. Document model for future use. Document objectives, assumptions and input variables in
detail. simulation experiment is a test or a series of tests in which meaningful changes are made to
the input variables of a simulation model so that we may observe and identify the reasons for
changes in the performance measures.
Step 7. Select appropriate experimental design. Select a performance measure, a few input
variables that are likely to influence it, and the levels of each input variable.
Step 8. Establish experimental conditions for runs. Address the question of obtaining accurate
information and the most information from each run. Determine if the system is stationary
(performance measure does not change over time) or non-stationary (performance measure changes
over time).
Step 9. Perform simulation runs. Perform runs according to steps 7-8 above. Most simulation
packages provide run statistics (mean, standard deviation, minimum value, maximum value) on the
performance measures, e.g., wait time (non-time persistent statistic), inventory on hand (time
persistent statistic).
Step 10. Interpret and present results. Compute numerical estimates (e.g., mean, confidence
intervals) of the desired performance measure for each configuration of interest.
Step 11. Recommend further course of action. This may include further experiments to increase
the precision and reduce the bias of estimators, to perform sensitivity analyses, etc.
8
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
More specifically, situations in which simulation modeling and analysis is used include the following:
A. It is impossible or extremely expensive to observe certain processes in the real world, e.g., next
year's cancer statistics, performance of the next space shuttle, and the effect of Internet advertising
on a company's sales.
B. Problems in which mathematical model can be formulated but analytic solutions are either
impossible (e.g., job shop scheduling problem, high order difference equations) or too complicated
(e.g., complex systems like the stock market, and large scale queuing models).
It is impossible or extremely expensive to validate the mathematical model describing the system, e.g., due
to insufficient data.
9
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
Although a simulation model can be built using general purpose programming languages which are familiar
to the analyst, available over a wide variety of platforms, and less expensive, most simulation studies today
are implemented using a simulation package.
The advantages are reduced programming requirements; natural framework for simulation modeling;
conceptual guidance; automated gathering of statistics; graphic symbolism for communication; animation;
and increasingly, flexibility to change the model.
Advantages:
Disadvantages:
10
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
5. Advantages of Simulation:
1) Obtain a better understanding of the system by developing a mathematical model of a system.
2) Test hypotheses about the system for feasibility.
3) Expand time to observe a complex phenomenon in detail so that you can investigate them better.
4) Study the effects of informational, organizational, environmental and policy changes on the
operation of a system.
5) Experiment with new or unknown situations
6) Employ a systems approach to problem solving.
7) Develop well designed and robust (strong and healthy) systems and reduce time.
8) Choose correctly for every aspect of a proposed change or addition in the system
9) Explore possibilities such new policies, operating procedures or methods without the need of
experimenting with the real world systems.
10) Diagnose problems among the variables that make up the complex system.
11) Develop understanding about how a system really operates and predictions about how a system will
operate.
12) Visualize the plan to see your how the system actually running.
13) Build consensus about a system, how the system works, so provide an objective opinion.
14) Prepare for change to determining future improvements and new designs on a system.
15) Train the team; simulation can provide excellent training when design for that purpose.
16) Specify requirements used to determine requirements for a system design by simulating different
possible configurations of a system.
6. Disadvantages of Simulation:
1) Model building requires special training; Simulation is an art that is learned over time and through
experience. Building a realistic model may require domain knowledge regarding simulation from
an expert.
2) Simulation results may be difficult to interpret because simulation results are essentially random
variables, It may be hard to determine result of system interrelationships.
3) Simulation modeling and analysis can be time consuming and expensive
4) Simulation may be used inappropriately when analytical solution is possible, or even preferable.
5) Unclear objective.
6) Invalid model.
7) Simulation model too complex or too simple.
8) Undocumented Assumptions.
9) A good simulation model may be very expensive.
Application of Simulations:
11
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
6) Evaluating designs for service organizations such as hospitals, post offices, or fast-food restaurants
7) Analyzing financial or economic systems.(Example: Banks).
Some Application Areas of Simulation:
7. Stochastic Simulation:
1) In a situation where the cause & effect relationship is randomly determined the stochastic model is
used.
2) A stochastic model has one or more stochastic elements. The system having stochastic element is
generally not solved by analytic methods.
3) In case of simulating a stochastic model, a random number is normally generated by some methods
or the other methods to execute trail. Such simulation is called the Monte Carlo Method or Monte
Carlo Simulation.
4) In case of stochastic element in the Simulation are two or more persons and there is a competitive
situation or some types of game being reproduced, this is known as Gaming Simulation.
5) In stochastic model, unique input leads to different output for each model run, due to the random
component of the modeled process, single simulation given only one possible result.
6) In stochastic model, multiple runs (sequence of activities) are used to estimate probability
distribution.
12
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
Deterministic Simulation:
1) A deterministic model is used in that situation wherein the result is established straight forwardly
from a series of condition.
2) A deterministic model has no stochastic elements and the entire input and output relation of the
model is conclusively determined.
3) A dynamic model & a static model are included in the deterministic model.
4) Simulation by the deterministic model can be considered, there are no random elements in the
deterministic model, and simulation can well be done just one.
5) However in case the initial conditions are to be varied, simulation has to be repeated by changing
data.
6) In deterministic model, equation can be solved by different numerical methods such as;
i. Finite Difference Methods
ii. Finite Element Methods
iii. Path Simulation Methods
• The problem is to analyze the system in order to evaluate the quality of service and economic
feasibility offering the service.
• To measure the quality of service one has to make the assessment of the average waiting time per
customer and the percentages of the time the barber remains idle.
• For construction of a model of this system, the changes to analysis of the system can occurs only if
a customer arrives for service or departs after completion of service.
• If a customer arrives at barber’s shop, he will have to wait, if the barber is busy. On the other hand,
a departure of customer, after being served, indicates that the barber is available to serve the
waiting customer if any.
13
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
• Thus , there are two events occurs which are Arrival & Departure of customer. It indicates that as
the simulation progress on the time scale, one should pay attention to the system only when an
event occurs.
Let,
Then , the simulator starts at the time, t=0 and progresses upto t=t1,t=t2, ,t=t3, ,t=t4, ,t=t5, ,t=t6, ,t=t7 and so
on until entire simulated period “T” covered.
The occurrence of Ea (Arrival Event) & Ed (Departure Event) over T (Simulation Period), where the
simulation starts by generating E a at t1. Initially, as the facility is unoccupied, the customer starts service
immediately. Then the two events must be generated;
1) The next arrival may occur
2) The service of the customer may be completed.
The next arrival id determined from inter-arrival time, this determines Ea at t2. Departure time of customer
in service is determined from service time and this generated Ed at t3.
14
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
Both Ed (at t1) & Ed (at t3) are now stored chronologically, so that the simulator recognizes that Ea occurs
before Ed. The next event to be considered is Ea at t2 and this point Ea at t1 is deleted from the stored list.
The event Ea at t2 generates Ea at t4. Since the facility is busy, the arriving customer Ea (at t2) joins a
waiting line. Now Ea at t4 is deleted from the list and Ed at t3 is considered next.
At this time a customer is taken from the waiting line & departure event Ed at t5 is generated , the process
repeated until the entire simulated period “T” is covered.
Example-1:
Customers arrive at a milk booth required service. Assume that inter-arrival service times are constant and
given by 1.8 & 4 times units respectively. Simulate the system by hand computation for 14 times units.
Step-1:
Step-2:
15
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
Customer-6, 14-9.0=5.0
Customer-7, 14-10.8=3.2
Customer-8, 14-13.6=0.4
It is evident from this simulation that the average waiting time per customer is;
(2.2+4.4+6.6+6.8+5.0+3.2+0.4)/8=28.7/8= 3.57
Average waiting time per customer for whose, who must wait is 28.7/8=4.08
Example:-2
Customer arrive at a Restaurant required service. Assume that inter-arrival service times are constant and
given by 2.5 & 5 times units respectively. Simulate the system by hand computation for 20 times units.
Solution:
Step-1:
Step-2:
16
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
14.0 End --
Customer-6, 14-9.0=5.0
Customer-7, 14-10.8=3.2
Customer-8, 14-13.6=0.4
It is evident from this simulation that the average waiting time per customer is;
(2.2+4.4+6.6+6.8+5.0+3.2+0.4)/8=28.7/8= 3.57
Average waiting time per customer for whose, who must wait is 28.7/8=4.08
Defining Random:
Definition of randomness can be accomplished by studying a random phenomenon, such as a dice roll and
exploring what quality makes it random.
In the Ludo game, if you roll the Ludo dice ,the first run, the Ludo rolls a one (1), so the roll of one is
completely random.
A Random Number Generator can be defined as any system that creates random sequences, which is
uniformly distributed over all possible values and each number is independent of the number generated
before it.
17
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
For example, one digit number 0,1,2,…..9, there are in all 10 numbers and each of the number should have
1/10 probability of being generated.
In inventory model, the variable include customer’s demand & delivery times which may be probabilistic.
The problem, in all such types simulation is based on the use of random number. These are the number
which have equal probability of being generated.
A conventional manual method for generation of random number may be summarized in the following
seven steps.
• Step-4: Assign a coding system that relates they identified events to Generated Random Number.
• Step-5: Select a suitable method for obtaining the required random number.
• Step-6: Match the random to the assigned events and tabulate the result.
• Step-7: Repeat Step-6 until the desired number of simulation runs has be generated.
Example:
A xyz studio uses an expensive grade of developing colour ink when printing color portrait. Since the color
colour ink cannot be stored for long period, it is important to keep on hand only as much as is needed to fill
anticipated demand. In the past few months, however demand for the product has been fluctuating. The
owner has decided to simulate the demand for this service.
The data was taken for a 100 day period, during which no more than five special prints were requested on
any given day. Using the data given & generate a ten days sequence of demand value.
A Backery keep stock of a popular brand of cake. Previous experience shows the daily demand for the item
with associated probabilities as given below;
Daily 0 10 20 30 40 50
Demand
(Nos.)
Probabilities 0.01 0.20 0.15 0.50 0.12 0.02
Use the following sequence of Random Number to simulate the demand for next 10 days.
18
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
A Backery keep stock of a popular brand of cake. Previous experience shows the daily demand for the item
with associated probabilities as given below;
Daily 0 10 20 30 40 50
Demand
(Nos.)
Probabilities 0.01 0.20 0.15 0.50 0.12 0.02
Use the following sequence of Random Number to simulate the demand for next 8 days.
A sample of 100 arrivals of customers in a department store is according to the following distribution;
Simulate for the next 10 times between arrivals & time of arrivals by using Random Number:-
25,39,65,76,12,05,73,89, 19,49.
A sample of 100 arrivals of customers in a department store is according to the following distribution;
Simulate for the next 10 times between arrivals & time of arrivals by using Random Number:-
25,39,65,76,12,05,73,89, 19,49.
In a bank cheques are cashed at a single “teller” counter. Customer arrives at the counter in poisson manner
at an average rate of 30 customers per hour. The teller takes on an average a minute and a half cheque. The
service time has been shown to be exponentially distribution.
19
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.
BIJ BIJU PATNAIK INSTITUTE OF IT & MANAGEMENT STUDIES, BHUBANESWAR, ODISHA
20
Prepared By: M.K. Rout, Asst. Prof., BIITM.BBSR.