Cism02 Unit 10

download Cism02 Unit 10

of 30

Transcript of Cism02 Unit 10

  • 7/25/2019 Cism02 Unit 10

    1/30

    Dr Valentina Plekhanova

    CISM02: Decision Support for Management

    Unit 10

    Decision Support for Management:Simulation

    Unit 10: Learning Outcomes

    2CISM02 Decision Support for Management Unit 10

    1. To understand the principles of simulation2. To describe the features of a simulation approach3. To understand the different simulation models4. To understand the different simulation methodologies that are applied

    in practice5. To be able to explain the limitations of simulation

    6. To be able to explain the key stages of the simulation process7. To understand the principles of generation of random numbers8. To complete a manual simulation9. To interpret information generated from a simulation10.To understand the Monte Carlo simulation11.To describe the key characteristics of the Monte Carlo simulation12.To be able to apply simulation techniques to the practical problems

  • 7/25/2019 Cism02 Unit 10

    2/30

    Mathematical Models

    3

    From F. Neelamkavil, Computer Simulation and Modelling, 1987

    MathematicalModels

    Dynamic ModelsStatic Models

    Analytical Models Numeric Models Numeric Models Analytical Models

    Simulation Models

    Reminder

    CISM02 Decision Support for Management Unit 10

    Variables of the Real System

    4

    Real-

    world

    System

    X X . X

    Non-observable Variables

    Input Variables

    (Observable)

    Output Variables

    (Observable)

    Barrier to observation

    Reminder

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    3/30

    Modelling and Simulation:Elements and Relations

    5

    Real World System

    ComputerModel

    Modelling

    Simulation

    Simulation is emulation of reality using mathematical model.

    Reminder

    CISM02 Decision Support for Management Unit 10

    Modelling and Simulation:Elements and Relations

    6

    Models representreality, simulationimitatesit.

    Simulation always involves the manipulation of a model; it is, ineffect, a way of manipulating a model so that it yields a motion pictureof reality.

    Simulation: experimentation on the model

    Reminder

    Simulation modelling is an experimental and applied methodology with seeks to:

    Describe the behaviour of systems

    Conduct theories or hypotheses that account for the observed behaviour

    Use these theories to predict future behaviour, that is, the effects that will beproduced by changes in the system or in its method of operation.

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    4/30

    What is Simulation?

    7

    Simulation is emulation of reality using mathematical model.

    The Oxford English Dictionary describes simulation as:

    "The technique of imitating the behaviour of some situation or system

    (economic, mechanical, etc.) by means of an analogous model,

    situation, or apparatus, either to gain information more conveniently

    or to train personnel."

    CISM02 Decision Support for Management Unit 10

    Simulation: Definition

    8

    All simulation models are so-called input-output models.

    That is, they yield the output of the system given the input to itsinteracting subsystems.

    Simulation models are runrather that solvedin order to obtain thedesired information or results.

    They are incapable of generating a solution on their own in the sense ofanalytical models; they can only serve as a tool for the analysis of thebehaviour of a system under conditions specified by the experimenter.

    Thus, simulation is not a theory but a methodology of problem solving.

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    5/30

    Simulation & Cognition

    9

    At the most general level Simulation should be considered as a form ofCognition.

    Cognition = action or process of acquiring knowledge.

    There are three basic methods how to get an information (knowledge)of objective reality:Experiment,Analysis, Simulation.

    Let's take one practical example to demonstrate the nature of thesethree methods.

    The system being investigated is a gas station with one attendant. Thequestion is "what is the average time spent by a car in the gas station".To get the answer we have three possibilities:

    CISM02 Decision Support for Management Unit 10

    Experiment & Analysis

    10

    Experiment: take stop watches and measure the time every car spendsin the station. Count the cars, at the end sum all times and divide themby the number of cars.

    Analysis: use a formula of the Queuing Theory to compute the averagetime spent in the system directly. To use a formula you will have toassume certain queuing model which means a considerable

    simplification of the real system and you will need some quantitativeparameters (here arrival intensity - number of cars arriving per time unitand service intensity - number of cars served per time unit).

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    6/30

    Simulation

    11

    Simulation: write a simulation model that generates randomly arrivals ofcars and duration of services. It must also sequence properly allactivities to have a one-to-one correspondence with the real system.

    Also observation, collection of statistical data, and evaluation must beprogrammed (for each car compute the time spent, accumulate thesetimes, count number of cars, at the end compute and display theaverage).

    CISM02 Decision Support for Management Unit 10

    Experiment:Advantages &Disadvantages

    12

    These three methods can not be ranked because all of them haveadvantages and disadvantages. They can be compared only in thecontext of certain particular case taking into account various criteria.Nevertheless some basic facts are obvious:

    Experimentis always the most accurate method, that should be usedwhenever it is feasible. Unfortunately very often the experiment is:

    Too dangerous(behaviour of a nuclear reactor in critical situations,landing with a plane with one jet off, etc.)

    Too expensive(all cases that cause a damage, long experimentsstudying throughput of a data network using leased phone lines, etc.)

    Not possibleat all if the system being investigated is not available(evaluation of more possible alternatives in the design stage.)

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    7/30

    Analysis:Advantages &Disadvantages

    13

    Analysis (mostly mathematical) is typically based on strongassumptions that are rarely true in practical life. Another possibledrawback of analytical methods is too complicated apparatus usedand/or too time consuming computation. An example of this is analysisof Queuing Networks.

    On the other hand using formulae gives mostly fast results and it ispossible to check a large number of alternatives by simply insertingdifferent values of parameters to the formula(e). Experimental methodsare mostly much more time consuming.

    Another problem of analysis is availability of necessary parameters.

    Their exact measuring is also not necessarily feasible or it isimpossible in the design stage. Using estimated data or data takenfrom other similar systems decreases credibility of results.

    CISM02 Decision Support for Management Unit 10

    Simulation:Advantages &Disadvantages (1)

    14

    Simulationis also an experimental method. Instead of experimentingwith the real system the experiments are performed with the simulationmodel (whose design is thus the key point of simulation studies). Alsosimulation has many drawbacks. Here are the most important ones:

    Too demanding creation of simulation models. Programmingsimulation models in general languages is too difficult. There areefficient simulation languages but their mastering represents a biginitial investment not always justified. There are simulation tools basedtypically on some graphical technique that simplify or even automatecreation of simulation models of certain class of systems.

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    8/30

    Simulation:Advantages &Disadvantages (2)

    15

    Limited knowledge of the system being simulated. First of all somequantitative parametersmust be known. In the above example it isnecessary to generate random intervals between arrivals and randomservice times. Here simulation is much more flexible than analysis -simulation languages support generation of random numbers withpractically any distribution. In the above example both random figurescan be based on any (e.g. experimentally obtained) distributions.

    Nevertheless any distribution needs either several parameters(if it isa theoretical one) or directly the Distribution Function(if the

    distribution is obtained by measuring). There can be also things in thesystem (typically in the design stage) that can not be quantifiedandoften it is necessary to accept the fact that there might be aspects weare not aware of at all.

    CISM02 Decision Support for Management Unit 10

    Simulation:Advantages &Disadvantages (3)

    16

    Too time consuming computation. An example is analysis of largescale systems with many components working in parallel. Becauseapplication of real parallelism is still not common, such systems aresimulated by a program performed by a single processor.

    Parallel activities are then performed one at a time(even if the user

    has an impression of parallelism and during the design of thesimulation model "thinks in parallel"). The result of this is the fact thatsimulation could be much slower than the real time(1 second of themodel time takes 10 minutes of the CPU time). This of coursedisables application of simulation in real time control.

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    9/30

    Simulation: Rule of Thumb

    17

    A general rule of thumbcould be like that:

    "If the experiment is feasible, use it. It is always the best methodbecause all aspects could be taken into account. Even if other methodswere used during the design stage, experiment can serve as a finalevaluation of the system. If the experiment is not feasible try to find anappropriate analytical method. If it is not available, use simulation."

    Simulation is not only the last resort as it looks like in the above rule.Simulation can contribute very much to understanding of the systembeing analysed not only by supplying answers to the questions thatwere originally given. Very often creation of the simulation model is thefirst occasion where certain things are taken into account. Specificationof the simulated system can (and often it does) reveal errors orambiguities in the system design. So simulation can help very much byavoiding future very expensive updating of the ready system.

    CISM02 Decision Support for Management Unit 10

    Simulation Process:a Descriptive Process

    18

    Simulation is the process of developing a model of a problem andestimating measures of the problems performance by performingsampling experiments on the model.

    Simulation differs significantly form the modelling-solution frameworkwhere we stress the formulation and development of analytical modelsand the analytical solutions.In most cases the analytical solutions are inthe form of algorithms (e.g. that yielded optimalsolutions).

    Simulation emphasises neither of these factorsit is adescriptivemodelling processas opposed to a normative process.

    McKeown

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    10/30 1

    Simulation Models

    19

    Reminder

    Simulation modelscan be classified according to the time at which statetransitions occur. This way there is differentiation betweencontinuousanddiscrete simulation models.

    In acontinuous simulation, the state of the model changes continuously withthe times.

    In adiscrete simulation, the state transition occurs at intervals, i. e. at discretetimes.

    Discrete simulation models are further differentiated intotime-controlled,event-driven, activity-oriented, process-oriented andtransaction-orientedsimulation models.

    CISM02 Decision Support for Management Unit 10

    Types of Simulation

    20

    There are three general types of simulation:

    Analogue modelContinuous modelDiscrete model

    The analogue modelreplaces the original (physical) system by ananalogy which is easier to manipulate. A typical example is the

    representation of a mechanical system by an equivalent electricalsystem where the latter is simply to modify.

    Unlike the analogue model, both continuous and discrete simulationsare basically mathematical models.

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    11/30

    Continuous Models

    21

    Continuous models represent the system experiencing smoothchanges in characteristics over time.

    The objective of the model is to plot the simultaneous (continuous)variations of the different characteristics with time.

    For example, in an inventory system the output might include timechanges of inventory levels, sales, unsatisfied demand, andbackorders.

    CISM02 Decision Support for Management Unit 10

    Discrete Models

    22

    In discrete models a system is simulated by observing it only atselected points in time.

    These points coincide with the occurrence of certain events whichare crucial to effecting changes in systems performance.

    The most common type of simulation is the discrete model.

    A discrete eventis something that occurs at an instant of time.

    For example, pushing an lift button, starting of a motor, stopping of amotor, and turning on a light, are all discrete events because there isan instant of time at which each occurs.

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    12/30 1

    Event-Type or Discrete Simulation orDiscrete Event Simulation (1)

    23

    Informally, adiscrete-event simulation, orevent-based simulation,permits the system's state transitions to depend on asynchronousdiscrete incidents that are calledevents.

    The heart of a discrete model is the identification of the events whichcompletely describe the behaviour of the system.

    Each event defines a point in time which signifies the termination ofone or more activities and/or the beginning of new ones.

    CISM02 Decision Support for Management Unit 10

    Discrete Event Simulation (2)

    24

    Discrete Event Simulation(DES) concerns the modelling of a systemas it evolves over time by representing the changes as separateevents.

    This is the opposite of Continuous Simulationwhere the systemevolves as a continuous function (differential).

    A simulation based solely on differential equations in which time isan independent variable is atime-based simulationbecause statetransitions depend on time.

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    13/30 1

    Discrete Event Simulation (3)

    25

    Some examples illustrate these differences:

    Suppose you are interested in how long the average airplane waits in aqueue for its turn to use an airport runway, but not interested in thedetails of how an airplane moves once it is cleared for takeoff. You mightusediscrete-event simulationin which the relevant events include theapproach of a new airplane to the runway and the clearance for takeoffof an airplane in the queue.

    Suppose you are interested in the trajectory of an airplane as it takesoff. You would probably usetime-based simulationbecause finding thetrajectory involves solving differential equations.

    CISM02 Decision Support for Management Unit 10

    Discrete Event Simulation (4)

    26

    Suppose you are interested in how long the airplanes wait in the queuebut you want to model the takeoff in some detail instead of using astatistical distribution to model the length of time that each plane usesthe runway.

    You might use a combination oftime-based simulationand discrete-

    event simulation, where the time-based aspect controls details of aplane's takeoff and the discrete-event aspect controls the queuingbehaviour.

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    14/30 1

    Discrete Events: an Example

    27

    Activities such as moving a train from pointAto pointBarenot discreteevents because they have a time duration.

    However, we can model an event like this as two separate discreteevents: the event of the train leaving pointA, and the event of the trainarriving at pointB.

    If we associate a time value with each discrete event, then we can modelthe duration activities as the difference between the times associatedwith the events marking the beginning and the end of each activity.

    For example, we can specify that the arrival at pointBoccurs 3 hours

    and 37 minutesafter leaving pointA. Therefore, we can see that if thetrain leaves pointAat 7:53 pm, then it will arrives at pointBat 11:30 pm.

    CISM02 Decision Support for Management Unit 10

    Discrete Event Simulation:an Example (1)

    28

    The purpose of adiscrete event simulationis to study a complexsystem by computing the times that would be associated with realevents in a real-life situation.

    In the train example above, suppose that we know that when the trainarrives at pointB, a load is transferred to a second train that arrives atpointCafter 45 minutes.

    That is, the second train's departure from pointBis triggered by the firsttrain's arrival, and the arrival at pointCoccurs with a delay of 45minutesafter the departure from pointB.

    In this simple example, we can use discrete event simulation todetermine that the second train will arrive at pointCat 12:15 am.

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    15/30 1

    Discrete Event Simulation:an Example (2)

    29

    One way to carry out a simulation is to use the real-time clock (theclock on the wall) to time the delays, and to read the value on the clockas each event completes in order to see what would happen. However,this would take unnecessarily long.

    For example, it would be silly to wait 3 hoursand 37 minutestodetermine the arrival time of the first train when a simple calculationsuffices.

    So, theidea of a discrete event simulationis to compute, as quickly aspossible, the physical times that "would" occur in real time in a physicalsystem, but without actually waiting for the delays between events tooccur in real time.

    CISM02 Decision Support for Management Unit 10

    Discrete Event Simulation:Key Stages

    30

    .

    Data Collection

    Build a Model

    Initial Test

    Experiment

    Modifications/Refinements

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    16/30 1

    Discrete Event Simulation (1)

    1 Event

    This approach describes an instantaneous change, usually from a stop event to a start

    event. This is the most common one used, easy to understand and efficient and is

    acceptable to implement.

    2 Activities

    Represents a duration. Essentially groups a number of events in o rder to describe an

    activity carried out by an entity e.g. a machine loading. This approach is easy to

    understand and to implement but is not efficient.

    3 Process

    This approach groups activities to describe the life cycle of an entity e.g. a machine.

    This is less common and more difficult to plan and implement, but is generally

    thought to be the most efficient.

    31

    There are also three approaches to describing the discrete simulation:

    CISM02 Decision Support for Management Unit 10

    Discrete Event Simulation (2)

    32

    The event approachdescribes an event as an instantaneous changeand such events are usually paired, e.g. start of machine loading, endof machine loading, etc. Activities describe a duration, e.g. machineloading, and are therefore very similar to pairs of events. The processapproachjoins collections of events or activities together to describethe life cycle of an entity, in this case a machine.

    The event approachis easy to understand and computationallyefficient but is more difficult to implement than the activity approach.On the other hand whilst activity approachis relatively easy tounderstand it suffers from poor execution efficiency.

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    17/30 1

    Basics of Simulation (1)

    33

    In random sampling from a probability distribution, we usually requirethree things:

    1. A set of random numbers2. A way of converting these numbers into another set of numbers,

    random variates, which have the same distribution as the variableinvolved.

    3. A sampling-estimating procedure.

    CISM02 Decision Support for Management Unit 10

    Random Numbers (1)

    34

    There is no problem in obtaining random numbers for simulationsperformed by hand.

    Lots of tables of such numbers are available. When a computer is to beused in simulation, however, we can seldom afford to fill the computersmemory with a large number of random digits. Consequently, programshave been developed for generating what are calledpseudorandom

    numbers. Two of the more commonly used generating procedures arethemidsquareand congruential techniques.

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    18/30 1

    Random Numbers:Midsquare Technique (2)

    35

    The midsquare procedureconsists of taking a four-digit number (moreelaborative techniques may use up to ten digits), preferably (but notnecessarily) selected at random, squaring it, taking the four digitsstarting at the third from the left, recording them, squaring them, and soon.

    For example, if we start with3182, by squaring we obtain10,125,124.We then take the four digits,1251, record them, square them, and so on.Eventually this procedure will return to the number with which it started.The length of the cycle generally falls between and .410 610

    CISM02 Decision Support for Management Unit 10

    Random Numbers:Congruential Technique (3)

    36

    Thecongruential procedure, although more complicated, may yieldcycles as large as . This procedure consists of letting1210

    )(mod1 MKXX nn

    This is,Xn+1is equal to the number that remains afterKXnis divided byM.

    This method was first reported by Lehmer (1951), who usedK=23, M= .

    He obtained a sequence of eight-digit numbers with a cycle length of5,882,352.

    1108

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    19/30 1

    Random Variates froma Specified Probability Distribution (1)

    37

    The procedure for converting random numbers into numbers drawnfrom a specified probability distribution is a relatively simple one inprinciple, although it may be quite difficult in practice.

    Suppose that we plot the relevant distribution in a cumulative form as in figurebelow:

    Random number

    Random variate

    X

    Cumulative probability

    F(x)1.0 (1000)

    CISM02 Decision Support for Management Unit 10

    Random Variates froma Specified Probability Distribution (2)

    38

    We divide the vertical scale of probability into, say, one thousand parts.When a random number is selected, it is located on this scale andprojected horizontally over to the function.

    Then one projects down to the abscissa and reads the correspondingrandom variate.

    It can be seen that variates under the steepest part of the function where the probability is most denseare most likely to be selected.

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    20/30 2

    The Structure of Simulation (1)

    39

    In formulating a simulation model an important consideration is how thesimulation will be made to progress through time.

    This is particularly important for computer simulation models as thetime flow mechanism must be build into the computer program.

    There are two general types of time mechanism:

    Fixed time incrementsthe system is updated by uniform incrementsof time.

    Variable time incrementsthe system is updated to the time when thenext event is due to take place.

    Hull, et al., 1977

    CISM02 Decision Support for Management Unit 10

    Deterministic Model Example

    40

    An example of adeterministic modelis a calculation to determine thereturn on a 5-year investmentwith an annual interest rate of7%,compounded monthly.

    The model is just the equation below:

    F=P(1+r/m)Theinputsare theinitial investment(P= $1000),annual interest rate(r= 7%= 0.07), thecompounding period(m= 12 months), and thenumber of years(Y= 5).

    Ym

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    21/30 2

    Deterministic Model Example

    41

    One of the purposes of a model such as this is to make predictions andtry"What If?" scenarios.

    You can change the inputs and recalculate the model and you'll get anew answer.

    You might even want to plot a graph of the future value (F) vs.years(Y). In some cases, you may have a fixed interest rate, but what do youdo if the interest rate is allowed to change?

    For this simple equation, you might only care to know aworst/best case

    scenario, where you calculate the future value based upon thelowestand highest interest ratesthat you might expect.

    CISM02 Decision Support for Management Unit 10

    A Hand Simulation:Attendant Problem (1)

    42

    Let us consider an example which introduces the nature of simulation.

    The filling station is managed by a single attendant who serves thecustomers directly, each one taking between one and six minutes of histime (the longer times corresponding to customers needing oil and abattery and tyre check as well as petrol).The management problem tobe resolved is that of whether it would be worthwhile to employ a

    second attendant to improve the service given to customers. For thepurposes of the example a change to self-service is not a feasiblealternative.

    Theaim of the simulationis, therefore, to test the effect that employingthe second attendant has on the queuing time of customers withoutgoing to the trouble and expense of hiring one.

    Kidd, 1985, pp.233

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    22/30 2

    A Hand Simulation:Attendant Problem (2)

    43

    There is a need for knowledge of the behaviour of a system in advanceof making changes to it and also the system is subject to random orerratic events.

    Customers do not arrive regularly and it takes different amounts of timeto serve them.

    First we need to make a formal record of the current behaviour of thesystem. (see Table below).

    Kidd, 1985, pp.233

    CISM02 Decision Support for Management Unit 10

    A Hand Simulation:Attendant Problem (3)

    Time No of arrivals

    1 0

    2 1

    3 1

    4 1

    5 0

    6 0

    7 0

    8 0

    9 010 0

    11 0

    12 0

    13 0

    14 2

    15 0

    Time Events

    08-01

    08-02 Car arrives; attendant serves it

    08-03 Car arrives; waits for service

    08-04 Car arrives; joins queue

    08-05 Car leaves; attendant services next car in queue

    08-06

    08-07 Car leaves; attendant services next car

    08-08

    08-0908-10

    08-11 Car leaves; attendant returns to his office

    08-12

    08-13

    08-14 2 Cars arrive; attendant services one of them

    08-16 Car arrives; joins queue

    Car

    No

    Service

    Time

    1 3

    2 2

    3 4

    4 3

    5 3

    6 1

    7 3

    8 2

    9 1

    10 3

    44

    .Kidd, 1985, pp.233

    16 1

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    23/30 2

    A Hand Simulation:Attendant Problem (4)

    45

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    Server

    0

    2

    1

    3

    4

    5

    6

    7

    8

    9

    10

    11

    10

    11

    9

    5

    8

    7

    6

    4

    3

    2

    1

    0

    ..

    .

    .

    .

    ..

    .

    One Attendance Two Attendances

    CISM02 Decision Support for Management Unit 10

    A Hand Simulation:Attendant Problem (5)

    46

    A much longer simulation run would be needed to show the extent of theimprovement.

    A major shortcoming of the hand simulation is the way it handles randomevents.The randomness of customer behaviour is governed by theobservation made on a particular day and at a particular time.

    If what happened when these observations were made was not typical,the simulation results will not relate to representative behaviour of thefilling station.

    Kidd, 1985, pp.233

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    24/30 2

    A Hand Simulation:Attendant Problem (6)

    47

    In order to overcome this difficulty an improved mechanism for handlingrandom events is needed.

    One way of approaching this problem is to increase the range of initialobservations, but this may be very time-consuming and may still provideonly a limited set of observations.

    A better way is to use the original observations to establish a pattern inthe random events and then to sample from the pattern rather than froma particular set of observations. In this way an almost limitless number oftypical dayscan be created.

    Kidd, 1985, pp.233

    CISM02 Decision Support for Management Unit 10

    Monte Carlo Simulation

    48

    A technique which has had a great impact in many different fields ofcomputational science is a technique called "Monte Carlo Simulation."

    This technique derives its name from the casinos in Monte Carlo - aMonte Carlo simulation uses random numbers to model some sort of aprocess.

    This technique works particularly well when the process is one where

    the underlying probabilities are known but the results are more difficultto determine.

    A great deal of the CPU time on some of the fastest computers in theworld is spent performing Monte Carlo simulations because we canwrite down some of the fundamental laws of physics but cannotanalytically solve them for problems of interest.

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    25/30 2

    Monte Carlo Simulation

    49

    Monte Carlo simulationis a method foriterativelyevaluating adeterministic modelusing sets of random numbers as inputs.

    This method is often used when the model is complex, nonlinear, orinvolves more than just a couple uncertain parameters.

    A simulation can typically involveover 10,000 evaluationsof the model,a task which in the past was only practical using super computers.

    CISM02 Decision Support for Management Unit 10

    Simulation vs.Monte Carlo Simulation

    50

    Some authors use the termsMonte Carlo simulationand simulation(discretesystem simulation) synonymously.

    However, there is a distinction between the two.

    Both simulation and Monte Carlo simulation imply that the simulation modelis influenced by random events; however,the system being modelled isdeterministicin the case of Monte Carlo simulation, andstochastic

    (presence of random phenomena)in the case of simulation.

    In other words, Monte Carlo simulation is performed by using an approximatestochastic model of a deterministic system whereas in simulation both thereal system and its model are stochastic in nature.

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    26/30 2

    What are the characteristics ofMonte Carlo Simulation?

    51

    Three characteristics of Monte Carlo Simulation:

    1. Random sample generation2. The input distribution is known3. Numerical Experiments

    The direct output of Monte Carlo simulation method is generation ofRandom sampling.

    Other performance or statistical outputs are indirect method, which

    depend on the applications.

    CISM02 Decision Support for Management Unit 10

    What are the characteristics ofMonte Carlo Simulation?

    52

    The input of the simulation is distribution (based on some theoreticaldistribution or from observation).

    Numerical experiments characteristic of Monte Carlo simulation leadus to runmany samplesbefore we can get the result.

    Only single sample of the simulation will surely give false results. This

    happens because Monte Carlo Simulation work based onMonte CarloAlgorithm.

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    27/30 2

    How the Monte Carlo Algorithmworks?

    53

    Monte Carlo Algorithm works based on theLaw of Large Numbers.

    It says that if you generatelargenumber of samples, eventually youwill get theapproximatedesire distribution.

    A computer simulation with a built-in random process, allowing youto see the probabilities of different possible outcomes.

    CISM02 Decision Support for Management Unit 10

    Monte Carlo:Statistical Sampling Method

    54

    Monte Carlo simulation is categorized as asampling methodbecausethe inputs are randomly generated fromprobability distributionstosimulate the process of sampling from an actualpopulation.

    So, we try to choose a distribution for the inputs that most closelymatches data we already have, or best represents ourcurrent state ofknowledge.

    The data generated from the simulation can be represented as

    probability distributions (or histograms) or converted toerror bars,reliability predictions, tolerance zones, andconfidence intervals.

    Monte Carlo simulationcan be defined as a method to generate randomsample data based on some known distribution for numericalexperiments.Monte Carlo methodis a sampling processs used to select samplevalues randomly from a probability distribution.

    CISM02 Decision Support for Management Unit 10

  • 7/25/2019 Cism02 Unit 10

    28/30 2

    The Estimation of Pi (1)

    55

    The area of the square is given by

    Ssq=r2

    The area of a circle is given by

    Scr=r2Pi

    the quadrant's area is

    Sq=r2Pi/4

    The ratio of the area of the quadrantand the square therefore is

    Ratio=Pi/4

    Now suppose we pick at random a large number of points inside the square,then the ratio of total points (inside the square) divided by the number ofpoints inside the quadrant, will give us an estimate ofPi/4.

    CISM02 Decision Support for Management Unit 10

    The Estimation of Pi (2)

    56

    Suppose r = 1; d=x2+ y2

    Let us pick random coordinatesx,yin the range01.

    Ifd is less than or equal to1, i.e.d

  • 7/25/2019 Cism02 Unit 10

    29/30 2

    The Estimation of Pi (3)

    57

    We can generate thousands of random(x,y)positions anddetermine whether each of them are inside of the circle.

    Each time it is inside of the circle, we will add one to a counter.

    After generating a large number of points, the ratio of the number ofpoints inside the circle to the total number of points generated willapproach the ratio of the area of the circle to the area of the square.

    CISM02 Decision Support for Management Unit 10

    The Estimation of Pi (4):MatLab Program

    58

    The program below can be used to find an approximation ofpi

    % pi.m

    % Matlab Program to Findpi using Random NumbersNrand = input('How Many Random Numbers ');NInside = 0;

    fornloops=1:NrandXrand = rand; % Generate Random XY PointYrand = rand;Rrand = Xrand^2 + Yrand^2; % Find its distance from origin

    if (Rrand

  • 7/25/2019 Cism02 Unit 10

    30/30

    Simulation Steps

    59

    Reminder

    In case a simulation model is developed, the following steps must usually betaken:

    analysis of the simulation requirements generation and specification of the simulation concept assessment of the simulation concept generation of test scenarios development of the simulation model testing the simulation model making available the scenario test data and performing the simulation runs

    analysis and evaluation of the simulation results testing the simulation model possible upgrade or modification of the simulation model

    CISM02 Decision Support for Management Unit 10

    60

    Main Practical Steps of a Simulation Study

    CISM02 Decision Support for Management Unit 10