In the print dialog, choose "Save as PDF" as the destination.
Modeling and Simulation - Lesson 5
Random numbers read as demand, treatments and service times: Exercise 5 solved step by step.
EOQ and ROLPart 1
Example 1: demand, lead time and when to order
Example 1
Example 1
| Lead time | Frequency |
|---|---|
| 3 days | 28% |
| 4 days | 44% |
| 5 days | 28% |
Example 1
| Symbol | Cost of | Value |
|---|---|---|
C0 | Placing an order | 100 pound/order |
Ci | Holding an item in stock | 0.1 pound/unit/day |
Cs | Shortage | 5 pounds/unit |
Example 1
Example 1
Example 1
Example 1
Mean lead time
Example 1
20 - 24, 25 - 29, ..., 70 - 7400 to 99 according to the frequencyExample 1
| Interval | Average | Freq. | Cum. |
|---|---|---|---|
| 20 - 24 | 22 | 1 | 1 |
| 25 - 29 | 27 | 3 | 4 |
| 30 - 34 | 32 | 12 | 16 |
| 35 - 39 | 37 | 10 | 26 |
Example 1
| Interval | Average | Freq. | Cum. |
|---|---|---|---|
| 40 - 44 | 42 | 26 | 52 |
| 45 - 49 | 47 | 17 | 69 |
| 50 - 54 | 52 | 13 | 82 |
| 55 - 59 | 57 | 12 | 94 |
Example 1
| Interval | Average | Freq. | Cum. |
|---|---|---|---|
| 60 - 64 | 62 | 2 | 96 |
| 65 - 69 | 67 | 2 | 98 |
| 70 - 74 | 72 | 2 | 100 |
Example 1
| Average | Cum. | Random numbers |
|---|---|---|
| 22 | 1 | 00 |
| 27 | 4 | 01 - 03 |
| 32 | 16 | 04 - 15 |
| 37 | 26 | 16 - 25 |
Example 1
| Average | Cum. | Random numbers |
|---|---|---|
| 42 | 52 | 26 - 51 |
| 47 | 69 | 52 - 68 |
| 52 | 82 | 69 - 81 |
| 57 | 94 | 82 - 93 |
Example 1
| Average | Cum. | Random numbers |
|---|---|---|
| 62 | 96 | 94 - 95 |
| 67 | 98 | 96 - 97 |
| 72 | 100 | 98 - 99 |
Range of the demand
Example 1
| Lead time | Freq. | Cum. | Random numbers |
|---|---|---|---|
| 3 | 28 | 28 | 00 - 27 |
| 4 | 44 | 72 | 28 - 71 |
| 5 | 28 | 100 | 72 - 99 |
Example 1
Example 1
| K | Chance of shortage | Sure of no shortage |
|---|---|---|
| 1.65 | 5% | 95% |
| 2.33 | 1% | 99% |
Example 1
For K = 1.65
Example 1
For K = 1.65
Rounding of ROL
Example 1
EOQ = 300 and ROL = 245 units300 units on Friday evening00 to 99 come from Excel or from another generatorExcel
Example 1
| For | Random numbers |
|---|---|
| Demand | 81, 78, 89, 59, 40, 33, 60, 67, 19, 21 |
| Lead time | 65, 67, 22 |
The named random numbers
Example 1
ROL, order EOQ and draw a lead timeExample 1
| Day | Initial | R. No. | Demand |
|---|---|---|---|
| Mon | 300 | 81 | 52 |
| Tue | 248 | 78 | 52 |
| Wed | 196 | 89 | 57 |
| Thu | 139 | 59 | 47 |
| Fri | 92 | 40 | 42 |
Example 1
| Day | Initial | R. No. | Demand |
|---|---|---|---|
| Mon | 50 | 33 | 42 |
| Tue | 308 | 60 | 47 |
| Wed | 261 | 67 | 47 |
| Thu | 214 | 19 | 37 |
| Fri | 177 | 21 | 37 |
Example 1
| Day | Shortage | Received | Final |
|---|---|---|---|
| Mon | - | - | 248 |
| Tue | - | - | 196 |
| Wed | - | - | 139 |
| Thu | - | - | 92 |
| Fri | - | - | 50 |
Example 1
| Day | Shortage | Received | Final |
|---|---|---|---|
| Mon | - | 300 | 308 |
| Tue | - | - | 261 |
| Wed | - | - | 214 |
| Thu | - | - | 177 |
| Fri | - | - | 140 |
Example 1
Example 1
| Day | In hand + order | Ordered | Lead time (R. No.) |
|---|---|---|---|
| Mon | 248 | 0 | - |
| Tue | 196 | 300 | 4 (65) |
| Wed | 439 | 0 | - |
| Thu | 392 | 0 | - |
| Fri | 350 | 0 | - |
Example 1
| Day | In hand + order | Ordered | Lead time (R. No.) |
|---|---|---|---|
| Mon | 308 | 0 | - |
| Tue | 261 | 0 | - |
| Wed | 214 | 300 | 4 (67) |
| Thu | 477 | 0 | - |
| Fri | 440 | 0 | - |
Quantity in hand + order
Example 1
4 working days from Tuesday: received on next Monday308 unitsExample 1
Part 2
Example 2: a queue with scheduled arrivals
Example 2
8:0030 minutes from 8:00Example 2
| Service | Time (min) | Probability |
|---|---|---|
| Filling | 40 | 0.40 |
| Crown | 60 | 0.15 |
| Cleaning | 15 | 0.15 |
| Extraction | 45 | 0.10 |
| Checkup | 15 | 0.20 |
Example 2
| Service | Prob. | Cum. | Interval |
|---|---|---|---|
| Filling | 0.40 | 0.40 | 00 - 39 |
| Crown | 0.15 | 0.55 | 40 - 54 |
| Cleaning | 0.15 | 0.70 | 55 - 69 |
| Extraction | 0.10 | 0.80 | 70 - 79 |
| Checkup | 0.20 | 1.00 | 80 - 99 |
Example 2
| Patient | Arrival | R. No. | Service (min) |
|---|---|---|---|
| 1 | 8:00 | 40 | Crown (60) |
| 2 | 8:30 | 82 | Checkup (15) |
| 3 | 9:00 | 11 | Filling (40) |
| 4 | 9:30 | 34 | Filling (40) |
Example 2
| Patient | Arrival | R. No. | Service (min) |
|---|---|---|---|
| 5 | 10:00 | 25 | Filling (40) |
| 6 | 10:30 | 66 | Cleaning (15) |
| 7 | 11:00 | 17 | Filling (40) |
| 8 | 11:30 | 79 | Extraction (45) |
Example 2
Example 2
| Patient | Service (min) | Starts | Ends |
|---|---|---|---|
| 1 | 60 | 8:00 | 9:00 |
| 2 | 15 | 9:00 | 9:15 |
| 3 | 40 | 9:15 | 9:55 |
| 4 | 40 | 9:55 | 10:35 |
| Patient | Arrival | Starts | Wait (min) |
|---|---|---|---|
| 1 | 8:00 | 8:00 | 0 |
| 2 | 8:30 | 9:00 | 30 |
| 3 | 9:00 | 9:15 | 15 |
| 4 | 9:30 | 9:55 | 25 |
Example 2
| Patient | Service (min) | Starts | Ends |
|---|---|---|---|
| 5 | 40 | 10:35 | 11:15 |
| 6 | 15 | 11:15 | 11:30 |
| 7 | 40 | 11:30 | 12:10 |
| 8 | 45 | 12:10 | 12:55 |
| Patient | Arrival | Starts | Wait (min) |
|---|---|---|---|
| 5 | 10:00 | 10:35 | 35 |
| 6 | 10:30 | 11:15 | 45 |
| 7 | 11:00 | 11:30 | 30 |
| 8 | 11:30 | 12:10 | 40 |
Example 2
Part 3
Example 3: the exponential distribution
Example 3
Example 3
Example 3
U ~ U(0, 1)X = -β ln UU replaces 1 - U, because both have the same U(0, 1) distributionPart 4
Example 4: random arrival and service times
Example 4
β1 = 2β2 = 1.338 customers and find the average waiting timeExample 4
Xi is the inter-arrival time and Yi is the service timeU1 and U2 lie between 0 and 1100: U1 = u1 / 100 and U2 = u2 / 100Example 4
| Stream | Random numbers |
|---|---|
| u1 | 20, 23, 86, 09, 92, 35, 38, 01 |
| u2 | 21, 44, 27, 70, 73, 36, 59, 42 |
Example 4
| Customer | u1 | Xi | Arrival |
|---|---|---|---|
| 1 | 20 | 3.22 | 3.22 |
| 2 | 23 | 2.94 | 6.16 |
| 3 | 86 | 0.30 | 6.46 |
| 4 | 09 | 4.82 | 11.28 |
Example 4
| Customer | u1 | Xi | Arrival |
|---|---|---|---|
| 5 | 92 | 0.17 | 11.45 |
| 6 | 35 | 2.10 | 13.55 |
| 7 | 38 | 1.94 | 15.49 |
| 8 | 01 | 9.21 | 24.70 |
Example 4
| Customer | u2 | U2 | Yi |
|---|---|---|---|
| 1 | 21 | 0.21 | 2.08 |
| 2 | 44 | 0.44 | 1.09 |
| 3 | 27 | 0.27 | 1.74 |
| 4 | 70 | 0.70 | 0.47 |
Example 4
| Customer | u2 | U2 | Yi |
|---|---|---|---|
| 5 | 73 | 0.73 | 0.42 |
| 6 | 36 | 0.36 | 1.36 |
| 7 | 59 | 0.59 | 0.70 |
| 8 | 42 | 0.42 | 1.15 |
Service times
Example 4
YiExample 4
| Customer | Arrival | Departure | Wait |
|---|---|---|---|
| 1 | 3.22 | 5.30 | 0 |
| 2 | 6.16 | 7.25 | 0 |
| 3 | 6.46 | 8.99 | 0.79 |
| 4 | 11.28 | 11.75 | 0 |
Example 4
| Customer | Arrival | Departure | Wait |
|---|---|---|---|
| 5 | 11.45 | 12.17 | 0.30 |
| 6 | 13.55 | 14.91 | 0 |
| 7 | 15.49 | 16.19 | 0 |
| 8 | 24.70 | 25.85 | 0 |
Example 4
Part 5
Example 5: units produced and vehicles available
Example 5
| Units Xi | P(x = Xi) | Interval u1 |
|---|---|---|
| 500 | 0.06 | 00 - 05 |
| 550 | 0.14 | 06 - 19 |
| 600 | 0.20 | 20 - 39 |
| 650 | 0.40 | 40 - 79 |
| 700 | 0.20 | 80 - 99 |
Example 5
| Vehicles Yi | P(y = Yi) | Interval u2 |
|---|---|---|
| 5 | 0.16 | 00 - 15 |
| 6 | 0.36 | 16 - 51 |
| 7 | 0.20 | 52 - 71 |
| 8 | 0.16 | 72 - 87 |
| 9 | 0.12 | 88 - 99 |
Example 5
| Stream | a | c | Seed X0 |
|---|---|---|---|
| u1 | 21 | 3 | 20 |
| u2 | 41 | 7 | 1 |
The formula
Example 5
| i | 21 × X + 3 | Xi |
|---|---|---|
| X1 | 21 × 20 + 3 = 423 | 23 |
| X2 | 21 × 23 + 3 = 486 | 86 |
| X3 | 21 × 86 + 3 = 1809 | 09 |
| X4 | 21 × 9 + 3 = 192 | 92 |
| X5 | 21 × 92 + 3 = 1935 | 35 |
Example 5
| i | 21 × X + 3 | Xi |
|---|---|---|
| X6 | 21 × 35 + 3 = 738 | 38 |
| X7 | 21 × 38 + 3 = 801 | 01 |
| X8 | 21 × 1 + 3 = 24 | 24 |
| X9 | 21 × 24 + 3 = 507 | 07 |
Example 5
| i | 41 × X + 7 | Xi |
|---|---|---|
| X1 | 41 × 1 + 7 = 48 | 48 |
| X2 | 41 × 48 + 7 = 1975 | 75 |
| X3 | 41 × 75 + 7 = 3082 | 82 |
| X4 | 41 × 82 + 7 = 3369 | 69 |
| X5 | 41 × 69 + 7 = 2836 | 36 |
Example 5
| i | 41 × X + 7 | Xi |
|---|---|---|
| X6 | 41 × 36 + 7 = 1483 | 83 |
| X7 | 41 × 83 + 7 = 3410 | 10 |
| X8 | 41 × 10 + 7 = 417 | 17 |
| X9 | 41 × 17 + 7 = 704 | 04 |
Example 5
| Day | R. No. | Units |
|---|---|---|
| 1 | 20 | 600 |
| 2 | 23 | 600 |
| 3 | 86 | 700 |
| 4 | 09 | 550 |
| 5 | 92 | 700 |
Example 5
| Day | R. No. | Units |
|---|---|---|
| 6 | 35 | 600 |
| 7 | 38 | 600 |
| 8 | 01 | 500 |
| 9 | 24 | 600 |
| 10 | 07 | 550 |
Example 5
| Day | R. No. | Vehicles |
|---|---|---|
| 1 | 01 | 5 |
| 2 | 48 | 6 |
| 3 | 75 | 8 |
| 4 | 82 | 8 |
| 5 | 69 | 7 |
Example 5
| Day | R. No. | Vehicles |
|---|---|---|
| 6 | 36 | 6 |
| 7 | 83 | 8 |
| 8 | 10 | 5 |
| 9 | 17 | 6 |
| 10 | 04 | 5 |
Example 5
Part 6
and practice
81 gives 52, not 50 or 5440 is a crown, because filling ends at 39ROL against in hand + order, not the final stock alone4 days from Tuesday is next Mondayu by 100 before ln, and keep the minus sign in X = -β ln U94, 51, 37, and lead time for 20, 71, 728:00: random numbers 39, 55, 80, 70u1 = 50, 90, 40 and u2 = 30, 60, 80X0 = 5: 4 days of units produced1EOQ sets how much to order, and ROL sets whenX = -β ln U, from the inverse transformX is (aX + c) mod mMahmoud Abas|Monte Carlo Simulation