0% found this document useful (0 votes)
10 views28 pages

Simulation

Uploaded by

shru.71772215143
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)
10 views28 pages

Simulation

Uploaded by

shru.71772215143
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/ 28

VIDEO LECTURE ON

Simulation

By
Dr.P.Ilamathi
GCT, Coimbatore
INTRODUCTION
• Simulation is an imitation of reality, which may be in the
physical form or in the form of mathematical equations.
• Definition : “Simulation is a representation of reality through
the use of a model or other device which will react in the same
manner as reality under a given set of conditions”.
• Simulation offers a means of analyzing very complex systems
that cannot be analyzed with other OR techniques.
• A large proportion of the applications of simulations are for
probabilistic models.
MONTE CARLO SIMULATION
 This technique employs random numbers and is used to solve problems that
involve probability and wherein physical experimentation is impracticable
and formulation of mathematical model is impossible.
 Steps:

 Select the objective function of the problem. It is either to be maximized or


minimized.
 Identify the variables that affect the objective function significantly and find
the probability distribution of that variable.
 Determine cumulative probability distribution of each variable selected in
step 2.
 Decide an interval of random numbers for each variable.

 Get a set of random numbers.

 Simulate a series of trials and determine simulated value of the actual


variables.
Generation of Random numbers
As simulation models get more complex they become
impossible to perform manually.
In simulation modeling, random numbers are generated by a
mathematical process instead of a physical process (such as
wheel spinning).
Random numbers are typically generated on the computer or
manually using a numerical technique and thus are not true
random numbers but pseudo random numbers.
Generation of Random numbers
 May be drawn from random number table, stored in the
computer memory.
 Mixed congruential method.

 Multiplicative congruential method.

 Additive congruential method.


Monte Carlo Process
Use of Random Numbers
• Select number from a random number table:
Linear Congruential Method

X i 1  (aX i  c) mod m, i  0,1,2,...

The The The


multiplier increment modulus

 X0 is called the seed.


 The selection of the values for a, c, m, and X0 drastically affects the
statistical properties and the cycle length.
 If c 0 then it is called mixed congruential method.
 When c=0 it is called multiplicative congruential method.
 If c 0 and a=0, then it is called additive congruential method.
Example: Mixed congruential method
 Use X0 = 27, a = 17, c = 43, and m = 100.

 The Xi values are:


X1 = (17*27+43) mod 100 = 502 mod 100 = 2,
X2 = (17*2+43) mod 100 = 77 mod 100 =77,
X3 = (17*77+43) mod 100 = 1352 mod 100 = 52

 So, the random numbers are 2, 77, 52, ……
Example:
Multiplicative congruential method
 Use X0 = 27, a = 17 and m = 100.

 The Xi values are:


X1 = (17*27) mod 100 = 459 mod 100 = 59,
X2 = (17*59) mod 100 = 1003 mod 100 = 3,
X3 = (17*3) mod 100 = 51 mod 100 = 51

 So, the random numbers are 59, 3, 51, ……
Example:
Additive congruential method
 Use X0 = 27, c = 43, and m = 100.

 The Xi values are:


X1 = (27+43) mod 100 = 70 mod 100 = 70,
X2 = (70+43) mod 100 = 113 mod 100 =13,
X3 = (13+43) mod 100 = 56 mod 100 = 56

 So, the random numbers are 70, 13, 56, ……
Monte Carlo Process : Example
Computer World demand data
for laptops selling for
Rs.50,000/- over a period of
100 weeks is given in the table.
Simulate it for 15 weeks and
determine the expected
demand and expected
revenue.

Demand/ Freq. of Probability Cumulative Corresponding


Week Demand Probability RN
0 20 0.2 0.2 0-19
1 40 0.4 0.6 20-59
2 20 0.2 0.8 60-79
3 10 0.1 0.9 80-89
4 10 0.1 1.00 90-99
Select number from a random number table:
Week
Week RN
RN Demand
Demand Revenue (in
Revenue (in
Transfer selected random thousand
thousand
numbers for each demand value rupees)
rupees)
to a table.
11 31
31 1 50
Estimated average demand = 22 88
88 3 150
22/15 = 1.47 laptop PCs per
33 10
10 0 0
week.
44 14
14 0 0
Estimated average revenue =
Rs.11,00,000/15 = Rs.73,333/- 55 54
54 1 50
66 77
77 2 100
77 24
24 1 50
88 06
06 0 0
99 23
23 1 50
10
10 62
62 2 100
11
11 92
92 4 200
12
12 87
87 3 150
13
13 68
68 2 100
14
14 27
27 1 50
15
15 23
23 1 50
Total
Total 22 1100
Transfer selected random
numbers for each demand value
to a table.
Estimated average demand =
22/15 = 1.47 laptop PCs per
week.
Estimated average revenue =
Rs.11,00,000/15 = Rs.73,333/-
Expected average demand
(analytically)
Queueing Problem
 A small factory has a machinist to process the jobs. The inter-arrival time
for the job is not fixed. The processing time on the jobs also varies. These
times are described by frequency distributions given below.
 Determine the idle time of the machinist and the waiting time of jobs in a
period of 2 hours. If the machinist’s wages are Rs. 200 per hour and the
job’s waiting time costs Rs.300 per hour. Would it be economical to
engage a second attendant? Use the following random number:
 For inter-arrival time: 22, 19, 16, 78, 3, 93, 78, 23, 15, 58, 57, 48, 61, 36,
18, 88, 9, 12, 85, 38, 53, 40, 2, 95 and 85.
 For processing times: 68, 13, 9, 20, 73, 87, 92, 99, 93, 18, 24, 22, 7, 29, 57,
33, 49, 64, 92, 98, 99, 57, 12, 31 and 96.
Inter-arrival Freq. Cumulative Corresponding
time(min) Freq. RN
4 10 10 00-09
5 20 30 10-29
6 40 70 30-69
7 20 90 70-89
8 10 100 90-99

Processing Freq. Cumulative Corresponding


time(min) Freq. RN
3 5 05 00-04
4 30 35 05-34
5 30 65 35-64
6 30 95 65-94
7 5 100 95-99
22 68
19 13
16 9
78 20
3 73
93 87
78 92
23 99
15 93
58 18
57 24
48 22
61 7
36 29
18 57
88 33
9 49
12 64
85 92
38 98
53 99
40 57
2 12
95 31
85 96
Solution:
 Total idle time for machinist in in 2 hour period = 21 minutes

 Average idle time for the machinist / hour = 10.5 min

 Idle time cost of the machinist / hour = 10.5/60x200 = Rs.35/-

 Total waiting time for the jobs in 2 hour period = 9 minutes

 Average waiting time for the jobs /hour = 4.5 min

 Waiting time cost of the jobs/hour = 4.5/60 x 300 = Rs.22.5/-

 Since, the idle time cost of the machinist / hour is more than the
waiting time cost of the jobs/hour, it is not economical to engage the
second attendant.
Maintenance Problem
 Determine the optimum number of mechanics for 100 semi automatic
machine tool. The operation of the machine tools in automatic and
warrants attention of the mechanics only when there is break down. The
breakdowns have seen to occur at the following times:

 The repair times for the machine tools have been observed to be
according to the following distribution:

 The wage of a mechanic is Rs.180/- per hour. Down time cost of the
machine is Rs.50/- per hour. Calculate whether two or three mechanics
should be employed. Use random numbers: 105, 159, 885, 989, 657, 888,
729, 285 and 530.
Repair time Freq. Cumulative Corresponding
(hour) Freq. RN
1.2 50 50 000-049
1.3 110 160 050-159
1.4 210 370 160-369
1.5 350 720 370-719
1.6 105 825 720-824
1.7 70 895 825-894
1.8 50 945 895-944
1.9 45 990 945-989
2.0 10 1000 990-999

Random 105 159 885 989 657 888 729 285 530
No
Repair 1.3 1.3 1.7 1.9 1.5 1.7 1.6 1.4 1.5
time
Two mechanic system
Three mechanic system
Cost Analysis
For two mechanic system:
 Wages to be paid/hr = Rs.180 x 2= Rs.360/-
 Down time cost of the machine tools = Rs. 50 x 4.8 = Rs.240/-
 Total cost / hr = Rs.600/-

For three mechanic system:


 Wages to be paid/hr = Rs.180 x 3= Rs.540/-
 Down time cost of the machine tools = Rs. 50 x 0 = Rs.0/-
 Total cost / hr = Rs.540/-

 So, engaging three mechanics is more economical as it reduces the


total cost/hr by Rs.60/-
Tutorial
 A person requires 10, 12, and 12 units chemicals A, B
and C respectively for his garden. A liquid product
contains 5, 2 and 1 units of A,B and C respectively per
jar. A dry product contains 1,2 and 4 units of A,B and C
per carton.
 If the liquid product sells for Rs.3 per jar and the dry
product sells for Rs.2 per carton, formulate this as an
LPP to determine how many of each should be
purchased, in order to minimize the cost and meet the
requirements?

You might also like