Professional Documents
Culture Documents
Simulation
What is Simulation?
An attempt to duplicate the features,
appearance, and characteristics of a real
system, and its objectives are
1. To imitate a real-world situation mathematically
2. To study its properties and operating
characteristics
3. To draw conclusions and make action decisions
based on the results of the simulation
Simulation …Cont’d
• Examples:
Manned space flight
Treadmills that simulate automobile tire wear in
laboratory.
Types of Simulation…Cont’d
2. Computer Simulation:- In this form of simulation, systems
are replicated with mathematical models, which are
analyzed with computer.
This form of simulation has become a very popular
technique that has been applied to a wide variety of
business problems.
One reason of its popularity is that it offers a means of
analyzing very complex systems that cannot be analyzed
using the other techniques .
Steps of Simulation Process
• The process of simulating a system consists of
following steps:
1. Identify the problem
2. Identify the decision variables, and decide the
performance criterion (objective) and decision rules
3. Construct a numerical model
4. Validate the model
5. Design the experiments
6. Run the simulation model
7. Examine the results
Identify the problem
No
Validate the model
Is
Design experiments (specify values of simulation
decision variables to be tested) completed?
Yes
Run or conduct the simulation
Examine the results and select
the best course of action
Fig.10.2 Steps of the simulation process
Monte Carlo Simulation
• One characteristic of some systems that makes them difficult to
solve analytically is that they consist of random variables
represented by probability distributions.
Thus, a large proportion of the applications of simulations are
for probabilistic models.
• The term Monte Carlo has become synonymous with
probabilistic simulation in recent years.
• Monte Carlo is a technique for selecting numbers randomly from
a probability distribution.
Monte Carlo …Cont’d
• In case it is not possible to describe a system in terms of
standard probability distribution such as normal, Poisson,
exponential, gamma, etc., an empirical probability distribution
can be constructed.
• The Monte Carlo process is analogous to gambling devices.
devices
• It may be used when the model contains elements that exhibit
chance in their behavior,
Monte Carlo …Cont’d
The Monte Carlo technique consists of following
steps:
rn = p.rn-1 (modulo m)
Where p and m are positive integers, P<m, rn-1 is the
k-digit number and modulo m means that rn is the
reminder when p.rn-1 is devised by m. m this means, rn
and p.rn-1 differ by an integer multiple of m.
RN Generation…Cont’d
• To start the process of generating random numbers, the first
number r0 is specified by the user.
• For illustration, let p= 35, m= 100 and arbitrary start with r0=
57.
• Since m-1 = 99 is the 2=digit number, therefore, it will
generate 2-digit random numbers:
r1 = pr0 (modulo m)= 35 x 57 (modulo 100)
1,995/100 = 95, reminder
r2 = pr1 (modulo m)= 35 x 57 (modulo 100)
3,325/100 = 25, reminder
r3 = pr2 (modulo m)= 35 x 57 (modulo 100)
875/100 = 75, reminder
RN Generation…Cont’d
2. Computer Generator
The random numbers that are generated by using computer
software are uniformly distributed decimal fractions
between 0 and 1.
The software works on the concept of cumulative
distribution function for the random variables for which we
are seeking to generate random numbers.
RN Generation…Cont’d
• For example, for the negative exponential function with
x
density function,
f ( x) e ,0 x ,
• The cumulative distribution function is given by,
x
x x
F ( x) e dx 1 e
0
or , e x 1 F ( x )
• Taking logarithm on both sides, we have
x log[1 F ( x)]
or , x (1 / ) log[1 F ( x)]
RN Generation…Cont’d
• If r = F(x) is a uniformly distributed random
decimal fraction between 0 and 1, then the
exponential variables associated with r is given
by
xn (1 / ) log(1 r ) (1 / ) log r.
Remark
I. We can pick up random numbers from
random table, or
II.Use built-in Excel formula to generate random
numbers
RN Generation…Cont’d
While picking up random numbers from the random
number table
• The starting point could be randomly chosen
Start with any number in any column or row, and
proceed in the same column or row to the next
number, but a consistent, unvaried pattern should be
followed in drawing random numbers..
We should not jump from one number to another
indiscriminately
RN Generation…Cont’d
Table 10.1. Random number generation using
built-in excel formula
To Simulate Use built-in Excel
formula
(1) Random number, r (0≤ r≤ 1) =RAND()
(2) Random number, r =RAND()*100
(0 ≤ r ≤ 100)
(3) Continuous uniform =a+(b-a)*RAND()
distribution between a and b
(4) Discrete uniform distribution =INT(a+(b-a+1)*RAND())
between a and b
Example: Demand and supply
Table 10.2. Probability distribution of demand of Tires
Interval of
Daily Cumulative Random
Demand Probability Probability Numbers
0 .05 .05 01 through 05
1 .10 .15 06 through 15
2 .20 .35 16 through 35
3 .30 .65 36 through 65
4 .20 .85 66 through 85
5 .15 1.00 86 through 99,00
Simulation Example 1
Day Random Simulated
Number Number (r) Daily Demand
1 39 3
2 73 4
3 72 4
4 75 4
5 37 3
6 02 0
7 87 5
8 98 5
9 10 1
10 47 3
Total= 32
Average= 3.2
Solution…Cont’d
Expected Demand E(x) = Σpixi
5
Expected = ∑ (probability of i units) x (demand of i
demand units)
i =1
12.5 min
Average waiting time= 1.25 min percustomer
10customers
8customers
Average queue length= .80customer
10customers
Average time
24.5 min
in the system= 2.45 min percustomer
10customers
Example 3: Simulation of a machine breakdown and
Maintenance System
• A continuous probability distribution of the time between
machine breakdowns is given by;
x
f ( x) ,0 x 4weeks
8
Where X = Weeks between machine breakdowns
2 .55
3 .30
x
f ( x) ,0 x 6weeks
18
Where x= Weeks between machine breakdowns
Machine breakdown…Cont’d
Option 2:
2 With maintenance program
Cost = $20,000+ $42,000
= $62,000