1 Simulation Chapter Ten. 2 13.1 Overview of Simulation When do we prefer to develop simulation model over an analytic model? When not all the underlying.

Slides:



Advertisements
Similar presentations
McGraw-Hill/Irwin Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. A PowerPoint Presentation Package to Accompany Applied Statistics.
Advertisements

Statistical Inventory control models I
Chapter 18 If mathematical analysis is too difficult, we can try each possibility out on paper. That way we can find which alternative appears to work.
1 Overview of Simulation When do we prefer to develop simulation model over an analytic model? When not all the underlying assumptions set for analytic.
11 Simulation. 22 Overview of Simulation – When do we prefer to develop simulation model over an analytic model? When not all the underlying assumptions.
Table of Contents Chapter 12 (Computer Simulation: Basic Concepts)
1 1 Slide © 2003 South-Western /Thomson Learning™ Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Session 8b Decision Models -- Prof. Juran.
Chapter 10: Simulation Modeling
Experimental Design, Response Surface Analysis, and Optimization
1 Chapter 12 Inference About One Population Introduction In this chapter we utilize the approach developed before to describe a population.In.
(Monté Carlo) Simulation
1 Introduction to Operations Research Prof. Fernando Augusto Silva Marins
Review of Probability Distributions
Spreadsheet Simulation
Spreadsheet Demonstration
FIN 685: Risk Management Topic 5: Simulation Larry Schrenk, Instructor.
Simulation A Queuing Simulation. Example The arrival pattern to a bank is not Poisson There are three clerks with different service rates A customer must.
1 Review problem #1 Text problem 9 - 6, 7 Weekly sales (in hundreds) of PERT shampoo at the SaveMor drug chain for the past 16 weeks are as follows: Management.
Chapter 9 Chapter 10 Chapter 11 Chapter 12
Building and Running a FTIM n 1. Define the system of interest. Identify the DVs, IRVs, DRVs, and Objective. n 2. Develop an objective function of these.
Lecture 4 Chapter 11 wrap-up
Simulation.
Introduction to Simulation. What is simulation? A simulation is the imitation of the operation of a real-world system over time. It involves the generation.
Lecture Inference for a population mean when the stdev is unknown; one more example 12.3 Testing a population variance 12.4 Testing a population.
© 2004 by Prentice Hall, Inc., Upper Saddle River, N.J F-1 Operations Management Simulation Module F.
1 Chapter 12 Inference About a Population 2 Introduction In this chapter we utilize the approach developed before to describe a population.In this chapter.
Chapter 14 Simulation. Monte Carlo Process Statistical Analysis of Simulation Results Verification of the Simulation Model Computer Simulation with Excel.
Module C10 Simulation of Inventory/Queuing Models.
Simulation Basic Concepts. NEED FOR SIMULATION Mathematical models we have studied thus far have “closed form” solutions –Obtained from formulas -- forecasting,
Lab 01 Fundamentals SE 405 Discrete Event Simulation
Monté Carlo Simulation MGS 3100 – Chapter 9. Simulation Defined A computer-based model used to run experiments on a real system.  Typically done on a.
Confidence Intervals and Hypothesis Testing - II
Simulation Output Analysis
Spreadsheet Modeling & Decision Analysis
Example 16.1 Ordering calendars at Walton Bookstore
Managerial Decision Modeling with Spreadsheets
1 Sampling and Sampling Distributions Dr. Jerrell T. Stracener, SAE Fellow Leadership in Engineering EMIS 7370/5370 STAT 5340 : PROBABILITY AND STATISTICS.
Simulation Examples ~ By Hand ~ Using Excel
 1  Outline  stages and topics in simulation  generation of random variates.
Introduction to Management Science
Economics 173 Business Statistics Lecture 6 Fall, 2001 Professor J. Petry
1 SMU EMIS 7364 NTU TO-570-N Inferences About Process Quality Updated: 2/3/04 Statistical Quality Control Dr. Jerrell T. Stracener, SAE Fellow.
IE 429, Parisay, January 2010 What you need to know from Probability and Statistics: Experiment outcome: constant, random variable Random variable: discrete,
Example simulation execution The Able Bakers Carhops Problem There are situation where there are more than one service channel. Consider a drive-in restaurant.
Outline of Chapter 9: Using Simulation to Solve Decision Problems Real world decisions are often too complex to be analyzed effectively using influence.
Simulation is the process of studying the behavior of a real system by using a model that replicates the behavior of the system under different scenarios.
Simulation Examples and General Principles
Chapter 10 Verification and Validation of Simulation Models
Simulation Using computers to simulate real- world observations.
WOOD 492 MODELLING FOR DECISION SUPPORT Lecture 25 Simulation.
Simulation is the process of studying the behavior of a real system by using a model that replicates the system under different scenarios. A simulation.
Computer Simulation. The Essence of Computer Simulation A stochastic system is a system that evolves over time according to one or more probability distributions.
Waiting Lines and Queuing Theory Models
1 1 Slide © 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole.
1 1 Slide © 2009 South-Western, a part of Cengage Learning Slides by John Loucks St. Edward’s University.
1 1 Slide Simulation Professor Ahmadi. 2 2 Slide Simulation Chapter Outline n Computer Simulation n Simulation Modeling n Random Variables and Pseudo-Random.
CDAE Class 23 Nov. 14 Last class: Result of Quiz 6 4. Queuing analysis and applications Project 3 Today: 4. Queuing analysis and applications Problem.
Simulation Chapter 16 of Quantitative Methods for Business, by Anderson, Sweeney and Williams Read sections 16.1, 16.2, 16.3, 16.4, and Appendix 16.1.
Chapter 12 Inference About One Population. We shall develop techniques to estimate and test three population parameters.  Population mean   Population.
MODELING AND SIMULATION CS 313 Simulation Examples 1.
Chapter 2 Simulation Examples. Simulation steps using Simulation Table 1.Determine the characteristics of each of the inputs to the simulation (probability.
Managerial Decision Making Chapter 13 Queuing Models.
Introduction to Simulation Chapter 12. Introduction to Simulation  In many spreadsheets, the value for one or more cells representing independent variables.
Computer Simulation Henry C. Co Technology and Operations Management,
Prepared by Lloyd R. Jaisingh
Modeling and Simulation CS 313
Chapter 10 Verification and Validation of Simulation Models
Professor S K Dubey,VSM Amity School of Business
Simulation Part 1: Simulation with Discrete Random Variables
Presentation transcript:

1 Simulation Chapter Ten

Overview of Simulation When do we prefer to develop simulation model over an analytic model? When not all the underlying assumptions set for analytic model are valid. When mathematical complexity makes it hard to provide useful results. When “good” solutions (not necessarily optimal) are satisfactory. A simulation develops a model to numerically evaluate a system over some time period. By estimating characteristics of the system, the best alternative from a set of alternatives under consideration can be selected.

3 Continuous simulation systems monitor the system each time a change in its state takes place. Discrete simulation systems monitor changes in a state of a system at discrete points in time. Simulation of most practical problems requires the use of a computer program Overview of Simulation

4 Approaches to developing a simulation model Using add-ins to Excel such or Crystal Ball Using general purpose programming languages such as: FORTRAN, PL/1, Pascal, Basic. Using simulation languages such as GPSS, SIMAN, SLAM. Using a simulator software program Overview of Simulation Modeling and programming skills, as well as knowledge of statistics are required when implementing the simulation approach.

Monte Carlo Simulation Monte Carlo simulation generates random events. Random events in a simulation model are needed when the input data includes random variables. To reflect the relative frequencies of the random variables, the random number mapping method is used.

6 Jewel Vending Company (JVC) installs and stocks vending machines. Bill, the owner of JVC, considers the installation of a certain product (“Super Sucker” jaw breaker) in a vending machine located at a new supermarket. JEWEL VENDING COMPANY – an example for the random mapping technique

7 Data The vending machine holds 80 units of the product. The machine should be filled when it becomes half empty. Daily demand distribution is estimated from similar vending machine placements. P(Daily demand = 0 jaw breakers) = 0.10 P(Daily demand = 1 jaw breakers) = 0.15 P(Daily demand = 2 jaw breakers) = 0.20 P(Daily demand = 3 jaw breakers) = 0.30 P(Daily demand = 4 jaw breakers) = 0.20 P(Daily demand = 5 jaw breakers) = 0.05 Bill would like to estimate the expected number of days it takes for a filled machine to become half empty. Bill would like to estimate the expected number of days it takes for a filled machine to become half empty. JEWEL VENDING COMPANY – an example of the random mapping technique

8 Solution Expected time between refills Is this the good value or only a good estimation ?

Random number mapping uses the probability function to generate random demand. A number between 00 and 99 is selected randomly The daily demand is determined by the mapping demonstrated below Random number mapping – The Probability function Approach Demand

Random number mapping – The Cumulative Distribution Approach The daily demand X is determined by the random number Y between 0 and 1, such that X is the smallest value for which F(X)  Y. F(1) =.25 <.34 F(2) =.45 >.34 Y =

11 A random demand can be generated by hand (for small problems) from a table of pseudo random numbers. Using Excel a random number can be generated by The RAND() function The random number generation option (Tools>Data Analysis) Simulation of the JVC Problem

12 Simulation of the JVC Problem Since we have two digit probabilities, we use the first two digits of each random number An illustration of generating a daily random demand.

13 The simulation is repeated and stops once total demand reaches 40 or more. Simulation of the JVC Problem The number of “simulated” days required for the total demand to reach 40 or more is recorded.

14 The purpose of performing the simulation runs is to find the average number of days required to sell 40 jaw breakers. Each simulation run ends up with (possibly) a different number of days. A hypothesis test is conducted to test whether or not  = 16. Null hypothesisH 0 :   16 Alternative hypothesis H A :   16 Simulation Results and Hypothesis Tests

15 The test: Define  (the significance level). Let n be the number of replication runs. Build the t-statistic The t-statistic can be used if the random variable observed (number of day required for the total demand to be 40 or more) is normally distributed, while the standard deviation is unknown. Reject H 0 if t > t  / 2 or t <- t  / 2 (t  /2 has n-1 degrees of freedom.) Simulation Results and Hypothesis Tests

16 Trials = 1 Max=…; sales = 0 S = 0; S2 = 0 Day = 0 Determine Daily demand (D) Sales = Sales + D Day = Day + 1 Sales < 40 Record day S = S + day S2 = S2 + Day 2 Trials< Max End Trials = Trials + 1 Sales = 0 Day = 0 JVC – A Flow Chart Flow charts help guide the simulation program Yes No Yes

17 JVC – Excel Spreadsheet =MAX(A5:A105 ) =IF(C5<40,A5+1,"") =IF(C5<40,VLOOKUP(RAND(),$K$6:$L$11,2),"") =IF(C5<40,B6+C5,"" ) VLOOKUP TABLE Enter this data Drag A5:C5 to A105:C105

18 After running 10 simulation replications on Excel, we have the following results. Number of days to sell 40 or more Jaw Breakers = ( ) / 10 = 16.6 s 2 = [( ) 2 +( ) ( ) 2 ] = t = ( ) / [ / ] = For  = 0.05 and n-1 = 9 degrees of freedom, t 0.05 / 2 = = ( ) / 10 = 16.6 s 2 = [( ) 2 +( ) ( ) 2 ] = t = ( ) / [ / ] = For  = 0.05 and n-1 = 9 degrees of freedom, t 0.05 / 2 =

19 JVC – Excel Spreadsheet =(E3-16)/E4 =TDIST(ABS(H5),9,2) The p-value =.2966… This value is quite high compared to any reasonable significance level. Based on this data there is insufficient evidence to infer that the mean number of days differs from 16.

20 Estimating the Average Number of Days Before a Refill is needed. To obtain more reliable results more runs are made. Summary of results ReplicationsAverage # of days t valuet(0.025) The z value

21 Determining Confidence Intervals What is our best estimate for  Confidence interval might help answer this question When n <30, a (1-  )% confidence interval is When, a (1-  )% confidence interval is n is the number of replications. Example: n = 10000, 95% confidence interval is [16.42,16.50]

Simulation Modeling of Inventory Systems Inventory simulation models are used when underlying assumptions needed for analytical solutions are not met. Typical inputs into the simulation model are Order cost Holding cost Lead time Demand distribution

Simulation Modeling of Inventory Systems Inventory simulation models are used when underlying assumptions needed for analytical solutions are not met. Typical inputs into the simulation model are Order cost Holding cost Lead time Demand distribution Typical output is the average total cost for a given inventory policy

24 Frequently, the Fixed-Time Simulation approach is appropriate for the modeling of inventory problems. The system is monitored periodically. The activities associated with demand, orders, and shipments are determined, and the system is updated accordingly. Typical output is the average total cost for a given inventory policy Simulation Modeling of Inventory Systems – continued

25 Frequently, the Fixed-Time Simulation approach is appropriate for the modeling of inventory problems. The system is monitored periodically. The activity associated with demand, orders, and shipments is determined, and the system is updated.

26 ALLEN APPLIANCE COMPANY Allen Appliance stocks and sells a certain bread maker. Data Unit cost is $260. Annual holding cost rate is 26% Orders are placed at the end of a week, and arrive at the beginning of a week. Ordering cost is $45 per order. Backorder cost is $5 per unit per week. Backorder administrative cost is $2 per unit.

27 Distributions The number of retailers that wish to purchase bread makers can be described by the Poisson distribution with = 2. The demand per customer is given by the following empirical distribution P(demand = 1) = 0.10 P(demand = 2) = 0.15 P(demand = 3) = 0.40 P(demand = 4) = 0.35 The lead time has the following empirical distribution P(lead time = 1 weeks) = 0.2 P(lead time = 2 weeks) = 0.6 P(lead time = 3 weeks) = 0.2 What is the optimal inventory policy for Allen? What is the optimal inventory policy for Allen?

28 Inventory Systems (R,M) : order point, order up to level when the inventory level reaches R, the firm orders enough to bring the stock to a level M when the orders arrives (R,Q) : order point, order quantity the firm orders Q units the level of the stock reaches the inventory level R

29 Average weekly demand = 0.10(1)+0.15(2)+0.40(3)+0.35(4) = 3 units Weekly holding cost = C h =(annual holding cost)*Wholesale cost)/52 = (26%*$200/52) = $1 per unit per week Average lead time for delivery = 0.2(1) + 0.6(2) + 0.2(3) = 2 weeks

30 SOLUTION Constructing random number mappings for: The number of retailers Who order in a week ( t) k e - t k! = 2; t = 1 week P(X = k) = P(0) = P(1) = ` P(2) = P(3) = P(4) = P(5) = P(6) = P(7) = P(8) = P(9) = Retailers’ demand Lead time 1 week weeks weeks 8-9

31 There are several cases of inventory cost to consider: There is inventory at the beginning and at the end of a week. Average inventory = (Initial inventory + Ending inventory) / 2 Weekly holding cost = C h (Average inventory) There are backordered units at the beginning and at the end of a week. Average backorder = (initial backorders + ending backorders) / 2 Weekly backorder cost = C s (Average backorder) +  additional backorders during the week)

32 There is inventory at the beginning, and backordered units at the end of a week. (Average inventory) = ( Proportion of time “in stock ” )(Average inventory) (Average backorder) = (Proportion of time “out of stock”)(Average backorder) Holding cost and backorder costs are calculated as before.

33 Example : Stock at the beginning of the week : 3 Demand during the week : 8 Number of backorders at the end of the week : 5 Assumption : in-stock period : 3/8 of the week out-of-stock period : 5/8 of the week Results Average inventory level=.375(1.5)+0.625(0)=.5625 units Holding cost for the week =.5625($1)=$.5625 Average backorder level=.375(0)+0.625(2.5)= units Backorder cost for the week=1.5625($5)+5($2) =$

34 Simulation of the (R,Q) system Inventory Demand Backorders / Reordering Costs WK B1 R1 #A R2 D E1 A1 BB #B EB AB R3 LT HC BC AC RC TC $ $ $ $45 $57.5 Initial inventory Random number Number of orders Random number Demand Ending inventory Average inventory Beginning backorders Ending backorders Average backordersLead time Holding cost A1($1) Backorder cost AB($5)  (#B) Order cost $45 Initial inventoryEnding inventory An order must be placed because ending inventory is less than the reorder point (=10)

35 Simulation of the (R,Q) System. Inventory Demand Backorders / Reordering Costs WK B1 R1 #A R2 D E1 A1 BB #B EB AB R3 LT HC BC AC RC TC $ $ $ $ $45 $54.5 Initial inventory Random number Number of orders Random number Demand Ending inventory Average inventory Beginning backorders Ending backorders Average backordersLead time Holding cost A1($1) Backorder cost AB($5)  (#B) Order cost $45 Initial inventory Ending inventory (0+12)/2$5(Average inventory)$2(Number of new backorders) Beginning inventory = ending inv. last week+ order received - backorders accumulated =

36 Results for ten simulated weeks Average weekly cost for the (R,Q) policy is ( …) / 10 = $30.68 Average weekly cost for the (R,M) policy is $27.90 Based on ten weeks runs the (R,M) policy is preferred. More runs are needed to substantiate this result.

Simulation of a Queuing System In queuing systems time itself is a random variable. Therefore, we use the next event simulation approach. The simulated data are updated each time a new event takes place (not at a fixed time periods.) The process interactive approach is used in this kind of simulation (all relevant processes related to an item as it moves through the system, are traced and recorded).

38 CAPITAL BANK An example of queuing system simulation Capital Bank is considering opening the bank on Saturdays morning from 9:00 a.m. Management would like to determine the waiting time on Saturday morning based on the following data:

39 CAPITAL BANK Data: There are 5 teller positions of which only three will be staffed. Ann Doss is the head teller, experienced, and fast. Bill Lee and Carla Dominguez are associate tellers less experienced and slower.

40 CAPITAL BANK Data: Service time distributions: Ann’s Service Time Distribution Bill and Carla’s Service Time Distribution Service Time Probability Service TimeProbability.5 minutes.051 minute

41 CAPITAL BANK Data: Customer inter-arrival time distribution inter-arrival timeProbability.5 Minutes Service priority rule is first come first served A simulation model is required to analyze the service.

42 Calculating expected values: E(inter-arrival time) =.5(.65)+1( (.15)+2(.05) =.80 minutes [75 customers arrive per hour on the average, (60/.8=75)] E(service time for Ann) =.5(.05)+1(.10)+…+3.5(.05) = 2 minutes [Ann can serve 60/2=30 customers per hour on the average] E(Service time for Bill and Carla) = 1(.05)+1.5(.15)+…+4.5(.05) = 2.5 minutes [Bill and Carla can serve 60/2.5=24 customers per hour on the average]. CAPITAL BANK – Solution

43 To reach a steady state the bank needs to employ all the three tellers (30+2(24) = 78 > 75). CAPITAL BANK – Solution

44 If no customer waits in line, an arriving customer seeks service by a free teller in the following order: Ann, Bill, Carla. If all the tellers are busy the customer waits in line and takes then the next available teller. The waiting time is the time a customer spends in line, and is calculated by [Time service begins ] minus [Arrival Time] CAPITAL BANK – The Simulation logic

45 CAPITAL – Simulation Demonstration MappingInterarrival time 80 – minutes Mapping Ann’s Service time 35 – 64 2 minutes 3.5 Ann Bill 1.5

46 CAPITAL – Simulation Demonstration MappingInterarrival time 80 – minutes Mapping Bill’s Service time 40 – minutes Ann Bill

47 CAPITAL – Simulation Demonstration Waiting time

48 CAPITAL – 1000 Customer Simulation

49 CAPITAL – 1000 Customer Simulation This simulation estimates two performance measures: Average waiting time in line (W q ) = 1.67 minutes Average waiting time in the system W = minutes This simulation estimates two performance measures: Average waiting time in line (W q ) = 1.67 minutes Average waiting time in the system W = minutes To determine the other performance measures, we can use Little’s formulas: Average number of customers in line L q =(1/.80)(1.67) = customers Average number of customers in the system = (1/.80)(3.993) = 4.99 customers. To determine the other performance measures, we can use Little’s formulas: Average number of customers in line L q =(1/.80)(1.67) = customers Average number of customers in the system = (1/.80)(3.993) = 4.99 customers. Average inter-arrival time =.80 minutes.

50 Mapping for Continuous Random Variables Example The Explicit inverse distribution method can be used to generate a random number X from the exponential distribution with  = 2 (i.e. service time is exponentially distributed, with an average of 2 customers per minute). Randomly select a number from the uniform distribution between 0 and 1. The number selected is Y = Solve the equation: X = F -1 (Y) = – (1/  )ln(1 – Y) = –(1/2)ln( ) =.203 minutes.

51 Mapping for Continuous Random Variables – Using Excel =RAND() Drag to cell B13 =-LN(1-B4)/$B$1 Drag to cell C13

52 Excel can generate continuously distributed random numbers for various distribution. Normal =NORMINV Beta: =BETAINV Chi squared: =CHIINV Gamma:=GAMMAINV Random numbers and Excel

53 Random numbers Normally distributed by Excel – =NORMINV(RAND(),$B$1,$B$2) Drag to cell B24

54 Simulation of an M / M / 1 Queue Applying the process interaction approach we have: New arrival time = Previous arrival time + Random interarrival time. Service finish time = Service start time + Random service time. A customer joins the line if there is a service in progress (its arrival time < current service finish time ). A customer gets served when the server becomes idle. Waiting times and number of customers in line and in the system are continuously recorded.

55 LANFORD SUB SHOP An example of the M/M/1 queuing simulation Lanford Sub Shop sells sandwiches prepared by its only employee, the owner Frank Lanford. Frank can serve a customer in 1 minute on the average according to an exponential distribution. During lunch time, 11:30 a.m. to 1:30 p.m., an average of 30 customers an hour arrive at the shop according to a Poisson distribution.

56 LANFORD SUB SHOP Using simulation, Frank wants to determine the average time a customer must wait for service Using simulation, Frank wants to determine the average time a customer must wait for service

57 LANFORD SUB SHOP - Solution Input Data  = 30,  = 60. Data generated by the simulation: C# = The number of the arriving customer. R#1 = The random number used to determine interarrivals. IAT = The interarrival time. AT = The arrival time for the customer. TSB = The time at which service begins for the customer. WT = The waiting time a customer spends in line. R#2 = The random number used to determine the service time. ST = The service time. TSE = The time at which service end for the customer

58 The interarrival time = - ln( ) / 30 = hours = 1.09 minutes The explicit inverse method Arrival time of customer 3 = Arrival time of customer = Waiting time = End of service = Average waiting time = ( ) / 10 = 1.59 Average waiting time = ( ) / 10 = 1.59 LANFORD SUB SHOP – Simulation for first 10 Customers T ime S ervice E nds S ervice T ime T ime S ervice B egins A rrival T ime

59 LANFORD SUB SHOP – Simulation for first 1000 Customers