0% found this document useful (0 votes)
24 views16 pages

Chapter 1

This chapter introduces simulation as a method to imitate real-world processes over time, enabling analysis of system behavior through models. It discusses when simulation is appropriate, its advantages and disadvantages, common mistakes, and various applications in fields like manufacturing and healthcare. The chapter also outlines the steps in a simulation study and categorizes simulation software.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views16 pages

Chapter 1

This chapter introduces simulation as a method to imitate real-world processes over time, enabling analysis of system behavior through models. It discusses when simulation is appropriate, its advantages and disadvantages, common mistakes, and various applications in fields like manufacturing and healthcare. The chapter also outlines the steps in a simulation study and categorizes simulation software.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Chapter 1

Introduction to 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.
The behaviour 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. Potential changes to the system can first be simulated, in order to predict
their impact on system performance. Simulation can also be used to study systems in the design
stage, before such systems are built. Thus, simulation modelling can be used both as an analysis
tool for predicting the effect of changes to existing systems and as a design tool to predict the
performance of new systems under varying sets of circumstances.
In some instances, a model can be developed which is simple enough to be "solved" by
mathematical methods. Such solutions might be found by the use of differential calculus,
probability theory, algebraic methods, or other mathematical techniques. However, many
real-world systems are so complex that models of these systems are virtually impossible to
solve mathematically. In these instances, numerical, computer-based simulation can be used to
imitate the behaviour of the system over time. From the simulation, data are collected as if a
real system were being observed. This simulation-generated data is used to estimate the
measures of performance of the system.

When Is Simulation the Appropriate tool?

The availability of special-purpose simulation languages of massive computing capabilities at


a decreasing cost per operation and of advances in simulation methodologies have made
simulation one of the most widely used and accepted tools in operations research and systems
analysis. Simulation can be used for the following purposes:

1. Simulation enables the study of and experimentation with, the internal interactions of a
complex system or of a subsystem within a complex system.
2. Informational, organizational, and environmental changes can be simulated, and the
effect of these alterations on the model's behaviour can be observed.

3. The knowledge gained during the designing of a simulation model could be of great
value toward suggesting improvement in the system under investigation.
4. Changing simulation inputs and observing the resulting outputs can produce valuable
insights about which variables are the most important and how variables interact.
5. Simulation can be used to experiment with new designs or policies before
implementation, so as to prepare for what might happen.
6. Simulation can be used to verify analytic solutions.
7. Animation can show a system in simulated operation so that the plan can be visualized.
8. A modern system (factory, wafer fabrication plant, service organization, etc.) is so
complex that its internal interactions can be treated only through simulation.

When Simulation Is Not Appropriate?

1. When the problem can be solved by common sense.


2. When the problem can be solved analytically.
3. If it is less expensive to perform direct experiments.
4. If the costs exceed the savings.
5. If the resources or time are not available.
6. The ability to verify and validate the model.

Advantages of Simulation

1. New policies, operating procedures, decision rules, information flows, organizational


procedures, and so on can be explored without disrupting ongoing operations of the real
system.
2. New hardware designs, physical layouts, transportation systems, and so on can be tested
without committing resources for their acquisition.
3. Hypothesis about how or why certain phenomena occur can be tested for feasibility.
4. Insight can be obtained about the interaction of variables.
5. Insight can be obtained about the importance of variables to the performance of the
system.
6. A simulation study can help in understanding how the system operates rather than how
individuals think the system operates.
Disadvantages of Simulation

1. Model building requires special training. It is an art that is learned over time and
through experience. Furthermore, if two models are constructed by different competent
individuals, they might have similarities, but it is highly unlikely that they will be the
same.
2. Simulation results can be difficult to interpret. Most simulation outputs are essentially
random variables (they are usually based on random inputs), so it can be hard to
distinguish whether an observation is the result of system interrelationships or of
randomness.
3. Simulation modelling and analysis can be time consuming and expensive. Skimping on
resources for modelling and analysis could result in a simulation model or analysis that
is not sufficient to the task.
4. Simulation is used in some cases when an analytical solution is possible, or even
preferable.

Common Mistakes in Simulation

1. Inappropriate Level of Detail: Simulation allows a system to be studied in more detail


than analytical modelling. In other words, an analytical model is less detailed. In a
simulation model, the level of detail is limited only by the time available for simulation
development. A more detailed simulation requires more time to develop.
2. Improper Language: The choice of the programming language has a significant impact
on the timely development of the model. Special-purpose simulation languages require
less time for model development and ease several common tasks such as verification
(using traces) and statistical analysis. General-purpose languages, on the other hand,
are more portable and provide more control over the efficiency and run time of the
simulation.
3. Unverified Models: Simulation models are generally large computer programs, and
unless special precautions are taken, it is possible to have several bugs or programming
errors, which would make the conclusions meaningless.
4. Invalid Models: Even if a simulation program has no errors, it may not represent the
real system correctly because of incorrect assumptions about the system’s behaviour. It
is essential that the models be validated to ensure that the conclusion reached would be
the same as those obtained from the real system.
5. Too Short Simulations: Analysts often try to save their own time as well as the
computer’s time by running simulations that are too short. The results in such cases are
heavily dependent on initial conditions and may not be representative of the real system.
The correct length for simulations depends upon the accuracy (width of the confidence
intervals) desired and the variance of the observed quantities.
6. Poor Random-Number Generators: Simulation models require random quantities and
the procedures to generate the random numbers are called random-number generators.
It is safer to use a well-known generator that has been extensively analysed than to
develop one’s own. Even well-known generators have been known to have problems.

Areas of Application:

1. Manufacturing Applications
2. Business Processing
3. Construction Engineering and Project Management
4. Logistics, Transportation, and Distribution
5. Military Applications
6. Health Care

Types of Simulations

Among the variety of simulations available, those that would be of interest to computer
scientists are Emulation, Monte Carlo Simulation, Trace-Driven Simulation, and Discrete-
Event Simulation.
A simulation using hardware or firmware is called emulation. A terminal emulator, for
example, simulates one kind of terminal on another. A processor emulator emulates an
instruction set of one processor on another. Even though emulation is a type of simulation, the
design issues for emulation are mostly hardware design issues.
Monte Carlo Simulation:
A static simulation or one without a time axis is called a Monte Carlo simulation.
Such simulations are used to model probabilistic phenomenon that do not change
characteristics with time. Like a dynamic simulation they require the generation of pseudo-
random numbers. Monte Carlo simulations are also used for evaluating non probabilistic
expressions using probabilistic methods.
Discrete-Event System Simulation:

Discrete-event system simulation is the modelling of systems in which the state variable
changes only at a discrete set of points in time. The simulation models are analysed by
numerical rather than analytical methods. Analytical methods employ the deductive reasoning
of mathematics to "solve" the model. Numerical methods employ computational procedures to
"solve" mathematical models.

All discrete-event simulations have a common structure. Regardless of the system being
modelled, the simulation will have some of the components described below. If a general-
purpose language is used, all components have to be developed by the analyst. A simulation
language provides some of the components and leaves others for the analyst. The components
are as follows:
1. Event Scheduler: It keeps a linked list of events waiting to happen. The scheduler allows
the events to be manipulated in various ways. Some of these manipulation activities are
as follows:
(a) Schedule event X at time T.
(b) Hold event X for a time interval dt.
(c) Cancel a previously scheduled event X.
(d) Hold event X indefinitely (until it is scheduled by another event).
(e) Schedule an indefinitely held event.
Event scheduler is one of the most frequently executed components of the simulation.
It is executed before every event, and it may be called several times during one event
to schedule other new events.
2. Simulation Clock and a Time-advancing Mechanism: Each simulation has a global
variable representing simulated time. The scheduler is responsible for advancing this
time. There are two ways of doing this. The first way, called the unit time approach,
increments time by small increment and then checks to see if there are any events that
can occur. The second approach, called the event-driven approach, increments the time
automatically to the time of the next earliest occurring event. The unit time approach is
not generally used in computer simulations.
3. System State Variables: These are global variables that describe the state of the system.
For example, in the CPU scheduling simulation, the system state variable is the number
of jobs in the queue. This is a global variable that is distinct from local variables such
as CPU time required for a job, which would be stored in the data structure representing
the job.
4. Event Routines: Each event is simulated by its routine. These routines update the system
state variables and schedule other events. For example, in simulating a CPU scheduling
mechanism, one might need routines to handle the three events of job arrivals, job
scheduling, and job departure.
5. Input Routines: These get the model parameters, such as mean CPU demand per job,
from the user. It is better to ask for all input at the beginning of a simulation and then
free the user, since simulations generally take a long time to complete. The input
routines typically allow a parameter to be varied in a specified manner.
6. Report Generator: These are the output routines executed at the end of the simulation.
They calculate the final result and print in a specified format.
7. Initialization Routines: These set the initial state of the system state variables and
initialize various random-number generation streams. It is suggested that there be
separate routines to initialize the state at the beginning of a simulation, at the beginning
of an iteration, and at the beginning of a repetition.
8. Trace Routines: These print out intermediate variables as the simulation proceeds. They
help debug the simulation program. It is advisable that the trace have an on/off feature
so that it can be turned off for final production runs of the model. A model may even
allow the ability to interrupt the execution of the model from the keyboard and turn the
trace on or off.
9. Dynamic Memory Management: The number of entities in a simulation changes
continuously as new entities are generated and old ones are destroyed. This requires
periodic garbage collection. Most simulation languages and many general-purpose
languages provide this automatically.
10. Main Program: This brings all the routines together. It calls input routines, initializes
the simulation, executes various iterations, and finally, calls the output routines.
Steps in a Simulation Study

1. 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
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.
2. 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
the objectives as stated.
3. Model conceptualization: The construction of a model of a system is probably as much
art as science. Although it is not possible to provide a set of instructions that will lead
to building successful and appropriate models in every instance, there are some general
guidelines that can be followed. The art of modelling 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 result.
4. 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 as
early as possible, usually together with the early stages of model building.
5. 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, in many
instances, to accomplish the desired result with little or no actual coding.
6. Verified: Verification pertains to the computer program that has been prepared for the
simulation model. 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.
7. Validated: Validation usually is achieved through the calibration of the model, an
iterative process of comparing the model against actual system behaviour 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.
8. 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 analysed.
9. 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.
10. 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.
11. 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.
12. Implementation: The success of the implementation phase depends on how well the
previous eleven steps have been 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 involved during the entire model-building process and if the
model user understands the nature of the model and its outputs, the likelihood of a
vigorous implementation is enhanced.
Figure 1.1 Steps in Simulation study

SIMULATION SOFTWARES

Software used to develop simulation models can be divided into three categories. First,
there are the general-purpose programming languages, such as C, C++, and Java. Second, there
are simulation programming languages, examples being GPSS/Hand SIMAN V®. Third, there
are the simulation environments. This category includes many products that are distinguished
one way or another (by, for example, cost, application area, or type of animation), but have
common characteristics, such as a graphical user interface and an environment that supports all
(or most) aspects of a simulation study. Many simulation environments contain a simulation
programming language, but some take a graphical approach similar to process-flow
diagramming.
Systems and System Environment

A system is defined as a group of objects that are joined together in some regular interaction or
interdependence toward the accomplishment of some purpose.
A system is often affected by changes occurring outside the system. Such changes are
said to occur in the system environment. In modelling systems, it is necessary to decide on the
boundary between the system and its environment. This decision may depend on the purpose
of the study.
Components of a System

In order to understand and analyse a system, a number of terms need to be defined.


An entity is an object of interest in the system.
An attribute is a property of an entity.
An activity represents process that causes changes to the system. Example, if a bank is being
studied, customers might be one of the entities, the balance in their checking accounts might
be an attribute, and making deposits might be an activity.
The state of a system is defined to be that collection of variables necessary to describe
the system at any time, relative to the objectives of the study. In the study of a bank, possible
state variables are the number of busy tellers, the number of customers waiting in line or being
served, and the arrival time of the next customer.

An event is defined as an instantaneous occurrence that might change the state of the system.
The term endogenous is used to describe activities and events occurring within a system, and
the term exogenous is used to describe activities and events in the environment that affect the
system.

Types of Systems
Systems can be categorized as discrete or continuous. "Few systems in practice are
wholly discrete or continuous, but since one type of change predominates for most systems, it
will usually be possible to classify a system as being either discrete or continuous".

A discrete system is one in which the state variable(s) change only at a discrete set of
points in time. The bank is an example of a discrete system: The state variable, the number of
customers in the bank, changes only when a customer arrives or when the service provided a
customer is completed. Figure 1.2 shows how the number of customers changes only at discrete
points in time.
Figure 1.2 Discrete-system state variable

A continuous system is one in which the state variable(s) change continuously over
time. An example is the head of water behind a dam. During and for some time after a rain
storm, water flows into the lake behind the dam. Evaporation also decreases the water level.
Figure 1.3 shows how the state variable head of water behind the dam changes for this
continuous system.

Figure 1.3 Continuous-system state variable


Model of a System

Sometimes it is of interest to study a system to understand the relationships between its


components or to predict how the system will operate under a new policy. To study the system,
it is sometimes possible to experiment with the system itself. However, this is not always an
option. A new system might not yet exist; it could be in only hypothetical form or at the design
stage. Even if the system exists, it might be impractical to experiment with it. In the case of a
bank, reducing the numbers of tellers to study the effect on the length of waiting lines might
infuriate the customers so greatly that they will move their accounts to a competitor.
Consequently, studies of systems are often accomplished with a model of a system.

A model is defined as a representation of a system for the purpose of studying that system. For
most studies, it is only necessary to consider those aspects of the system that affect the problem
under investigation. These aspects are represented in a model of the system; the model, by
definition, is a simplification of the system. On the other hand, the model should be sufficiently
detailed to permit valid conclusions to be drawn about the real system.
Types of Models

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. A physical model is a larger or smaller
version of an object such as the enlargement of an atom or a scaled-down version of the solar
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.
Simulation models that contain no random variables are classified as deterministic.
Deterministic models have a known set of inputs, that will result in a unique set of outputs.
Deterministic arrivals would occur at a dentist's office if all patients arrived at their scheduled
appointment times. 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.
Discrete and continuous models are defined in an analogous manner. However, a
discrete simulation model is not always used to model a discrete system, nor is a continuous
simulation model always used to model a continuous system. Tanks and pipes might be
modelled discretely, even though we know that fluid flow is continuous. In addition, simulation
models may be mixed, both discrete and continuous. The choice of whether to use a discrete
or continuous (or both discrete and continuous) simulation model is a function of the
characteristics of the system and the objective of the study.

Statistical Models in Simulation

In modelling real-world phenomena, there are few situations where the actions of the
entities within the system under study can be predicted completely. The world the model
builder sees is probabilistic rather than deterministic. There are many causes of variation. The
time it takes a repairperson to fix a broken machine is a function of the complexity of the
breakdown, whether the repairperson brought the proper replacement parts and tools to the site,
whether another repairperson asks for assistance during the course of the repair, whether the
machine operator receives a lesson in preventive maintenance, and so on. To the model builder,
these variations appear to occur by chance and cannot be predicted.
An appropriate model can be developed by sampling the phenomenon of interest. Then,
through educated guesses (or using software for the purpose), the model builder would select
a known distribution form, make an estimate of the parameter(s) of this distribution, and then
test to see how good a fit has been obtained. Through continued efforts in the selection of an
appropriate distribution form, a postulated model could be accepted.

Since a model is an abstraction of the real-world problem, predictions based on the


model must be validated against actual measurements collected from the real phenomena.
A poor validation may suggest modifications to the original model. The theory of statistics
facilitates the process of validation. Statistics is concerned with the inductive process of
drawing inferences about the model and its parameters based on the limited information
contained in real data.
Bernoulli Distribution
The Bernoulli distribution is the simplest discrete distribution. A Bernoulli variate can
take only two values, which are usually denoted as failure and success or x = 0 and x = 1,
respectively. If p denotes the probability of success, 1 – p is the probability of failure. The
experiments to generate a Bernoulli variate are called Bernoulli trials.

Mean: p

Variance: p(1-p)

The Bernoulli distribution and its derivative distributions can be used only if the trials are
independent and identical so that the probability of success in each trial is p and is not affected
by the outcomes of the past trials.

Binomial Distribution
The number of successes x in a sequence of n Bernoulli trials has a binomial
distribution. The key characteristics of the binomial distribution.

Parameters: p = probability of success in a trial, 0 < p < 1


N = number of trials, n must be a positive integer
Range: x = 0, 1, …., n

Mean: n p

Variance: n p(1-p)
Poisson Distribution
The Poisson distribution is a limiting form of the binomial distribution, and it is used
extensively in queueing models i.e. it describes many random processes quite well. The Poisson
distribution is used to model the number of arrivals over a given interval; for example:
1. Number of requests to a server in a given time interval t
2. Number of component failures per unit time
3. Number of queries to a database system over t seconds

Mean = Variance = λ
Continuous random variables can be used to describe random phenomena in which the variable
of interest can take on any value in some interval-for example, the time to failure or the length
of a rod.
Uniform Distribution
A random variable X is uniformly distributed on the interval [a, b] if its pdf is given by

a≤x≤b

Mean:

Variance:

Exponential Distribution

The exponential distribution has been used to model interarrival times when arrivals
are completely random and to model service times that are highly variable. In these instances,
λ is a rate: arrivals per hour or services per minute. The exponential distribution has also been
used to model the lifetime of a component that fails catastrophically (instantaneously), such as
a light bulb; then λ is the failure rate.
Mean:

Variance:

Discrete random variables

Let X be a random variable. If the number of possible values of X is finite, or countably


infinite, X is called a discrete random variable. The possible values of X may be listed as x1,
x2, .... In the finite case, the list terminates; in the countably infinite case, the list continues
indefinitely.

Continuous random variables

If the range space Rx of the random variable X is an interval or a collection of intervals,


X is called a continuous random variable. For a continuous random variable X, the probability
that X lies in the interval [a, b] is given by:

You might also like