Modeling and Simulation Lab 02

Modeling and Simulation 2 2.1 Introduction: This laboratory session will introduce an numerical example for Monte Carlo

Views 129 Downloads 9 File size 586KB

Report DMCA / Copyright

DOWNLOAD FILE

Recommend stories

Citation preview

Modeling and Simulation 2

2.1 Introduction: This laboratory session will introduce an numerical example for Monte Carlo 2.2 Objectives: By the end of this laboratory session you should:    

Tackle a wide variety of problems using simulation. Learn The basic idea of Monte Carlo simulation Study the five steps on Monte Carlo simulation Solve an example of Monte Carlo simulation

2.3 Content: Introduction When a system contains elements that exhibit chance in their behavior, the Monte Carlo method of simulation can be applied. The basic idea in Monte Carlo simulation is to generate values for the variables making up the model being studied. There are a lot of variables in real-world systems that are probabilistic in nature and that we might want to simulate. A few examples of these variables follow: 1. Inventory demand on a daily or weekly basis

2. Lead time for inventory orders to arrive 3. Times between machine breakdowns 4. Times between arrivals at a service facility 5. Service times 6. Times to complete project activities 7. Number of employees absent from work each day Five Steps of Monte Carlo Simulation 1. Establishing probability distributions for important input variables 2. Building a cumulative probability distribution for each variable in step 1 3. Establishing an interval of random numbers for each variable 4. Generating random numbers 5. Simulating a series of trials

Example: 14-Clark Property Management is responsible for the maintenance, rental, and dayto-day operation of a large apartment complex on the east side of new or- leans. George Clark is especially concerned about the cost projections for replacing air conditioner compressors. He would like to simulate the number of compressor failures each year over the next 20 years. Using data from a similar apartment building he manages in a New Orleans suburb, Clark establishes a table of relative frequency of failures during a year as shown in the following table: Number Of A.C. Compressor Failures 0 1 2 3 4 5 6

Probability (Relative Frequency) 0.06 0.13 0.25 0.28 0.20 0.07 0.01

He decides to simulate the 20-year period by selecting two-digit random numbers from the third column of Table 14.4, starting with the random number 50.Conduct the simulation for Clark. Is it common to have three or more consecutive years of operation with two or fewer compressor failures per year? Solution 1-compute cumulative probability and interval of random numbers

Years 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Random number 50 28 68 36 90 62 27 50 18 36 61 21 36 01 14 81 87 72 80 46

Simulated failures during a year 3 2 3 2 4 3 2 3 1 2 3 2 2 0 1 4 4 4 4 3 Total 20 year failure=52 Average 20 year failure=52/20=2.6

15-The number of cars arriving per hour at Lundberg’s Car Wash during the past 200 hours of operation is observed to be the following:

Number of cares arriving 3 or fewer 4 5 6 7 8 9 or more

Frequency 0 20 30 50 60 40 0 Total=200 (a) Set up a probability and cumulative probability distribution for the variable of car arrivals. (b) Establish random number intervals for the variable. (c) Simulate 15 hours of car arrivals and compute the average number of arrivals per hour. Select the random numbers needed from the first column of Table 14.4, beginning with the digits 52. Solution (a) Number of cares arriving 3 or fewer 4 5 6 7 8 9 or more

Frequency

probability

Cumulative probability

Interval of random number

0 20 30 50 60 40 0 Total=200

0/200=0.0 20/200=0.1 30/200=0.15 50/200=0.25 60/200=0.3 40/200=0.2 0/200=0.0

0.0 0.1 0.25 0.5 0.8 1.00 1.00

00 1 to 10 11 to 25 26 to 50 51 to 80 81 to 100 100

(b) and (c) hours

Random number

1 2 3

52 37 82

Simulated Number of cares arriving during 15 hours 7 6 8

4 5 6 7 8 9 10 11 12 13 14 15

69 98 96 33 50 88 90 06 63 57 02 94

7 8 8 6 6 8 8 4 7 7 4 8 Total 20 care arrive=102 Average Number of cares arriving during 15 hours =102/15=6.8 cares

16- Compute the expected number of cars arriving in Problem 14-15 using the expected value formula. Compare this with the results obtained in the simulation. Solution Expected number of cars arriving 

9 ormore

 Probability Number of cares arriving number of care arrive i 3

 (0.0)(3) + (0.1)(4) + (0.15)(5) + (0.25)(6) + (0.3)(7) + (0.2)(8)+(.0)(9) tires. 0+.4+.75+1.5+2.1+1.6+0=6.35 care.