Upload
randall-osborne
View
253
Download
5
Tags:
Embed Size (px)
Citation preview
Chapter 4 - Simulation 1
Chapter 4
Simulation
Introduction to Management Science
8th Edition
by
Bernard W. Taylor III
Chapter 4 - Simulation 2
The Monte Carlo Process
Computer Simulation with Excel Spreadsheets
Simulation of a Queuing System
Continuous Probability Distributions
Statistical Analysis of Simulation Results
Crystal Ball
Verification of the Simulation Model
Areas of Simulation Application
Chapter Topics
Chapter 4 - Simulation 3
Analogue simulation replaces a physical system with an analogous physical system that is easier to manipulate.
In computer mathematical simulation a system is replaced with a mathematical model that is analyzed with the computer.
Simulation offers a means of analyzing very complex systems that cannot be analyzed using the other management science techniques in the text.
Overview
Chapter 4 - Simulation 4
Homework Reduction
From problems 5, 9, 13, 15, 19, 21, 23:select four, and complete only those four.
Then, do:
Either one of the problems from among 25, 27, 29:(Qrystal Ball program — so, you must describe how you
used the program, cite the results, and explain what the results indicate.)
Or do problem 17 (by hand or using Excel)Simulate five trials of ten random turns around the corner
Chapter 4 - Simulation 5
A large proportion of the applications of simulations are for probabilistic models.
The Monte Carlo technique is defined as a technique for selecting numbers randomly from a probability distribution for use in a trial (computer run) of a simulation model.
The basic principle behind the process is the same as in the operation of gambling devices in casinos (such as those in Monte Carlo, Monaco).
Gambling devices produce numbered results from well-defined populations.
Monte Carlo Process
Chapter 4 - Simulation 6
Table 4.1Probability Distribution of Demand for Laptop PC’s
In the Monte Carlo process, values for a random variable are generated by sampling from a probability distribution.
Example: ComputerWorld demand data for laptops selling for $4,300 over a period of 100 weeks.
Monte Carlo ProcessUse of Random Numbers (1 of 10)
Chapter 4 - Simulation 7
The purpose of the Monte Carlo process is to generate the random variable, demand, by sampling from the probability distribution P(x).
The partitioned roulette wheel replicates the probability distribution for demand if the values of demand occur in a random manner.
The segment at which the wheel stops indicates demand for one week.
Monte Carlo ProcessUse of Random Numbers (2 of 10)
Chapter 4 - Simulation 8
Figure 4.1A Roulette Wheel for Demand
Monte Carlo ProcessUse of Random Numbers (3 of 10)
Chapter 4 - Simulation 9
Figure 4.2Numbered Roulette Wheel
Monte Carlo ProcessUse of Random Numbers (4 of 10)
When wheel is spun actual demand for PC’s is determined by a number at rim of the wheel.
Chapter 4 - Simulation 10
Table 4.2Generating Demand from Random Numbers
Monte Carlo ProcessUse of Random Numbers (5 of 10)
Process of spinning a wheel can be replicated using random numbers alone.
Transfer random numbers for each demand value from roulette wheel to a table.
Chapter 4 - Simulation 11
Select number from a random number table:
Table 4.3Random Number Table
Monte Carlo ProcessUse of Random Numbers (6 of 10)
Chapter 4 - Simulation 12
Repeating selection of random numbers simulates demand for a period of time.
Estimated average demand = 31/15 = 2.07 laptop PCs per week.
Estimated average revenue = $133,300/15 = $8,886.67($133,300 = $4,300 31).
Monte Carlo ProcessUse of Random Numbers (7 of 10)
Chapter 4 - Simulation 13
Monte Carlo ProcessUse of Random Numbers (8 of 10)
Chapter 4 - Simulation 14
Average demand could have been calculated analytically:
per week sPC' 1.5 )4)(10(.)3)(10(.)2)(20(.)1)(40(.)0)(20(.)(
:therefore
valuesdemanddifferent ofnumber thedemand ofy probabilit )(i valuedemand
:where
1)()(
=++++=
===
∑=
=
xE
nxPx
n
ixxPxE
i
i
ii
Monte Carlo ProcessUse of Random Numbers (9 of 10)
Chapter 4 - Simulation 15
The more periods simulated, the more accurate the results.
Simulation results will not equal analytical results unless enough trials have been conducted to reach steady state.
Often difficult to validate results of simulation - that true steady state has been reached and that simulation model truly replicates reality.
When analytical analysis is not possible, there is no analytical standard of comparison thus making validation even more difficult.
Monte Carlo ProcessUse of Random Numbers (10 of 10)
Chapter 4 - Simulation 16
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 using a numerical technique and thus are not true random numbers but pseudorandom numbers.
Computer Simulation with Excel SpreadsheetsGenerating Random Numbers (1 of 2)
Chapter 4 - Simulation 17
Artificially created random numbers must have the following characteristics:
The random numbers must be uniformly distributed.
The numerical technique for generating the numbers must be efficient.
The sequence of random numbers should reflect no (discernible) pattern.
Computer Simulation with Excel SpreadsheetsGenerating Random Numbers (2 of 2)
Chapter 4 - Simulation 18
Exhibit 4.1
Simulation with Excel Spreadsheets (1 of 3)
Chapter 4 - Simulation 19
Exhibit 4.2
Simulation with Excel Spreadsheets (2 of 3)
“Lookup”
Chapter 4 - Simulation 20
Exhibit 4.3
Simulation with Excel Spreadsheets (3 of 3)
Chapter 4 - Simulation 21
Exhibit 4.4
Revised ComputerWorld example; order size of one laptop each week.
Computer Simulation with Excel SpreadsheetsDecision Making with Simulation (1 of 2)
=1+MAX(G6-H6,0)
Order one laptopeach week
Chapter 4 - Simulation 22
Exhibit 4.5
Order size of two laptops each week.
Computer Simulation with Excel SpreadsheetsDecision Making with Simulation (2 of 2)
=2+MAX(G6-H6,0)
Order two laptopseach week
Chapter 4 - Simulation 23
Table 4.5Distribution of Arrival Intervals
Table 4.6Distribution of Service Times
Simulation of a Queuing SystemBurlingham Mills Example (1 of 3)
Chapter 4 - Simulation 24
Average waiting time = 12.5days/10 batches = 1.25 days per batch
Average time in the system = 24.5 days/10 batches = 2.45 days per batch
Simulation of a Queuing SystemBurlingham Mills Example (2 of 3)
Chapter 4 - Simulation 25
Simulation of a Queuing SystemBurlingham Mills Example (3 of 3)
Caveats:
Results may be viewed with skepticism.
Ten trials do not ensure steady-state results. In fact, the statistical error for N data-points is sqrt(N),so the relative statistical error is ~1/sqrt(N).
Starting conditions can affect simulation results.
If no batches are in the system at start, simulation must run until it replicates normal operating system.
If system starts with items already in the system, simulation must begin with items in the system.
Chapter 4 - Simulation 26
Exhibit 4.6
Computer Simulation with ExcelBurlingham Mills Example
Chapter 4 - Simulation 27
€
A continuous function must be used for continuous distributions.Example:
f(x)= x8
, 0≤ x≤ 4 where x = time (minutes)
Cumulative probability of x:
F(x)= x8
0
x∫ dx= 1
8x dx= 1
80
x∫ 1
2x2 ⎛
⎝ ⎜ ⎜
⎞
⎠ ⎟ ⎟0
x
F(x)= x216
Let F(x) = the random number r
r = x216
x= 4 rBy generating a random number,r, a value x for "time" is determined.
Example: if r = .25, x= 4 .25 = 2 minutes
Continuous Probability Distributions
0 4
1/2
Chapter 4 - Simulation 28
Machine Breakdown and Maintenance SystemSimulation (1 of 6)
Bigelow Manufacturing Company must decide if it should implement a machine maintenance program at a cost of $20,000 per year that would reduce the frequency of breakdowns and thus time for repair which is $2,000 per day in lost production.
A continuous probability distribution of the time between machine breakdowns:
f(x) = x/8, 0 x 4 weeks, where x = weeks between machine breakdowns
x = 4*sqrt(r1), value of x for a given value of r1.
Chapter 4 - Simulation 29
Table 4.8Probability Distribution of Machine Repair Time
Machine Breakdown and Maintenance SystemSimulation (2 of 6)
Chapter 4 - Simulation 30
Table 4.9Revised Probability Distribution of Machine Repair Time with the Maintenance Program
Machine Breakdown and Maintenance SystemSimulation (3 of 6)
Revised probability of time between machine breakdowns:
f(x) = x/18, 0 x6 weeks where x = weeks between machine breakdowns
x = 6*sqrt(r1)
Chapter 4 - Simulation 31
Table 4.10Simulation of Machine
Breakdowns and Repair Times
Machine Breakdown and Maintenance SystemSimulation (4 of 6)
Simulation of system without maintenance program (total annual repair cost of $84,000):
x = 4*sqrt(r1)
Chapter 4 - Simulation 32
Table 4.11Simulation of Machine
Breakdowns and Repair with the Maintenance
Program
Machine Breakdown and Maintenance SystemSimulation (5 of 6)
Simulation of system with maintenance program (total annual repair cost of $42,000):
x = 6*sqrt(r1)
Chapter 4 - Simulation 33
Machine Breakdown and Maintenance SystemSimulation (6 of 6)
Results and caveats:
Implement maintenance program since cost savings appear to be $42,000 per year and maintenance program
will cost $20,000 per year.
However, there are potential problems caused by simulating both systems only once.
Simulation results could exhibit significant variation since time between breakdowns and repair times are
probabilistic.
To be sure of accuracy of results, simulations of each system must be run many times and average results computed.
Efficient computer simulation required to do this.
Chapter 4 - Simulation 34
Exhibit 4.7
Machine Breakdown and Maintenance SystemSimulation with Excel (1 of 2)
Original machine breakdown example:
Chapter 4 - Simulation 35
Exhibit 4.8
Machine Breakdown and Maintenance SystemSimulation with Excel (2 of 2)
Simulation with maintenance program.
Chapter 4 - Simulation 36
Outcomes of simulation modeling are statistical measures such as averages.
Statistical results are typically subjected to additional statistical analysis to determine their degree of accuracy.
Confidence limits are developed for the analysis of the statistical validity of simulation results.
Statistical Analysis of Simulation Results (1 of 2)
Chapter 4 - Simulation 37
Formulas for 95% confidence limits:
upper confidence limit
lower confidence limit
where is the mean and the standard deviation from a sample of size n from any population.
We can be 95% confident that the true population mean will be between the upper confidence limit and lower confidence limit.
€
=x+(1.96)(σ / n)
€
=x−(1.96)(σ / n)
x
Statistical Analysis of Simulation Results (2 of 2)
Chapter 4 - Simulation 38
Exhibit 4.9
Simulation ResultsStatistical Analysis with Excel (1 of 3)
Simulation with maintenance program.
Chapter 4 - Simulation 39
Exhibit 4.10
Simulation ResultsStatistical Analysis with Excel (2 of 3)
Chapter 4 - Simulation 40
Exhibit 4.11
Simulation ResultsStatistical Analysis with Excel (3 of 3)
Chapter 4 - Simulation 41
Crystal BallOverview
Many realistic simulation problems contain more complex probability distributions than those used in the examples.
However there are several simulation add-ins for Excel that provide a capability to perform simulation analysis with a variety of probability distributions in a spreadsheet format.
Crystal Ball, published by Decisioneering, is one of these.
Crystal Ball is a risk analysis and forecasting program that uses Monte Carlo simulation to provide a statistical range of results.
Chapter 4 - Simulation 42
Recap of Western Clothing Company break-even and profit analysis:
Price (p) for jeans is $23; variable cost (cv) is $8; fixed cost (cf ) is $10,000.
Profit Z = vp - cf - vc; break-even volume v = cf/(p - cv) = 10,000/(23-8) = 666.7 pairs.
Crystal BallSimulation of Profit Analysis Model (1 of 17)
Chapter 4 - Simulation 43
Modifications to demonstrate Crystal Ball:
Assume volume is now volume demanded and is defined by a normal probability distribution with mean
of 1,050 and standard deviation of 410 pairs of jeans.
Price is uncertain and defined by a uniform probability distribution from $20 to $26.
Variable cost is not constant but defined by a triangular probability distribution.
Will determine average profit and profitability with given probabilistic variables.
Crystal BallSimulation of Profit Analysis Model (2 of 17)
Chapter 4 - Simulation 44
Exhibit 4.12
Crystal BallSimulation of Profit Analysis Model (3 of 17)
Chapter 4 - Simulation 45
Exhibit 4.13
Crystal BallSimulation of Profit Analysis Model (4 of 17)
Chapter 4 - Simulation 46
Exhibit 4.14
Crystal BallSimulation of Profit Analysis Model (5 of 17)
Chapter 4 - Simulation 47
Exhibit 4.15
Crystal BallSimulation of Profit Analysis Model (6 of 17)
Chapter 4 - Simulation 48
Exhibit 4.16
Crystal BallSimulation of Profit Analysis Model (7 of 17)
Chapter 4 - Simulation 49
Exhibit 4.17
Crystal BallSimulation of Profit Analysis Model (8 of 17)
Chapter 4 - Simulation 50
Exhibit 4.18
Crystal BallSimulation of Profit Analysis Model (9 of 17)
Chapter 4 - Simulation 51
Exhibit 4.19
Crystal BallSimulation of Profit Analysis Model (10 of 17)
Chapter 4 - Simulation 52
Exhibit 4.20
Crystal BallSimulation of Profit Analysis Model (11 of 17)
Chapter 4 - Simulation 53Exhibit 4.21
Crystal BallSimulation of Profit Analysis Model (12 of 17)
Chapter 4 - Simulation 54
Exhibit 4.22
Crystal BallSimulation of Profit Analysis Model (13 of 17)
Chapter 4 - Simulation 55
Exhibit 4.23
Crystal BallSimulation of Profit Analysis Model (14 of 17)
Chapter 4 - Simulation 56
Exhibit 4.24
Crystal BallSimulation of Profit Analysis Model (15 of 17)
Chapter 4 - Simulation 57
Exhibit 4.25
Crystal BallSimulation of Profit Analysis Model (16 of 17)
Chapter 4 - Simulation 58
Exhibit 4.26
Crystal BallSimulation of Profit Analysis Model (17 of 17)
Chapter 4 - Simulation 59
Analyst wants to be certain that model is internally correct and that all operations are logical and mathematically correct.
Testing procedures for validity:
Run a small number of trials of the model and compare with manually derived solutions.
Divide the model into parts and run parts separately to reduce complexity of checking.
Simplify mathematical relationships (if possible) for easier testing.
Compare results with actual real-world data.
Verification of the Simulation Model (1 of 2)
Chapter 4 - Simulation 60
Analyst must determine if model starting conditions are correct (system empty, etc).
Must determine how long model should run to insure steady-state conditions.
A standard, fool-proof procedure for validation is not available.
Validity of the model rests ultimately on the expertise and experience of the model developer.
Verification of the Simulation Model (2 of 2)
Chapter 4 - Simulation 61
Queuing
• Inventory Control
• Production and Manufacturing
• Finance
• Marketing
• Public Service Operations
• Environmental and Resource Analysis
Some Areas of Simulation Application
Chapter 4 - Simulation 62
Data
Willow Creek Emergency Rescue Squad
Minor emergency requires two-person crew, regular, a three-person crew, and major emergency, a five-person crew.
Example Problem Solution (1 of 6)
Chapter 4 - Simulation 63
Distribution of number of calls per night and emergency type:
Required: Manually simulate 10 nights of calls; determine average number of calls each night and maximum number of crew members that might be needed on any given night.
Calls Probability 0 1 2 3 4 5 6
.05
.12
.15
.25
.22
.15
.06 1.00
Emergency Type Probability Minor Regular Major
.30
.56
.14 1.00
Example Problem Solution (2 of 6)
Chapter 4 - Simulation 64
Calls Probability Cumulative Probability
Random Number Range, r1
0 1 2 3 4 5 6
.05
.12
.15
.25
.22
.15
.06 1.00
.05
.17
.32
.57
.79
.94 1.00
1 – 5 6 – 17
18 – 32 33 – 57 58 – 79 80 – 94
95 – 99, 00
Emergency Type
Probability Cumulative Probability
Random Number Range, r1
Minor Regular Major
.30
.56
.14 1.00
.30
.86 1.00
1 – 30 31 – 86
87 – 99, 00
Solution Step 1: Develop random number ranges for the probability distributions.
Example Problem Solution (3 of 6)
Chapter 4 - Simulation 65
Step 2: Set Up a Tabular Simulation (use second column of random numbers in Table 4.3).
Example Problem Solution (4 of 6)
Chapter 4 - Simulation 66
Step 2 continued:
Example Problem Solution (5 of 6)
Chapter 4 - Simulation 67
Step 3: Compute Results:
average number of minor emergency calls per night= 10/10 =1.0
average number of regular emergency calls per night= 14/10 = 1.4
average number of major emergency calls per night= 3/10 = 0.30
If calls of all types occurred on same night, maximum number of squad members required would be 4.
Example Problem Solution (6 of 6)
Chapter 4 - Simulation 68