Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 1 Slide Simulation. 2 2 Simulation n Advantages and Disadvantages of Simulation n Simulation Modeling n Random Variables n Simulation Languages n Validation.

Similar presentations


Presentation on theme: "1 1 Slide Simulation. 2 2 Simulation n Advantages and Disadvantages of Simulation n Simulation Modeling n Random Variables n Simulation Languages n Validation."— Presentation transcript:

1 1 1 Slide Simulation

2 2 2 Simulation n Advantages and Disadvantages of Simulation n Simulation Modeling n Random Variables n Simulation Languages n Validation and Statistical Analysis

3 3 3 Slide Computer Simulation n Computer simulation is one of the most frequently employed management science techniques. n It is typically used to model random processes that are too complex to be solved by analytical methods.

4 4 4 Slide Real World Variables Which Are Probabilistic in Nature n Inventory demand n Lead time for orders to arrive n Time between machine breakdowns n Times between arrivals at a service facility n Service times n Times to complete project activities n Number of employees absent from work each day

5 5 5 Slide The idea behind simulation is to: n Imitate a real-world situation mathematically n Study its properties and operating characteristics n draw conclusions and make action recommendations based on the results of the simulation

6 6 6 Slide Goal of simulation study Examples: n Total production n Average waiting time in queue of parts at the machine n The maximum number of parts waiting in the queue n Average flowtime of parts n Utilization of the machine

7 7 7 Slide Advantages of Computer Simulation It is very flexible, relatively straightforward It is very flexible, relatively straightforward can be used to analyze large and complex real-world problems for which closed-form analytical solutions are not possible can be used to analyze large and complex real-world problems for which closed-form analytical solutions are not possible allows for the inclusion of real-world complications which most other techniques do not permit allows for the inclusion of real-world complications which most other techniques do not permit makes possible “ time compression ” makes possible “ time compression ” allows one to ask “ what if ” type questions allows one to ask “ what if ” type questions does not interfere with the real-world system does not interfere with the real-world system allows us to study the interactive effect of individual components or variables allows us to study the interactive effect of individual components or variables

8 8 8 Slide Disadvantages of Computer Simulation n Can be expensive and time consuming n Does not yield optimal solution n Requires good managerial input n Is not generalizable to other situations

9 9 9 Slide The Process of Simulation. Define the Problem Introduce important variables Construct simulation model Specify values of variables to be tested Conduct the simulation Examine the results Select best course of action

10 10 Slide Simulation Modeling n One begins a simulation modeling by developing a mathematical statement of the problem. n The model should be realistic yet solvable within the speed and storage constraints of the computer system being used. n Input values for the model as well as probability estimates for the random variables must then be determined.

11 11 Slide The Monte Carlo Simulation Technique Setup probability distribution for important variables Setup probability distribution for important variables Build cumulative distribution for each variable Build cumulative distribution for each variable Establish interval of random numbers for each variable Establish interval of random numbers for each variable Generate random numbers Generate random numbers Simulate a series of trials Simulate a series of trials

12 12 Slide Example: Probablistics, Inc. The price change of shares of Probablistics, Inc. has been observed over the past 50 trades. The frequency distribution is as follows: Price Change Number of Trades Price Change Number of Trades -3/8 4 -3/8 4 -1/4 2 -1/4 2 -1/8 8 -1/8 8 0 20 0 20 +1/8 10 +1/8 10 +1/4 3 +1/4 3 +3/8 2 +3/8 2 +1/2 1 +1/2 1

13 13 Slide Example: Probablistics, Inc. n Relative Frequency Distribution and Random Number Mapping Price Change Relative Frequency Random Numbers Price Change Relative Frequency Random Numbers -3/8.08 00 - 07 -3/8.08 00 - 07 -1/4.04 08 - 11 -1/4.04 08 - 11 -1/8.16 12 - 27 -1/8.16 12 - 27 0.40 28 - 67 0.40 28 - 67 +1/8.20 68 - 87 +1/8.20 68 - 87 +1/4.06 88 - 93 +1/4.06 88 - 93 +3/8.04 94 - 97 +3/8.04 94 - 97 +1/2.02 98 - 99 +1/2.02 98 - 99 TOTAL 1.00 TOTAL 1.00

14 14 Slide Example: Probablistics, Inc. If the current price per share of Probablistics is 23, use random numbers to simulate the price per share over the next 10 trades. For random numbers, use the following: 21, 84, 07, 30, 94, 57, 57, 19, 84, 84 21, 84, 07, 30, 94, 57, 57, 19, 84, 84

15 15 Slide Example: Probablistics, Inc. n Simulation Worksheet Trade Random Price Stock Trade Random Price Stock Number Number Change Price Number Number Change Price 1 21 -1/8 22 7/8 1 21 -1/8 22 7/8 2 84 +1/8 23 2 84 +1/8 23 3 07 -3/8 22 5/8 3 07 -3/8 22 5/8 4 30 0 22 5/8 4 30 0 22 5/8 5 94 +3/8 23 5 94 +3/8 23 6 57 0 23 6 57 0 23 7 57 0 23 7 57 0 23 8 19 -1/8 22 7/8 8 19 -1/8 22 7/8 9 84 +1/8 23 9 84 +1/8 23 10 84 +1/8 23 1/8 10 84 +1/8 23 1/8

16 16 Slide Example: Probablistics, Inc. n Theoretical Results and Observed Results Based on the probability distribution, the expected price change per trade can be calculated by: (.08)(-3/8) + (.04)(-1/4) + (.16)(-1/8) + (.40)(0) (.08)(-3/8) + (.04)(-1/4) + (.16)(-1/8) + (.40)(0) + (.20)(1/8) + (.06)(1/4) + (.04)(3/8) + (.02)(1/2) = +.005 + (.20)(1/8) + (.06)(1/4) + (.04)(3/8) + (.02)(1/2) = +.005 The expected price change for 10 trades is (10)(.005) =.05. Hence, the expected stock price after 10 trades is 23 +.05 = 23.05. This is lower than the simulated price of 23.125.

17 17 Slide Random Variables n Random variable values are utilized in the model through a technique known as Monte Carlo simulation. n Each random variable is mapped to a set of numbers so that each time one number in that set is generated, the corresponding value of the random variable is given as an input to the model. n The mapping is done in such a way that the likelihood that a particular number is chosen is the same as the probability that the corresponding value of the random variable occurs.

18 18 Slide Example: Mark Off ’ s Process Mark Off is a specialist at repairing large metal- cutting machines that use laser technology. His repair territory consists of the cities of Austin, San Antonio, and Houston. His day-to-day repair assignment locations can be modeled as a Markov process. The transition matrix is: Austin San Antonio Houston Austin San Antonio Houston Austin.60.15.25 Austin.60.15.25 This This Day's San Antonio.20.75.05 Day's San Antonio.20.75.05 Location Location Houston.15.05.80 Houston.15.05.80 Next Day's Location

19 19 Slide Example: Mark Off ’ s Process n Random Number Mappings Currently in Currently in Currently in Currently in Currently in Currently in Austin San Antonio Houston Austin San Antonio Houston Next-Day Random Next-Day Random Next-Day Random Location Numbers Location Numbers Location Numbers Location Numbers Location Numbers Location Numbers Austin 00 - 59 Austin 00 - 19 Austin 00 - 14 Austin 00 - 59 Austin 00 - 19 Austin 00 - 14 San Ant. 60 - 74 San Ant. 20 - 94 San Ant. 15 - 19 San Ant. 60 - 74 San Ant. 20 - 94 San Ant. 15 - 19 Houston 75 - 99 Houston 95 - 99 Houston 20 - 99 Houston 75 - 99 Houston 95 - 99 Houston 20 - 99

20 20 Slide Example: Mark Off ’ s Process Assume Mark is currently in Houston. Simulate where Mark will be over the next 16 days. What percentage of time will Mark be in each of the three cities? Use the following random numbers: 93, 63, 26, 16, 21, 26, 70, 55, 72, 89, 49, 64, 91, 02, 52, 69

21 21 Slide Example: Mark Off ’ s Process n Simulation Worksheet Starting in Houston Random Day's Random Day's Random Day's Random Day's Day Number Location Day Number Location Day Number Location Day Number Location 1 93 Houston 9 72 San Ant. 1 93 Houston 9 72 San Ant. 2 63 Houston 10 89 San Ant. 2 63 Houston 10 89 San Ant. 3 26 Houston 11 49 San Ant. 3 26 Houston 11 49 San Ant. 4 16 San Ant. 12 64 San Ant. 4 16 San Ant. 12 64 San Ant. 5 21 San Ant. 13 91 San Ant. 5 21 San Ant. 13 91 San Ant. 6 26 San Ant. 14 02 Austin 6 26 San Ant. 14 02 Austin 7 70 San Ant. 15 52 Austin 7 70 San Ant. 15 52 Austin 8 55 San Ant. 16 69 San Ant. 8 55 San Ant. 16 69 San Ant.

22 22 Slide Example: Mark Off ’ s Process Repeat the simulation with Mark currently in Austin. Use the following random numbers: Repeat the simulation with Mark currently in Austin. Use the following random numbers: 13, 08, 60, 13, 68, 40, 40, 27, 23, 64, 36, 56, 25, 88, 18, 74 Compare the percentages with those found with Mark starting in Houston.

23 23 Slide Example: Mark Off ’ s Process n Simulation Worksheet Starting in Austin Random Day's Random Day's Random Day's Random Day's Day Number Location Day Number Location 1 13 Austin 9 23 San Ant. 1 13 Austin 9 23 San Ant. 2 08 Austin 10 64 San Ant. 2 08 Austin 10 64 San Ant. 3 60 San Ant. 11 36 San Ant. 3 60 San Ant. 11 36 San Ant. 4 13 Austin 12 56 San Ant. 4 13 Austin 12 56 San Ant. 5 68 San Ant. 13 25 San Ant. 5 68 San Ant. 13 25 San Ant. 6 40 San Ant. 14 88 San Ant. 6 40 San Ant. 14 88 San Ant. 7 40 San Ant. 15 18 Austin 7 40 San Ant. 15 18 Austin 8 27 San Ant. 16 74 San Ant. 8 27 San Ant. 16 74 San Ant.

24 24 Slide Example: Mark Off ’ s Process n Simulation Summary Starting in Houston Austin = 2/16 = 12.50% Austin = 2/16 = 12.50% San Antonio = 11/16 = 68.75% San Antonio = 11/16 = 68.75% Houston = 3/16 = 18.75% Houston = 3/16 = 18.75% Starting in Austin Austin = 4/16 = 25% Austin = 4/16 = 25% San Antonio = 12/16 = 75% San Antonio = 12/16 = 75% Houston = 0/16 = 0% Houston = 0/16 = 0%

25 25 Slide Example: Wayne International Airport Wayne International Airport primarily serves domestic air traffic. Occasionally, however, a chartered plane from abroad will arrive with passengers bound for Wayne's two great amusement parks. Whenever an international plane arrives at the airport the two customs inspectors on duty set up operations to process the passengers. Incoming passengers must first have their passports and visas checked. This is handled by one inspector. The time required to check a passenger's passports and visas can be described by the probability distribution on the next slide.

26 26 Slide Example: Wayne International Airport Time Required to Check a Passenger's Check a Passenger's Passport and Visa Probability Passport and Visa Probability 20 seconds.20 20 seconds.20 40 seconds.40 40 seconds.40 60 seconds.30 60 seconds.30 80 seconds.10 80 seconds.10

27 27 Slide Example: Wayne International Airport After having their passports and visas checked, the passengers next proceed to the second customs official who does baggage inspections. Passengers form a single waiting line with the official inspecting baggage on a first come, first served basis. The time required for baggage inspection has the following probability distribution: Time Required For Time Required For Baggage Inspection Probability Baggage Inspection Probability No Time.25 No Time.25 1 minute.60 1 minute.60 2 minutes.10 2 minutes.10 3 minutes.05 3 minutes.05

28 28 Slide Example: Wayne International Airport n Random Number Mapping Time Required to Time Required to Check a Passenger's Random Check a Passenger's Random Passport and Visa Probability Numbers Passport and Visa Probability Numbers 20 seconds.20 00 - 19 20 seconds.20 00 - 19 40 seconds.40 20 - 59 40 seconds.40 20 - 59 60 seconds.30 60 - 89 60 seconds.30 60 - 89 80 seconds.10 90 - 99 80 seconds.10 90 - 99

29 29 Slide Example: Wayne International Airport n Random Number Mapping Time Required For Random Time Required For Random Baggage Inspection Probability Numbers Baggage Inspection Probability Numbers No Time.25 00 - 24 No Time.25 00 - 24 1 minute.60 25 - 84 1 minute.60 25 - 84 2 minutes.10 85 - 94 2 minutes.10 85 - 94 3 minutes.05 95 - 99 3 minutes.05 95 - 99

30 30 Slide Example: Wayne International Airport n Next-Event Simulation Records For each passenger the following information must be recorded: When his service begins at the passport control inspectionWhen his service begins at the passport control inspection The length of time for this serviceThe length of time for this service When his service begins at the baggage inspectionWhen his service begins at the baggage inspection The length of time for this serviceThe length of time for this service

31 31 Slide Example: Wayne International Airport n Time Relationships Time a customer completes service at the baggage inspector at the baggage inspector = (Time customer begins service with baggage inspector) + (Time required for baggage inspection) = (Time customer begins service with baggage inspector) + (Time required for baggage inspection)

32 32 Slide Example: Wayne International Airport n Time Relationships Time a passenger begins service by the passport inspector = (Time the previous passenger started passport service) = (Time the previous passenger started passport service) + (Time of previous passenger's passport service) + (Time of previous passenger's passport service)

33 33 Slide Example: Wayne International Airport n Time Relationships Time a passenger begins service by the baggage inspector by the baggage inspector ( If passenger does not wait in line for baggage inspection) = (Time passenger completes service = (Time passenger completes service with the passport control inspector) with the passport control inspector) (If the passenger does wait in line for baggage inspection) (If the passenger does wait in line for baggage inspection) = (Time previous passenger completes = (Time previous passenger completes service with the baggage inspector) service with the baggage inspector)

34 34 Slide Example: Wayne International Airport A chartered plane from abroad lands at Wayne Airport with 80 passengers. Simulate the processing of the first 10 passengers through customs. Use the following random numbers: For passport control: For passport control: 93, 63, 26, 16, 21, 26, 70, 55, 72, 89 For baggage inspection: 13, 08, 60, 13, 68, 40, 40, 27, 23, 64

35 35 Slide Example: Wayne International Airport n Simulation Worksheet (partial) Passport Control Baggage Inspections Passport Control Baggage Inspections Pass. Time Rand. Service Time Time Rand. Service Time Num. Begin Num. Time End Begin Num. Time End 1 0:00 93 1:20 1:20 1:20 13 0:00 1:20 1 0:00 93 1:20 1:20 1:20 13 0:00 1:20 2 1:20 63 1:00 2:20 2:20 08 0:00 2:20 2 1:20 63 1:00 2:20 2:20 08 0:00 2:20 3 2:20 26 :40 3:00 3:00 60 1:00 4:00 3 2:20 26 :40 3:00 3:00 60 1:00 4:00 4 3:00 16 :20 3:20 4:00 13 0:00 4:00 4 3:00 16 :20 3:20 4:00 13 0:00 4:00 5 3:20 21 :40 4:00 4:00 68 1:00 5:00 5 3:20 21 :40 4:00 4:00 68 1:00 5:00

36 36 Slide Example: Wayne International Airport n Simulation Worksheet (continued) Passport Control Baggage Inspections Passport Control Baggage Inspections Pass. Time Rand. Service Time Time Rand. Service Time Num. Begin Num. Time End Begin Num. Time End 6 4:00 26 :40 4:40 5:00 40 1:00 6:00 6 4:00 26 :40 4:40 5:00 40 1:00 6:00 7 4:40 70 1:00 5:40 6:00 40 1:00 7:00 7 4:40 70 1:00 5:40 6:00 40 1:00 7:00 8 5:40 55 :40 6:20 7:00 27 1:00 8:00 8 5:40 55 :40 6:20 7:00 27 1:00 8:00 9 6:20 72 1:00 7:20 8:00 23 0:00 8:00 9 6:20 72 1:00 7:20 8:00 23 0:00 8:00 10 7:20 89 1:00 8:20 8:20 64 1:00 9:20 10 7:20 89 1:00 8:20 8:20 64 1:00 9:20

37 37 Slide Example: Wayne International Airport n Explanation For example, passenger 1 begins being served by the passport inspector immediately. His service time is 1:20 (80 seconds) at which time he goes immediately to the baggage inspector who waves him through without inspection. Passenger 2 begins service with passport inspector 1:20 minutes (80 seconds) after arriving there (as this is when passenger 1 is finished) and requires 1:00 minute (60 seconds) for passport inspection. He is waved through baggage inspection as well. This process continues in this manner.

38 38 Slide Example: Wayne International Airport n Question How long will it take for the first 10 passengers to clear customs? n Answer Passenger 10 clears customs after 9 minutes and 20 seconds.

39 39 Slide Example: Wayne International Airport n Question What is the average length of time a customer waits before having his bags inspected after he clears passport control? How is this estimate biased? n Answer For each passenger calculate his waiting time: (Baggage Inspection Begins) - (Passport Control Ends) (Baggage Inspection Begins) - (Passport Control Ends) Total length of time =0+0+0+40+0+20+20+40+40+0 = 120 seconds. Total length of time =0+0+0+40+0+20+20+40+40+0 = 120 seconds. 120/10 = 12 seconds per passenger. 120/10 = 12 seconds per passenger. This is a biased estimate because we assume that the simulation began with the system empty. Thus, the results tend to underestimate the average waiting time.

40 40 Slide Time Increments n In a fixed time simulation model, time periods are incremented by a fixed amount. For each time period a different set of data from the input sequence is used to calculate the effects on the model. n In a next event simulation model, time periods are not fixed but are determined by the data values from the input sequence.

41 41 Slide Experimental Design n Experimental design is an important consideration in the simulation process. n Issues such as the length of time of the simulation and the treatment of initial data outputs from the model must be addressed prior to collecting and analyzing output data.

42 42 Slide Experimental Design n Normally one is interested in results for the steady state (long run) operation of the system being modeled. n The initial data inputs to the simulation generally represent a start-up period for the process and it may be important that the data outputs for this start-up period be neglected for predicting this long run behavior.

43 43 Slide Experimental Design n For each policy under consideration by the decision maker, the simulation is run by considering a long sequence of input data values (given by a random number generator). n Whenever possible, different policies should be compared by using the same sequence of input data.

44 44 Slide Model Validation n Validation of both the model and the method used by the computer to carry out the calculations is extremely important. n Models which do not accurately reflect real world behavior cannot be expected to generate meaningful results. n Likewise, errors in programming can result in nonsensical results. n Validation is generally done by having an expert review the model and the computer code for errors. n If possible, the simulation should be run using actual past data. n Predictions from the simulation model should be compared with historical results.

45 45 Slide Simulation Programs n The computer program that performs the simulation is called a simulator. n Flowcharts can be useful in writing such a program. n While this program can be written in any general purpose language (e.g. BASIC, FORTRAN, etc.) special languages which reduce the amount of code which must be written to perform the simulation have been developed. n Special simulation languages include SIMAN, GASS, DYNAMO, and SLAM.

46 46 Slide Simulation for Inventory Analysis - the Flowcharts of Basic Model Begin Increase current inv by qty order end inv = begin-demand # of lost sales End inv = 0 Generate Random lead time Place order Compute averages End Enough Days in simulation? Order placed & not arrived? End inv < reorder point? demand > begin inv? Order arrived? random # for todays demand

47 47 Slide High-Lever Simulators n Operate by mouse-driven graphical user interface and menus n Select modeling constructs and connect them n Run the model with a dynamic graphical animation


Download ppt "1 1 Slide Simulation. 2 2 Simulation n Advantages and Disadvantages of Simulation n Simulation Modeling n Random Variables n Simulation Languages n Validation."

Similar presentations


Ads by Google