Lecture 35 - Simulation Modeling I
Lecture 35 - Simulation Modeling I
SIMULATION MODELING I
1
SIMULATION MODELING I
INTRODUCTION
Simulation is the next best thing to observing a real system in operation.
It allows collection of pertinent information about the behavior of the system by running a
computerized model.
The task of using simulation starts with the development of the logic of the computer model in a
manner that will allow collecting needed data.
Rather it is a technique for estimating the measures of performance of the modeled system.
2
Simulation has applications and uses in all aspects of science and technology as the following
partial list of examples demonstrates.
Examples
1. Basic science
Estimation of area under a curve
Evaluation of multiple integrals
Matrix inversion
Study of particle diffusion
2. Practical situations
(a). Industrial problems
Design of queueing systems
Communication networks
Inventory control
Chemical processes
3
(b). Business and economic problems
Consumer behavior
Price determination
Economic forecasting
Total firm operation
4
(d). Biomedical systems
Fluid balance
Electrolyte distribution in body
Blood cell proliferation
Brain activities
Estimation of simulation output is based on random sampling, much the same way we do when
observing real situation.
This means that output of simulation is subject to random variations, and thus, as in any statistical
experiment, must be examined using formal statistical inference tests.
5
MONTE CARLO SIMULATION
A forerunner to present-day simulation is the Monte Carlo technique, a modeling scheme that
estimates stochastic or deterministic parameters based on random sampling.
Examples of Monte Carlo applications include evaluation of multiple integrals, estimation of the
constant π (= 3.14159), and matrix inversion.
The objective of the example is to emphasize the statistical nature of the simulation experiment.
6
Example 1
We will use Monte Carlo sampling to estimate the area of the following circle:
The radius of the circle is r = 5 cm, and its center is (x, y) = (1, 2).
Solution
The procedure for estimating the area requires enclosing the circle snugly in a square whose side
equals the diameter of the circle, as shown in Figure 1.
The corner points are determined from the geometry of the square.
7
Figure 1: Monte Carlo estimation of the area of a circle.
8
The estimation of the area of the circle is based on assumption that all the points in the square are
equally likely to occur.
To ensure that all the points in the square are equally probable, the coordinates x and y of a point
in the square are represented by the following uniform distributions:
9
The determination of a sample (x, y) is based on the use of independent 0 − 1 random numbers.
Table 1 lists a sample of such numbers which we will use in the examples in this chapter.
For the purpose of general simulation, special arithmetic operations are used to generate (pseudo)
0 − 1 random numbers as described in another section later.
10
A pair of 0 − 1 random numbers, R1 and R2, can be used to generate a random point (x, y) in the
square by using the following formulas:
The procedure is repeated n times, keeping track of the number of points m that fall within the
circle.
11
The estimate of area of the circle improves as the sample size increases.
Average of 10 replications for each sample size n provides an improved estimate of the area than
any one replication.
Accuracy of the mean value of all 10 replications increases with the increase in sample size n,
which is evident by decline in the value of the standard deviation.
Higher values of n (sample size) and N (number of replications) provide more reliable simulation
results.
The drawback however is that higher values of n and N imply higher costs for conducting the
simulation experiment.
12