7

Click here to load reader

Introduction to Modeling and Simulation

  • Upload
    escanus

  • View
    17

  • Download
    4

Embed Size (px)

Citation preview

Page 1: Introduction to Modeling and Simulation

g

INTRODUCTION TO MODELING AND SIMULATION

Anu Maria

State University of New York at BinghamtonDepartment of Systems Science and Industrial Engineerin

Binghamton, NY 13902-6000, U.S.A.

n

ioa

ea

tui

d

o

h

yhi

u

d

n

,

fd

s.e,me,

atl

sofn

orns

dn?

ainanl

the

so

ABSTRACT

This introductory tutorial is an overview of simulatiomodeling and analysis. Many critical questions aanswered in the paper. What is modeling? Whatsimulation? What is simulation modeling and analysWhat types of problems are suitable for simulation? Hto select simulation software? What are the benefits pitfalls in modeling and simulation? The intendeaudience is those unfamiliar with the area of discrevent simulation as well as beginners looking for overview of the area. This includes anyone who involved in system design and modification - systeanalysts, management personnel, engineers, miliplanners, economists, banking analysts, and compscientists. Familiarity with probability and statistics assumed.

1 WHAT IS MODELING?

Modeling is the process of producing a model; a mois a representation of the construction and workingsome system of interest. A model is similar to bsimpler than the system it represents. One purpose model is to enable the analyst to predict the effectchanges to the system. On the one hand, a model shbe a close approximation to the real system aincorporate most of its salient features. On the othand, it should not be so complex that it is impossibleunderstand and experiment with it. A good model isjudicious tradeoff between realism and simplicitSimulation practitioners recommend increasing tcomplexity of a model iteratively. An important issue modeling is model validity. Model validation techniqueinclude simulating the model under known inpconditions and comparing model output with systeoutput.

Generally, a model intended for a simulation stuis a mathematical model developed with the help simulation software. Mathematical model classificatioinclude deterministic (input and output variables afixed values) or stochastic (at least one of the input

reis

s?wnddtenismaryter

s

elofutf aofouldnder

to a.e

nstm

yofs

reor

output variables is probabilistic); static (time is not takeninto account) or dynamic (time-varying interactionsamong variables are taken into account). Typicallysimulation models are stochastic and dynamic.

2 WHAT IS SIMULATION?

A simulation of a system is the operation of a model othe system. The model can be reconfigured anexperimented with; usually, this is impossible, tooexpensive or impractical to do in the system it representThe operation of the model can be studied, and hencproperties concerning the behavior of the actual systeor its subsystem can be inferred. In its broadest senssimulation is a tool to evaluate the performance of system, existing or proposed, under differenconfigurations of interest and over long periods of reatime.

Simulation is used before an existing system ialtered or a new system built, to reduce the chances failure to meet specifications, to eliminate unforeseebottlenecks, to prevent under or over-utilization ofresources, and to optimize system performance. Finstance, simulation can be used to answer questiolike: What is the best design for a newtelecommunications network? What are the associateresource requirements? How will a telecommunicationetwork perform when the traffic load increases by 50%How will a new routing algorithm affect itsperformance? Which network protocol optimizesnetwork performance? What will be the impact of a linkfailure?

The subject of this tutorial is discrete eventsimulation in which the central assumption is that thesystem changes instantaneously in response to certdiscrete events. For instance, in an M/M/1 queue - single server queuing process in which time betweearrivals and service time are exponential - an arrivacauses the system to change instantaneously. On other hand, continuous simulators, like flight simulatorsand weather simulators, attempt to quantify the changein a system continuously over time in response t

Page 2: Introduction to Modeling and Simulation

dsd

eee.

andhin

adedio

nd

.

aesn

bleayibe

s:es,n

areutthaitlsentisg

a

bewce

chdsm

e.,.,

larerntbe

a.fors

8 Maria

controls. Discrete event simulation is less detaile(coarser in its smallest time unit) than continuousimulation but it is much simpler to implement, anhence, is used in a wide variety of situations.

Figure 1 is a schematic of a simulation study. Thiterative nature of the process is indicated by the systunder study becoming the altered system which thbecomes the system under study and the cycle repeatsa simulation study, human decision making is requiredall stages, namely, model development, experimedesign, output analysis, conclusion formulation, anmaking decisions to alter the system under study. Tonly stage where human intervention is not required the running of the simulations, which most simulatiosoftware packages perform efficiently. The importanpoint is that powerful simulation software is merely hygiene factor - its absence can hurt a simulation stubut its presence will not ensure success. Experiencproblem formulators and simulation modelers ananalysts are indispensable for a successful simulatstudy.

Figure 1: Simulation Study Schematic

The steps involved in developing a simulatiomodel, designing a simulation experiment, anperforming simulation analysis are:

Step 1. Identify the problem.Step 2. Formulate the problem.Step 3. Collect and process real system data.Step 4. Formulate and develop a model.

AlteredSystem

SystemUnderStudy

SimulationModel

RealWorld

SimulationStudy

SimulationExperiment

SimulationAnalysis

Conclusions

mn Intt

es

t

yd

n

Step 5. Validate the model.Step 6. Document model for future use.Step 7. Select appropriate experimental design.Step 8. Establish experimental conditions for runsStep 9. Perform simulation runs.Step 10. Interpret and present results.Step 11. Recommend further course of action.

Although this is a logical ordering of steps in simulation study, many iterations at various sub-stagmay be required before the objectives of a simulatiostudy are achieved. Not all the steps may be possiand/or required. On the other hand, additional steps mhave to be performed. The next three sections descrthese steps in detail.

3 HOW TO DEVELOP A SIMULATIONMODEL?

Simulation models consist of the following componentsystem entities, input variables, performance measurand functional relationships. For instance in a simulatiomodel of an M/M/1 queue, the server and the queue system entities, arrival rate and service rate are inpvariables, mean wait time and maximum queue lengare performance measures, and 'time in system = wtime + service time' is an example of a functionarelationship. Almost all simulation software packageprovide constructs to model each of the abovcomponents. Modeling is arguably the most importapart of a simulation study. Indeed, a simulation study as good as the simulation model. Simulation modelincomprises the following steps:

Step 1. Identify the problem. Enumerate problemswith an existing system. Produce requirements for proposed system.

Step 2. Formulate the problem. Select the boundsof the system, the problem or a part thereof, to studied. Define overall objective of the study and a fespecific issues to be addressed. Define performanmeasures - quantitative criteria on the basis of whidifferent system configurations will be compared anranked. Identify, briefly at this stage, the configurationof interest and formulate hypotheses about systeperformance. Decide the time frame of the study, i.will the model be used for a one-time decision (e.gcapital expenditure) or over a period of time on a regubasis (e.g., air traffic scheduling). Identify the end usof the simulation model, e.g., corporate managemeversus a production supervisor. Problems must formulated as precisely as possible.

Step 3. Collect and process real system datCollect data on system specifications (e.g., bandwidth a communication network), input variables, as well a

Page 3: Introduction to Modeling and Simulation

ut

veceonnsntny:

ntahea

.hattslseles-e

ne

noterye is-nty

heeents -ustn)em a

ingst

Introduction to Modeling and Simulation 9

performance of the existing system. Identify sources randomness in the system, i.e., the stochastic inpvariables. Select an appropriate input probabilidistribution for each stochastic input variable anestimate corresponding parameter(s).

Software packages for distribution fitting andselection include ExpertFit, BestFit, and add-ons in somstandard statistical packages. These aids combgoodness-of-fit tests, e.g., χ2 test, Kolmogorov-Smirnovtest, and Anderson-Darling test, and parametestimation in a user friendly format.

Standard distributions, e.g., exponential, Poissonormal, hyperexponential, etc., are easy to model asimulate. Although most simulation software packageinclude many distributions as a standard feature, issurelating to random number generators and generatrandom variates from various distributions are pertineand should be looked into. Empirical distributions arused when standard distributions are not appropriatedo not fit the available system data. Triangular, uniforor normal distribution is used as a first guess when data are available. For a detailed treatment of probabildistributions see Maria and Zhang (1997).

Step 4. Formulate and develop a model. Developschematics and network diagrams of the system (How entities flow through the system?). Translate theconceptual models to simulation software acceptabform. Verify that the simulation model executes aintended. Verification techniques include traces, varyininput parameters over their acceptable range achecking the output, substituting constants for randovariables and manually checking results, and animation

Step 5. Validate the model. Compare the model'sperformance under known conditions with thperformance of the real system. Perform statisticinference tests and get the model examined by systexperts. Assess the confidence that the end user plaon the model and address problems if any. For masimulation studies, experienced consultants advocatestructured presentation of the model by the simulatioanalyst(s) before an audience of management and sysexperts. This not only ensures that the modassumptions are correct, complete and consistent, also enhances confidence in the model.

Step 6. Document model for future use. Documentobjectives, assumptions and input variables in detail.

4 HOW TO DESIGN A SIMULATIONEXPERIMENT?

A simulation experiment is a test or a series of tests which meaningful changes are made to the inp

ofut

tyd

eine

er

n,ndses

ingnte ormnoity

doselesgndm.

ealemcesjor an

temelbut

in

variables of a simulation model so that we may obserand identify the reasons for changes in the performanmeasures. The number of experiments in a simulatistudy is greater than or equal to the number of questiobeing asked about the model (e.g., Is there a significadifference between the mean delay in communicationetworks A and B?, Which network has the least delaA, B, or C? How will a new routing algorithm affect theperformance of network B?). Design of a simulatioexperiment involves answering the question: what daneed to be obtained, in what form, and how much? Tfollowing steps illustrate the process of designing simulation experiment.

Step 7. Select appropriate experimental designSelect a performance measure, a few input variables tare likely to influence it, and the levels of each inpuvariable. When the number of possible configuration(product of the number of input variables and the leveof each input variable) is large and the simulation modis complex, common second-order design classincluding central composite, Box-Behnken, and fullfactorial should be considered. Document thexperimental design.

Step 8. Establish experimental conditions for runs.Address the question of obtaining accurate informatioand the most information from each run. Determine if thsystem is stationary (performance measure does change over time) or non-stationary (performancmeasure changes over time). Generally, in stationasystems, steady-state behavior of the response variablof interest. Ascertain whether a terminating or a nonterminating simulation run is appropriate. Select the rulength. Select appropriate starting conditions (e.g., empand idle, five customers in queue at time 0). Select tlength of the warm-up period, if required. Decide thnumber of independent runs - each run uses a differrandom number stream and the same starting conditionby considering output data sample size. Sample size mbe large enough (at least 3-5 runs for each configuratioto provide the required confidence in the performancmeasure estimates. Alternately, use common randonumbers to compare alternative configurations by usingseparate random number stream for each samplprocess in a configuration. Identify output data molikely to be correlated.

Step 9. Perform simulation runs. Perform runsaccording to steps 7-8 above.

5 HOW TO PERFORM SIMULATIONANALYSIS?

Page 4: Introduction to Modeling and Simulation

an onimtenue

omtoits

ata issen

juca, bmees nut

) otioan ca sin

on man

cems.

sioivit

ndtheop.

gdees

beef

ans

g

ee

10 Maria

Most simulation packages provide run statistics (mestandard deviation, minimum value, maximum value)the performance measures, e.g., wait time (non-tpersistent statistic), inventory on hand (time persisstatistic). Let the mean wait time in an M/M/1 queobserved from n runs be n21 W...,,W,W . It is important to

understand that the mean wait time W is a randvariable and the objective of output analysis is estimate the true mean of W and to quantify variability.

Notwithstanding the facts that there are no dcollection errors in simulation, the underlying modelfully known, and replications and configurations are ucontrolled, simulation results are difficult to interpret. Aobservation may be due to system characteristics ora random occurrence. Normally, statistical inference assess the significance of an observed phenomenonmost statistical inference techniques assuindependent, identically distributed (iid) data. Most typof simulation data are autocorrelated, and hence, dosatisfy this assumption. Analysis of simulation outpdata consists of the following steps.

Step 10. Interpret and present results. Computenumerical estimates (e.g., mean, confidence intervalsthe desired performance measure for each configuraof interest. To obtain confidence intervals for the meof autocorrelated data, the technique of batch meansbe used. In batch means, original contiguous datafrom a run is replaced with a smaller data set containthe means of contiguous batches of original observatiThe assumption that batch means are independentnot always be true; increasing total sample size increasing the batch length may help.

Test hypotheses about system performanConstruct graphical displays (e.g., pie charts, histograof the output data. Document results and conclusions

Step 11. Recommend further course of action. Thismay include further experiments to increase the preciand reduce the bias of estimators, to perform sensitanalyses, etc.

d a toarto

1are

,

et

r

stnut

ot

fn

netgs.ayd

.)

ny

6 AN EXAMPLE

A machine shop contains two drills, one straightener, aone finishing operator. Figure 2 shows a schematic of machine shop. Two types of parts enter the machine sh

Type 1 parts require drilling, straightening, and finishinin sequence. Type 2 parts require only drilling anfinishing. The frequency of arrival and the time to brouted to the drilling area are deterministic for both typof parts.

Step 1. Identify the problem. The utilization ofdrills, straightener, and finishing operator needs to assessed. In addition, the following modification to thoriginal system is of interest: the frequency of arrival oboth parts is exponential with the same respective meas in the original system.

Step 2. Formulate the problem. The objective is toobtain the utilization of drills, straightener, and finishinoperator for the original system and the modification. Theassumptions include:♦ The two drills are identical♦ There is no material handling time between the thr

operations.♦ Machine availability implies operator availability.♦ Parts are processed on a FIFO basis.♦ All times are in minutes.

Step 3. Collect and process real system data. Atthe job shop, a Type 1 part arrives every 30 minutes, anType 2 part arrives every 20 minutes. It takes 2 minutesroute a Type 1 part and 10 minutes to route a Type 2 pto the drilling area. Parts wait in a queue till one of the twdrilling machines becomes available. After drilling, Type parts are routed to the straightener and Type 2 parts

Drill #1

Drill #2

Straightener

Legend:Type 1 partsType 2 parts

Figure 2: Schematic of the Machine Shop

FinishingOperator

Page 5: Introduction to Modeling and Simulation

not thegasedal by of

t ofs ofacheing a

ndl ofn

vear'sce

a

berh-g.,ge

te.g.,

ofionficnt,es,),

ral tos,are

he

Introduction to Modeling and Simulation 11

routed to the finishing operator. After straightening, Typ1 parts are routed to the finishing operator.

The operation times for either part were determinedbe as follows. Drilling time is normally distributed withmean 10.0 and standard deviation 1.0. Straightening tiis exponentially distributed with a mean of 15.0. Finishinrequires 5 minutes per part.

Step 4. Formulate and develop a model. A modelof the system and the modification was developed usa simulation package. A trace verified that the paflowed through the job shop as expected.

Step 5. Validate the model. The utilization for asufficiently long run of the original system was judged tbe reasonable by the machine shop operators.

Step 6. Document model for future use. Themodels of the original system and the modification wedocumented as thoroughly as possible.

Step 7. Select appropriate experimental designThe original system and the modification describeabove were studied.

Step 8. Establish experimental conditions for runsEach model was run three times for 4000 minutes astatistical registers were cleared at time 1000, so statistics below were collected on the time interval [1004000]. At the beginning of a simulation run, there were parts in the machine shop.

Step 9. Perform simulation runs. Runs wereperformed as specified in Step 8 above.

Step 10. Interpret and present results. Table 1contains the utilization statistics of the three operations the original system and the modification (in parentheses

Table 1: Utilization StatisticsDrilling Straightening Finishing

Mean Run #1 0.83 (0.78) 0.51 (0.58) 0.42 (0.39)Mean Run #2 0.82 (0.90) 0.52 (0.49) 0.41 (0.45)Mean Run #3 0.84 (0.81) 0.42 (0.56) 0.42 (0.40)Std. Dev. Run #1 0.69 (0.75) 0.50 (0.49) 0.49 (0.49)Std. Dev. Run #2 0.68 (0.78) 0.50 (0.50) 0.49 (0.50)Std. Dev. Run #3 0.69 (0.76) 0.49 (0.50) 0.49 (0.49)

Mean utilization represents the fraction of time a serverbusy, i.e., busy time/total time. Furthermore, the averautilization output for drilling must be divided by thenumber of drills in order to get the utilization per drillEach drill is busy about 40% of the time and straighteniand finishing operations are busy about half the time. Timplies that for the given work load, the system

e

to

meg

ingrts

o

re

.d

.ndthe0,

no

for).

isge

.nghisis

underutilized. Consequently, the average utilization did change substantially between the original system andmodification; the standard deviation of the drillinoperation seems to have increased because of the increrandomness in the modification. The statisticsignificance of these observations can be determinedcomputing confidence intervals on the mean utilizationthe original and modified systems.

Step 11. Recommend further course of action. Otherperformance measures of interest may be: throughpuparts for the system, mean time in system for both typeparts, average and maximum queue lengths for eoperation. Other modifications of interest may be: thflow of parts to the machine shop doubles, the finishoperation will be repeated for 10% of the products onprobabilistic basis.

7 WHAT MAKES A PROBLEM SUITABLE FORSIMULATION MODELING AND ANALYSIS?

In general, whenever there is a need to model aanalyze randomness in a system, simulation is the toochoice. More specifically, situations in which simulatiomodeling and analysis is used include the following:♦ It is impossible or extremely expensive to obser

certain processes in the real world, e.g., next yecancer statistics, performance of the next spashuttle, and the effect of Internet advertising oncompany's sales.

♦ Problems in which mathematical model can formulated but analytic solutions are eitheimpossible (e.g., job shop scheduling problem, higorder difference equations) or too complicated (e.complex systems like the stock market, and larscale queuing models).

♦ It is impossible or extremely expensive to validathe mathematical model describing the system, edue to insufficient data.

Applications of simulation abound in the areas government, defense, computer and communicatsystems, manufacturing, transportation (air trafcontrol), health care, ecology and environmesociological and behavioral studies, biosciencepidemiology, services (bank teller schedulingeconomics and business analysis.

8 HOW TO SELECT SIMULATIONSOFTWARE?

Although a simulation model can be built using genepurpose programming languages which are familiarthe analyst, available over a wide variety of platformand less expensive, most simulation studies today implemented using a simulation package. T

Page 6: Introduction to Modeling and Simulation

a

renefoeedint

o2ed

ttte

dn

io

bo

n

r

sl

he

td

nd

12 Maria

advantages are reduced programming requiremennatural framework for simulation modeling; conceptuguidance; automated gathering of statistics; graphsymbolism for communication; animation; andincreasingly, flexibility to change the model. There ahundreds of simulation products on the market, mawith price tags of $15,000 or more. Naturally, thquestion of how to select the best simulation software an application arises. Metrics for evaluation includmodeling flexibility, ease of use, modeling structur(hierarchical v/s flat; object-oriented v/s nested), coreusability, graphic user interface, animation, dynambusiness graphics, hardware and software requiremestatistical capabilities, output reports and graphical plocustomer support, and documentation.

The two types of simulation packages are simulatilanguages and application-oriented simulators (Table Simulation languages offer more flexibility than thapplication-oriented simulators. On the other hanlanguages require varying amounts of programminexpertise. Application-oriented simulators are easier learn and have modeling constructs closely related to application. Most simulation packages incorporaanimation which is excellent for communication and cabe used to debug the simulation program; a "correlooking" animation, however, is not a guarantee of valid model. More importantly, animation is not asubstitute for output analysis.

Table 2: Simulation PackagesType Of

SimulationPackage

Examples

Simulationlanguages

Arena (previously SIMAN), AweSim! (previouslySLAM II), Extend, GPSS, Micro Saint,SIMSCRIPT, SLX

Object-oriented software: MODSIM III, SIMPLE++Animation software: Proof Animation

Application-OrientedSimulators

Manufacturing: AutoMod, Extend+MFG,FACTOR/AIM, ManSim/X, MP$IM,ProModel, QUEST, Taylor II, WITNESS

Communications/computer: COMNET III,NETWORK II.5, OPNET Modeler, OPNETPlanner, SES/Strategizer, SES/workbench

Business: BP$IM, Extend+BPR, ProcessModel,ServiceModel, SIMPROCESS, Time machine

Health Care: MedModel

9 BENEFITS OF SIMULATION MODELINGAND ANALYSIS

According to practitioners, simulation modeling ananalysis is one of the most frequently used operatioresearch techniques. When used judiciously, simulatmodeling and analysis makes it possible to:♦ Obtain a better understanding of the system

developing a mathematical model of a system

ts;lic

y

r

ects,s,

n).

,gohe

ncta

sn

yf

interest, and observing the system's operation idetail over long periods of time.

♦ Test hypotheses about the system for feasibility.♦ Compress time to observe certain phenomena ove

long periods or expand time to observe a complexphenomenon in detail.

♦ Study the effects of certain informational,organizational, environmental and policy changes onthe operation of a system by altering the system'model; this can be done without disrupting the reasystem and significantly reduces the risk ofexperimenting with the real system.

♦ Experiment with new or unknown situations aboutwhich only weak information is available.

♦ Identify the "driving" variables - ones thatperformance measures are most sensitive to - and tinter-relationships among them.

♦ Identify bottlenecks in the flow of entities (material,people, etc.) or information.

♦ Use multiple performance metrics for analyzingsystem configurations.

♦ Employ a systems approach to problem solving.♦ Develop well designed and robust systems and

reduce system development time.

10 WHAT ARE SOME PITFALLS TO GUARDAGAINST IN SIMULATION?

Simulation can be a time consuming and complexexercise, from modeling through output analysis, thanecessitates the involvement of resident experts andecision makers in the entire process. Following is achecklist of pitfalls to guard against.♦ Unclear objective.♦ Using simulation when an analytic solution is

appropriate.♦ Invalid model.♦ Simulation model too complex or too simple.♦ Erroneous assumptions.♦ Undocumented assumptions. This is extremely

important and it is strongly suggested thatassumptions made at each stage of the simulatiomodeling and analysis exercise be documentethoroughly.

♦ Using the wrong input probability distribution.♦ Replacing a distribution (stochastic) by its mean

(deterministic).♦ Using the wrong performance measure.♦ Bugs in the simulation program.♦ Using standard statistical formulas that assume

independence in simulation output analysis.♦ Initial bias in output data.♦ Making one simulation run for a configuration.

Page 7: Introduction to Modeling and Simulation

.

Introduction to Modeling and Simulation 13

♦ Poor schedule and budget planning.♦ Poor communication among the personnel involved

in the simulation study.

REFERENCES

Banks, J., J. S. Carson, II, and B. L. Nelson. 1996Discrete-Event System Simulation, Second Edition,Prentice Hall.

Bratley, P., B. L. Fox, and L. E. Schrage. 1987. A Guideto Simulation, Second Edition, Springer-Verlag.

Fishwick, P. A. 1995. Simulation Model Design andExecution: Building Digital Worlds, Prentice-Hall.

Freund, J. E. 1992. Mathematical Statistics, Fifth Edition,Prentice-Hall.

Hogg, R. V., and A. T. Craig. 1995. Introduction toMathematical Statistics, Fifth Edition, Prentice-Hall.

Kleijnen, J. P. C. 1987. Statistical Tools for SimulationPractitioners, Marcel Dekker, New York.

Law, A. M., and W. D. Kelton. 1991. SimulationModeling and Analysis, Second Edition,McGraw-Hill.

Law, A. M., and M. G. McComas. 1991. Secrets ofSuccessful Simulation Studies, Proceedings of the1991 Winter Simulation Conference, ed. J. M.Charnes, D. M. Morrice, D. T. Brunner, and J. J.Swain, 21-27. Institute of Electrical and ElectronicsEngineers, Piscataway, New Jersey.

Maria, A., and L. Zhang. 1997. Probability Distributions,Version 1.0, July 1997, Monograph, Department ofSystems Science and Industrial Engineering, SUNYat Binghamton, Binghamton, NY 13902.

Montgomery, D. C. 1997. Design and Analysis ofExperiments, Third Edition, John Wiley.

Naylor, T. H., J. L. Balintfy, D. S. Burdick, and K. Chu.1966. Computer Simulation Techniques, John Wiley.

Nelson, B. L. 1995. Stochastic Modeling: Analysis andSimulation, McGraw-Hill.

AUTHOR BIOGRAPHY

ANU MARIA is an assistant professor in the departmentof Systems Science & Industrial Engineering at the StateUniversity of New York at Binghamton. She receivedher PhD in Industrial Engineering from the University ofOklahoma. Her research interests include optimizing theperformance of materials used in electronic packaging(including solder paste, conductive adhesives, andunderfills), simulation optimization techniques, geneticsbased algorithms for optimization of problems with alarge number of continuous variables, multi criteriaoptimization, simulation, and interior-point methods.