47
1 Sl Simulation Simulation

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

Embed Size (px)

Citation preview

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

1 1

Slide Slide

SimulationSimulation

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

2 2

Slide Slide

SimulationSimulation

Advantages and Advantages and Disadvantages of SimulationDisadvantages of Simulation

Simulation ModelingSimulation Modeling Random VariablesRandom Variables Simulation LanguagesSimulation Languages Validation and Statistical Validation and Statistical

AnalysisAnalysis

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

3 3

Slide Slide

Computer SimulationComputer Simulation

Computer simulationComputer simulation is one of the is one of the most frequently employed most frequently employed management science techniques. management science techniques.

It is typically used to model It is typically used to model random processesrandom processes that are too that are too complex to be solved by analytical complex to be solved by analytical methods.methods.

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

4 4

Slide Slide

Real World Variables Which Are Real World Variables Which Are Probabilistic in NatureProbabilistic in Nature

Inventory demandInventory demand Lead time for orders to arriveLead time for orders to arrive Time between machine breakdownsTime between machine breakdowns Times between arrivals at a service Times between arrivals at a service

facilityfacility Service timesService times Times to complete project activitiesTimes to complete project activities Number of employees absent from work Number of employees absent from work

each dayeach day

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

5 5

Slide Slide

The idea behind simulation is to:The idea behind simulation is to:

Imitate a real-world situation Imitate a real-world situation mathematicallymathematically

Study its properties and operating Study its properties and operating characteristicscharacteristics

draw conclusions and make action draw conclusions and make action recommendations based on the recommendations based on the results of the simulationresults of the simulation

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

6 6

Slide Slide

Goal of simulation studyGoal of simulation study

Examples:Examples: Total productionTotal production Average waiting time in queue of partAverage waiting time in queue of part

s at the machines at the machine The maximum number of parts waitinThe maximum number of parts waitin

g in the queueg in the queue Average flowtime of partsAverage flowtime of parts Utilization of the machineUtilization of the machine

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

7 7

Slide Slide

Advantages of Computer Advantages of Computer SimulationSimulation

• It is very flexible, relatively straightforwardIt is very flexible, relatively straightforward• can be used to analyze large and complex real-can be used to analyze large and complex real-

world problems for which closed-form analytical world problems for which closed-form analytical solutions are not possiblesolutions are not possible

• allows for the inclusion of real-world allows for the inclusion of real-world complications which most other techniques do complications which most other techniques do not permitnot permit

• makes possible “time compression”makes possible “time compression”• allows one to ask “what if” type questionsallows one to ask “what if” type questions• does not interfere with the real-world systemdoes not interfere with the real-world system• allows us to study the interactive effect of allows us to study the interactive effect of

individual components or variablesindividual components or variables

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

8 8

Slide Slide

Disadvantages of Computer Disadvantages of Computer SimulationSimulation

Can be expensive and time consumingCan be expensive and time consuming Does not yield optimal solutionDoes not yield optimal solution Requires good managerial inputRequires good managerial input Is not generalizable to other situationsIs not generalizable to other situations

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

9 9

Slide Slide

The Process of SimulationThe 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

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

10 10

Slide Slide

Simulation ModelingSimulation Modeling

One begins a simulation modeling by One begins a simulation modeling by developing a mathematical statement developing a mathematical statement of the problem. of the problem.

The model should be realistic yet The model should be realistic yet solvable within the speed and storage solvable within the speed and storage constraints of the computer system constraints of the computer system being used. being used.

Input values for the model as well as Input values for the model as well as probability estimates for the random probability estimates for the random variables must then be determined.variables must then be determined.

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

11 11

Slide Slide

The Monte CarloThe Monte Carlo Simulation Technique Simulation Technique

• Setup probability distribution for important Setup probability distribution for important variablesvariables

• Build cumulative distribution for each variablBuild cumulative distribution for each variablee• Establish interval of random numbers for each Establish interval of random numbers for each

variablevariable• Generate random numbersGenerate random numbers• Simulate a series of trialsSimulate a series of trials

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

12 12

Slide Slide

Example: Probablistics, Inc.Example: Probablistics, Inc.

The price change of shares of Probablistics, Inc. The price change of shares of Probablistics, Inc. has been observed over the past 50 trades. The frequehas been observed over the past 50 trades. The frequency distribution is as follows:ncy distribution is as follows:

Price ChangePrice Change Number of TradesNumber of Trades -3/8 -3/8 4 4 -1/4 -1/4 2 2 -1/8 -1/8 8 8 0 200 20 +1/8 +1/8 10 10 +1/4 +1/4 3 3 +3/8 +3/8 2 2 +1/2 +1/2 1 1

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

13 13

Slide Slide

Example: Probablistics, Inc.Example: Probablistics, Inc. Relative Frequency Distribution andRelative Frequency Distribution and

Random Number MappingRandom Number Mapping

Price ChangePrice Change Relative FrequencyRelative Frequency Random NumbersRandom Numbers

-3/8 -3/8 .08 .08 00 - 07 00 - 07

-1/4 -1/4 .04 .04 08 - 08 - 11 11

-1/8 -1/8 .16 .16 12 - 27 12 - 27

0 0 .40 .40 28 - 67 28 - 67

+1/8 +1/8 .20 .20 68 - 87 68 - 87

+1/4 +1/4 .06 .06 88 - 93 88 - 93

+3/8 +3/8 .04 .04 94 - 97 94 - 97

+1/2 +1/2 .02 .02 98 - 99 98 - 99

TOTAL 1.00TOTAL 1.00

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

14 14

Slide Slide

Example: Probablistics, Inc.Example: Probablistics, Inc.

If the current price per share of Probablistics If the current price per share of Probablistics is 23, use random numbers to simulate the price pis 23, use random numbers to simulate the price per share over the next 10 trades. er share over the next 10 trades.

For random numbers, use the following:For random numbers, use the following: 21, 84, 07, 30, 94, 57, 57, 19, 84, 8421, 84, 07, 30, 94, 57, 57, 19, 84, 84

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

15 15

Slide Slide

Example: Probablistics, Inc.Example: Probablistics, Inc.

Simulation WorksheetSimulation Worksheet Trade Random Price StockTrade Random Price Stock NumberNumber NumberNumber ChangeChange PricePrice

1 21 -1/8 22 1 21 -1/8 22 7/87/8 2 84 +1/8 232 84 +1/8 23 3 07 -3/8 22 3 07 -3/8 22 5/85/8 4 30 0 22 4 30 0 22 5/85/8 5 94 +3/8 235 94 +3/8 23 6 57 0 236 57 0 23 7 57 0 237 57 0 23 8 19 -1/8 22 8 19 -1/8 22 7/87/8 9 84 +1/8 239 84 +1/8 23 10 84 +1/8 23 10 84 +1/8 23 1/81/8

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

16 16

Slide Slide

Example: Probablistics, Inc.Example: Probablistics, Inc. Theoretical Results and Observed ResultsTheoretical Results and Observed Results

Based on the probability distribution, the Based on the probability distribution, the expected price change per trade can be calculated expected price change per trade can be calculated by: 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) = + (.20)(1/8) + (.06)(1/4) + (.04)(3/8) + (.02)(1/2) =

+.005+.005

The expected price change for 10 trades is (10)(.005) The expected price change for 10 trades is (10)(.005)

= .05. = .05.

Hence, the expected stock price after 10 trades is 23 Hence, the expected stock price after 10 trades is 23

+ .05 = 23.05. This is lower than the simulated price + .05 = 23.05. This is lower than the simulated price

of 23.125.of 23.125.

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

17 17

Slide Slide

Random VariablesRandom Variables Random variable values are utilized in the model Random variable values are utilized in the model

through a technique known as through a technique known as Monte Carlo Monte Carlo simulationsimulation. .

Each random variable is mapped to a set of Each random variable is mapped to a set of numbers so that each time one number in that numbers so that each time one number in that set is generated, the corresponding value of the set is generated, the corresponding value of the random variable is given as an input to the random variable is given as an input to the model. model.

The mapping is done in such a way that the The mapping is done in such a way that the likelihood that a particular number is chosen is likelihood that a particular number is chosen is the same as the probability that the the same as the probability that the corresponding value of the random variable corresponding value of the random variable occurs.occurs.

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

18 18

Slide Slide

Example: Mark Off’s ProcessExample: Mark Off’s Process

Mark Off is a specialist at repairing large metal-cMark Off is a specialist at repairing large metal-cutting machines that use laser technology. His repair tutting machines that use laser technology. His repair territory consists of the cities of Austin, San Antonio, anerritory consists of the cities of Austin, San Antonio, and Houston. His day-to-day repair assignment locationd Houston. His day-to-day repair assignment locations can be modeled as a Markov process. The transition s can be modeled as a Markov process. The transition matrix is: matrix is:

Austin San Antonio Houston Austin San Antonio Houston Austin .60 .15 .25Austin .60 .15 .25 This This Day's San Antonio .20 .75 .05Day's San Antonio .20 .75 .05 LocationLocation Houston .15 .05 .80Houston .15 .05 .80

Next Day's LocationNext Day's Location

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

19 19

Slide Slide

Example: Mark Off’s ProcessExample: Mark Off’s Process

Random Number MappingsRandom Number Mappings

Currently in Currently in Currently inCurrently in Currently in Currently in

AustinAustin San AntonioSan Antonio HoustonHouston

Next-Day Random Next-Day Random Next-Day RandomNext-Day Random Next-Day Random Next-Day Random

LocationLocation NumbersNumbers LocationLocation NumbersNumbers LocationLocation NumbersNumbers

Austin 00 - 59 Austin 00 - 19 Austin 00 - Austin 00 - 59 Austin 00 - 19 Austin 00 - 1414

San Ant. 60 - 74 San Ant. 20 - 94 San Ant. 15 - San Ant. 60 - 74 San Ant. 20 - 94 San Ant. 15 - 1919

Houston 75 - 99 Houston 95 - 99 Houston 20 - Houston 75 - 99 Houston 95 - 99 Houston 20 - 9999

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

20 20

Slide Slide

Example: Mark Off’s ProcessExample: Mark Off’s Process

Assume Mark is currently in Houston. SimulatAssume Mark is currently in Houston. Simulate where Mark will be over the next 16 days. What pere where Mark will be over the next 16 days. What percentage of time will Mark be in each of the three citiecentage of time will Mark be in each of the three cities? s?

Use the following random numbers:Use the following random numbers:93, 63, 26, 16, 21, 26, 70, 55, 72, 89, 49, 64, 91, 02, 52, 693, 63, 26, 16, 21, 26, 70, 55, 72, 89, 49, 64, 91, 02, 52, 699

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

21 21

Slide Slide

Example: Mark Off’s ProcessExample: Mark Off’s Process

Simulation WorksheetSimulation Worksheet

Starting in HoustonStarting in Houston

Random Day'sRandom Day's Random Day's Random Day's

DayDay NumberNumber LocationLocation DayDay NumberNumber LocationLocation

1 93 Houston1 93 Houston 9 9 72 San Ant. 72 San Ant.

2 63 Houston2 63 Houston 10 10 89 89 San Ant. San Ant.

3 26 Houston3 26 Houston 11 11 49 49 San Ant. San Ant.

4 16 San Ant. 12 4 16 San Ant. 12 64 San Ant. 64 San Ant.

5 21 San Ant. 13 5 21 San Ant. 13 91 San Ant. 91 San Ant.

6 26 San Ant. 14 6 26 San Ant. 14 02 Austin 02 Austin

7 70 San Ant. 15 7 70 San Ant. 15 52 Austin 52 Austin

8 55 San Ant. 16 8 55 San Ant. 16 69 San Ant.69 San Ant.

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

22 22

Slide Slide

Example: Mark Off’s ProcessExample: Mark Off’s Process

Repeat the simulation with Mark currently in ARepeat the simulation with Mark currently in Austin. Use the following random numbers:ustin. Use the following random numbers:

13, 08, 60, 13, 68, 40, 40, 27, 23, 64, 36, 56, 25, 88, 18, 713, 08, 60, 13, 68, 40, 40, 27, 23, 64, 36, 56, 25, 88, 18, 744

Compare the percentages with those found witCompare the percentages with those found with Mark starting in Houston.h Mark starting in Houston.

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

23 23

Slide Slide

Example: Mark Off’s ProcessExample: Mark Off’s Process

Simulation WorksheetSimulation Worksheet

Starting in AustinStarting in Austin

Random Day's Random Day's Random Day's Random Day's

DayDay NumberNumber LocationLocation Day Day NumberNumber LocationLocation

1 13 Austin 1 13 Austin 9 23 San Ant. 9 23 San Ant.

2 2 08 08 Austin Austin 10 10 64 64 San Ant.San Ant.

3 60 San Ant.3 60 San Ant. 11 36 San Ant. 11 36 San Ant.

4 4 13 Austin 13 Austin 12 56 San Ant. 12 56 San Ant.

5 5 68 San Ant. 68 San Ant. 13 25 San Ant. 13 25 San Ant.

6 6 40 San Ant. 40 San Ant. 14 88 San Ant. 14 88 San Ant.

7 7 40 San Ant. 40 San Ant. 15 15 18 Austin 18 Austin

8 8 27 San Ant. 27 San Ant. 16 74 San Ant. 16 74 San Ant.

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

24 24

Slide Slide

Example: Mark Off’s ProcessExample: Mark Off’s Process

Simulation SummarySimulation Summary

Starting in HoustonStarting 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 AustinStarting 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%

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

25 25

Slide Slide

Example: Wayne International AirportExample: Wayne International Airport

Wayne International Airport primarily serves dWayne International Airport primarily serves domestic air traffic. Occasionally, however, a chartereomestic air traffic. Occasionally, however, a chartered plane from abroad will arrive with passengers bound plane from abroad will arrive with passengers bound for Wayne's two great amusement parks.d for Wayne's two great amusement parks.

Whenever an international plane arrives at the Whenever an international plane arrives at the airport the two customs inspectors on duty set up opairport the two customs inspectors on duty set up operations to process the passengers.erations to process the passengers.

Incoming passengers must first have their passIncoming passengers must first have their passports and visas checked. This is handled by one inspports and visas checked. This is handled by one inspector. The time required to check a passenger's passector. The time required to check a passenger's passports and visas can be described by the probability diports and visas can be described by the probability distribution on the next slide.stribution on the next slide.

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

26 26

Slide Slide

Example: Wayne International AirportExample: Wayne International Airport

Time Required toTime Required to Check a Passenger'sCheck a Passenger's Passport and VisaPassport and Visa ProbabilityProbability 20 seconds 20 seconds .20.20 40 seconds 40 seconds .40.40 60 seconds 60 seconds .30.30 80 seconds 80 seconds .10.10

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

27 27

Slide Slide

Example: Wayne International AirportExample: Wayne International Airport

After having their passports and visas checked, tAfter having their passports and visas checked, the passengers next proceed to the second customs offihe passengers next proceed to the second customs official who does baggage inspections. Passengers form a cial who does baggage inspections. Passengers form a single waiting line with the official inspecting baggage single waiting line with the official inspecting baggage on a first come, first served basis.on a first come, first served basis.

The time required for baggage inspection has thThe time required for baggage inspection has the following probability distribution:e following probability distribution:

Time Required ForTime Required For Baggage InspectionBaggage Inspection ProbabilityProbability

No Time No Time .25 .25 1 minute 1 minute .60 .60 2 minutes 2 minutes .10 .10 3 minutes 3 minutes .05 .05

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

28 28

Slide Slide

Example: Wayne International AirportExample: Wayne International Airport

Random Number MappingRandom Number Mapping

Time Required toTime Required to

Check a Passenger's RandomCheck a Passenger's Random

Passport and VisaPassport and Visa ProbabilityProbability NumbersNumbers

20 seconds .20 00 - 20 seconds .20 00 - 1919

40 seconds .40 40 seconds .40 20 - 5920 - 59

60 seconds .30 60 seconds .30 60 - 8960 - 89

80 seconds .10 80 seconds .10 90 - 9990 - 99

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

29 29

Slide Slide

Example: Wayne International AirportExample: Wayne International Airport

Random Number MappingRandom Number Mapping

Time Required For Time Required For Random Random

Baggage InspectionBaggage Inspection ProbabilityProbability NumbersNumbers

No Time .25 00 - 24No Time .25 00 - 24

1 minute .60 25 - 841 minute .60 25 - 84

2 minutes .10 85 - 942 minutes .10 85 - 94

3 minutes .05 95 - 993 minutes .05 95 - 99

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

30 30

Slide Slide

Example: Wayne International AirportExample: Wayne International Airport

Next-Event Simulation RecordsNext-Event Simulation Records

For each passenger the following For each passenger the following information must be recorded:information must be recorded:• When his service begins at the passport When his service begins at the passport

control inspectioncontrol inspection• The length of time for this serviceThe length of time for this service• When his service begins at the baggage When his service begins at the baggage

inspectioninspection• The length of time for this serviceThe length of time for this service

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

31 31

Slide Slide

Example: Wayne International AirportExample: Wayne International Airport

Time RelationshipsTime Relationships

Time a customer completes serviceTime a customer completes service

at the baggage inspectorat the baggage inspector

= (Time customer begins service with baggage = (Time customer begins service with baggage inspector) inspector) + (Time required for baggage + (Time required for baggage inspection)inspection)

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

32 32

Slide Slide

Example: Wayne International AirportExample: Wayne International Airport

Time RelationshipsTime Relationships

Time a passenger begins serviceTime a passenger begins service

by the passport inspector by the passport inspector

= (Time the previous passenger started passport = (Time the previous passenger started passport service) service)

+ (Time of previous passenger's passport + (Time of previous passenger's passport service)service)

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

33 33

Slide Slide

Example: Wayne International AirportExample: Wayne International Airport

Time RelationshipsTime Relationships

Time a passenger begins serviceTime a passenger begins service

by the baggage inspector by the baggage inspector

( If passenger does not wait in line for baggage ( If passenger does not wait in line for baggage inspection)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 (If the passenger does wait in line for baggage inspection)inspection)

= (Time previous passenger completes= (Time previous passenger completes

service with the baggage inspector)service with the baggage inspector)

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

34 34

Slide Slide

Example: Wayne International AirportExample: Wayne International Airport

A chartered plane from abroad lands at Wayne A chartered plane from abroad lands at Wayne Airport with 80 passengers. Simulate the processing Airport with 80 passengers. Simulate the processing of the first 10 passengers through customs.of the first 10 passengers through customs.

Use the following random numbers:Use the following random numbers:

For passport control:For passport control:93, 63, 26, 16, 21, 26, 70, 55, 72, 8993, 63, 26, 16, 21, 26, 70, 55, 72, 89

For baggage inspection:For baggage inspection:13, 08, 60, 13, 68, 40, 40, 27, 23, 6413, 08, 60, 13, 68, 40, 40, 27, 23, 64

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

35 35

Slide Slide

Example: Wayne International AirportExample: Wayne International Airport

Simulation Worksheet (partial)Simulation Worksheet (partial)

Passport ControlPassport Control Baggage InspectionsBaggage InspectionsPass. Time Rand. Service Time Time Rand. Service TimPass. Time Rand. Service Time Time Rand. Service Tim

eeNum . Begin Num. Time End Begin Num. Time EndNum . Begin Num. Time End Begin Num. Time End

1 0:00 93 1:20 1:20 1:20 13 0:00 1:201 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:202 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:003 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:004 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:005 3:20 21 :40 4:00 4:00 68 1:00 5:00

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

36 36

Slide Slide

Example: Wayne International AirportExample: Wayne International Airport

Simulation Worksheet (continued)Simulation Worksheet (continued) Passport ControlPassport Control Baggage InspectionsBaggage InspectionsPass. Time Rand. Service Time Time Rand. Service TimPass. Time Rand. Service Time Time Rand. Service Tim

eeNum . Begin Num. Time End Begin Num. Time EndNum . Begin Num. Time End Begin Num. Time End

6 4:00 26 :40 4:40 5:00 40 1:00 6:006 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:007 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:008 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:009 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:2010 7:20 89 1:00 8:20 8:20 64 1:00 9:20

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

37 37

Slide Slide

Example: Wayne International AirportExample: Wayne International Airport

ExplanationExplanation

For example, passenger 1 begins being For example, passenger 1 begins being served by the passport inspector immediately. His served by the passport inspector immediately. His service time is 1:20 (80 seconds) at which time he service time is 1:20 (80 seconds) at which time he goes immediately to the baggage inspector who goes immediately to the baggage inspector who waves him through without inspection. waves him through without inspection.

Passenger 2 begins service with passport Passenger 2 begins service with passport inspector 1:20 minutes (80 seconds) after arriving inspector 1:20 minutes (80 seconds) after arriving there (as this is when passenger 1 is finished) and there (as this is when passenger 1 is finished) and requires 1:00 minute (60 seconds) for passport requires 1:00 minute (60 seconds) for passport inspection. He is waved through baggage inspection. He is waved through baggage inspection as well. inspection as well.

This process continues in this manner.This process continues in this manner.

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

38 38

Slide Slide

Example: Wayne International AirportExample: Wayne International Airport

QuestionQuestion

How long will it take for the first 10 How long will it take for the first 10 passengers to clear customs?passengers to clear customs?

AnswerAnswer

Passenger 10 clears customs after 9 Passenger 10 clears customs after 9 minutes and 20 seconds.minutes and 20 seconds.

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

39 39

Slide Slide

Example: Wayne International AirportExample: Wayne International Airport

QuestionQuestionWhat is the average length of time a customer What is the average length of time a customer

waits before having his bags inspected after he waits before having his bags inspected after he clears passport control? How is this estimate biased?clears passport control? How is this estimate biased?

AnswerAnswerFor each passenger calculate his waiting time:For each passenger calculate his waiting time:

(Baggage Inspection Begins) - (Passport Control (Baggage Inspection Begins) - (Passport Control Ends)Ends)

Total length of time Total length of time =0+0+0+40+0+20+20+40+40+0 = 120 seconds. =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 This is a biased estimate because we assume

that the simulation began with the system empty. that the simulation began with the system empty. Thus, the results tend to underestimate the average Thus, the results tend to underestimate the average waiting time.waiting time.

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

40 40

Slide Slide

Time IncrementsTime Increments

In a In a fixed time simulation modelfixed time simulation model, time , time periods are incremented by a fixed periods are incremented by a fixed amount. For each time period a different amount. For each time period a different set of data from the input sequence is set of data from the input sequence is used to calculate the effects on the model.used to calculate the effects on the model.

In a In a next event simulation modelnext event simulation model, time , time periods are not fixed but are determined periods are not fixed but are determined by the data values from the input by the data values from the input sequence.sequence.

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

41 41

Slide Slide

Experimental DesignExperimental Design

Experimental designExperimental design is an important is an important consideration in the simulation consideration in the simulation process. process.

Issues such as the length of time of Issues such as the length of time of

the simulation and the treatment of the simulation and the treatment of initial data outputs from the model initial data outputs from the model must be addressed prior to must be addressed prior to collecting and analyzing output collecting and analyzing output data.data.

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

42 42

Slide Slide

Experimental DesignExperimental Design

Normally one is interested in results for Normally one is interested in results for the the steady state steady state (long run) operation of (long run) operation of the system being modeled.the system being modeled.

The initial data inputs to the simulation The initial data inputs to the simulation generally represent a generally represent a start-up periodstart-up period for the process and it may be for the process and it may be important that the data outputs for this important that the data outputs for this start-up period be neglected for start-up period be neglected for predicting this long run behavior.predicting this long run behavior.

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

43 43

Slide Slide

Experimental DesignExperimental Design

For each policy under consideration by For each policy under consideration by the decision maker, the simulation is run the decision maker, the simulation is run by considering a long sequence of input by considering a long sequence of input data values (given by a random number data values (given by a random number generator). generator).

Whenever possible, different policies Whenever possible, different policies should be compared by using the same should be compared by using the same sequence of input data.sequence of input data.

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

44 44

Slide Slide

Model ValidationModel Validation Validation of both the model and the method used Validation of both the model and the method used

by the computer to carry out the calculations is by the computer to carry out the calculations is extremely important. extremely important.

Models which do not accurately reflect real world Models which do not accurately reflect real world behavior cannot be expected to generate behavior cannot be expected to generate meaningful results. meaningful results.

Likewise, errors in programming can result in Likewise, errors in programming can result in nonsensical results. nonsensical results.

Validation is generally done by having an expert Validation is generally done by having an expert review the model and the computer code for errors.review the model and the computer code for errors.

If possible, the simulation should be run using If possible, the simulation should be run using actual past data. actual past data.

Predictions from the simulation model should be Predictions from the simulation model should be compared with historical results.compared with historical results.

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

45 45

Slide Slide

Simulation ProgramsSimulation Programs

The computer program that performs the The computer program that performs the simulation is called a simulation is called a simulatorsimulator. .

Flowcharts can be useful in writing such a Flowcharts can be useful in writing such a program. program.

While this program can be written in any While this program can be written in any general purpose language (e.g. BASIC, general purpose language (e.g. BASIC, FORTRAN, etc.) special languages which FORTRAN, etc.) special languages which reduce the amount of code which must be reduce the amount of code which must be written to perform the simulation have been written to perform the simulation have been developed. developed.

Special simulation languages include SIMAN, Special simulation languages include SIMAN, GASS, DYNAMO, and SLAM.GASS, DYNAMO, and SLAM.

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

46 46

Slide Slide

Simulation for Inventory Analysis - the Simulation for Inventory Analysis - the Flowcharts of Basic ModelFlowcharts of Basic Model

Begin

Increasecurrent inv

by qty order

end inv =begin-demand

# of lost sales

End inv = 0

Generate Random lead

time

Placeorder

Compute averages

End

Enough Days in simulation?

Order placed& not arrived?

End inv < reorderpoint?

demand > begin inv?

Orderarrived?

random #for todaysdemand

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

47 47

Slide Slide

High-Lever SimulatorsHigh-Lever Simulators

Operate by mouse-driven Operate by mouse-driven graphical user interface and graphical user interface and menusmenus

Select modeling constructs and Select modeling constructs and connect themconnect them

Run the model with a dynamic Run the model with a dynamic graphical animationgraphical animation