Ch10 - Simulation

Embed Size (px)

Citation preview

  • 7/23/2019 Ch10 - Simulation

    1/51

    1

    Simulation

    Chapter Ten

  • 7/23/2019 Ch10 - Simulation

    2/51

    2

    13.1 Overview of Simulation

    When do we prefer to develop simulation modelover an analytic

    model? When not all the underlying assumptions set for analytic model are valid.

    When mathematical complexity makes it hard to provide useful results. When good solutions (not necessarily optimal are satisfactory.

    ! simulation develops a model to numerically evaluate a system

    over some time period.

    "y estimating characteristics of the system# the best alternative

    from a set of alternatives under considerationcan $e selected.

  • 7/23/2019 Ch10 - Simulation

    3/51

    3

    Continuous simulation systems monitor the system each

    time a change in its state takes place.

    Discrete simulation systems monitor changes in a state

    of a system at discrete points in time.

    %imulation of most practical pro$lems re&uires the use of

    a computer program.

    13.1 Overview of Simulation

  • 7/23/2019 Ch10 - Simulation

    4/51

    4

    !pproaches to developing a simulation model'sing addins to )xcel such as *+isk or Crystal "all

    'sing general purpose programming languages such as,-+T+!/# 0123# 0ascal# "asic.

    'sing simulation languages such as 40%%# %56!/# %1!6.

    'sing a simulator software program.

    13.1 Overview of Simulation

    6odeling and programming skills# as well asknowledge of statistics are re&uired when implementing

    the simulation approach.

  • 7/23/2019 Ch10 - Simulation

    5/51

    5

    10.2 Monte Carlo Simulation

    6onte Carlo simulation generates random events.

    +andom events in a simulation model are needed

    when the input data includes random varia$les.

    To reflect the relative fre&uencies of the random

    varia$les# the random number mappingmethod is

    used.

  • 7/23/2019 Ch10 - Simulation

    6/51

    6

    7ewel 8ending Company (78C installs and

    stocks vending machines.

    "ill# the owner of 78C# considers the installation

    of a certain product (%uper %ucker 9aw

    $reaker in a vending machine located at a newsupermarket.

    JEWEL VEN!N" COM#$N% &

    an example for the random mapping techni&ue

  • 7/23/2019 Ch10 - Simulation

    7/517

    :ata The vending machine holds ;< units of the product.

    The machine should $e filled when it $ecomes half empty. :aily demand distri$ution is estimated from similar vending machine

    placements. 0(:aily demand = < 9aw $reakers =

  • 7/23/2019 Ch10 - Simulation

    8/518

  • 7/23/2019 Ch10 - Simulation

    9/51

    9

    3.

  • 7/23/2019 Ch10 - Simulation

    10/51

    10

    ! random demand can $e generated $y hand (for

    small pro$lems from a ta$le of pseudo random

    num$ers.'sing )xcel a random num$er can $e generated

    $y

    The +!/:( functionThe random num$er generation option (ToolsH:ata

    !nalysis

    Simulation of t/e JVC #ro+lem

  • 7/23/2019 Ch10 - Simulation

    11/51

    11

    *andom .wo 2irst .otal emand

    a0 Num+er i-its emand to ate

    3 C> @ @

    ? DDC3 DD A D

    @ C3D< C3 @ 3? DA @ 3B

    *andom .wo 2irst .otal emanda0 Num+er i-its emand to ate

    3 C> @ @

    ? DDC3 DD A D

    @ C3D< C3 @ 3? DA @ 3B

    Simulation of t/e JVC #ro+lem

    %ince we have two digit pro$a$ilities# we use the first two

    digits of each random num$er.

    BBAA

    < 3 @ A > 3

    !n illustration of generating a daily random demand.

  • 7/23/2019 Ch10 - Simulation

    12/51

    12

    The simulation is repeated and stops once total demand reaches

    A< or more.

    Simulation of t/e JVC #ro+lem

    *andom .wo 2irst .otal emand

    a0 Num+er i-its emand to ate

    3 C> @ @

    ? DDC3 DD A D

    @ C3D< C3 @ 3? DA @ 3B

    *andom .wo 2irst .otal emanda0 Num+er i-its emand to ate

    3 C> @ @

    ? DDC3 DD A D

    @ C3D< C3 @ 3? DA @ 3B

    The num$er of simulated days

    re&uired for the total demand to

    reach A< or more is recorded.

  • 7/23/2019 Ch10 - Simulation

    13/51

    13

    The purpose of performing the simulation runs is to find the

    average num$er of days re&uired to sell A< 9aw $reakers.

    )ach simulation run ends up with (possi$ly a different num$er

    of days.

    ! hypothesis test is conducted to test whether or not = 3.

    /ull hypothesis I< , =3

    !lternative hypothesis I!, 3

    Simulation *esults and ,ot/esis ests

  • 7/23/2019 Ch10 - Simulation

    14/51

    14

    The test,:efine (the significance level.

    1et n $e the num$er of replication runs."uild the tstatistic

    The t-statistic can be used if the random variable observed

    (number of day required for the total demand to be 40 or more) is

    normally distributed, hile the standard deviation is un!non"+e9ect I

  • 7/23/2019 Ch10 - Simulation

    15/51

    15

    Trials = 3

    6ax=JK sales = = .(

  • 7/23/2019 Ch10 - Simulation

    21/51

    21

    'sing the template inventory.xls for the plannedshortage model# and assuming a constant

    demand of units per week (@3 per year wehave,ptimal ordering policy,

    RS = A.;; (rounded to >

    %S= .3> (rounded to to K +eorder when inventory isat a level of 3;.A;

    $$C & /e #lanned S/orta-e Model

  • 7/23/2019 Ch10 - Simulation

    22/51

    22

    "ecause demand is uncertain# a simulation

    models has $een developed.

    ! continuous review (+#R system is studiedfirst# where + = 3< and R = >.

    $$C & /e Simulation Model

  • 7/23/2019 Ch10 - Simulation

    23/51

    23

    The random num$er mapping associated with the distri$utionsare,/um$er of !rrivals 0ro$a$ility +andom mapping

    < .3< U ;AA .3> ;> U BB

    :emand2customer 0ro$a$ility +andom mapping

    3 .3< U AA .@> > U BB

    $$C & /e Simulation Model

  • 7/23/2019 Ch10 - Simulation

    24/51

    24

    The simulation keeps track of the following

    &uantities,

    "eginning inventory for the week = )nding inventory ofthe previous week L order received.

    /um$er of retailers arriving# their demand# and the total

    weekly demand.

    )nding inventory for the week = "eginning inventory L

    order received U weekly demand.

    $$C & /e Simulation Lo-i

  • 7/23/2019 Ch10 - Simulation

    25/51

    25

    The simulation determines whether or not an order

    should $e placed as follows,

    5s the ending inventory3< and is there no outstandingorder? 5f so# place an order and keep track of the lead

    time.

    The simulation calculates the Weekly cost,rdering cost (if applica$le L Iolding cost (if ending

    inventory H

  • 7/23/2019 Ch10 - Simulation

    26/51

    26

    5nitial inventory = >.

    Weekly cost = rder cost (if any L 3(%tock on hand L (/ew$ack orders L >(Total $ackorders

    Total cost for 3< weeks = NA3> (weekly average = NA3.>.

    $$C & 10 wee5 simulation results

  • 7/23/2019 Ch10 - Simulation

    27/51

    27

    $$C & 1000 wee5s of simulation

    s,reads/eet resultsINPUTS

    Q = 25 Ch = 1

    R = 10 Co = 45

    Cs = 5

    Cb = 2

    OUTPUTAverage Cost = 33.109

    a! Start o" #ee$ % o" C&sto'er Tota( )*+ o" #ee$ Tota(

    I*ve*tor! Arr,va(s e'a*+ I*ve*tor! Cost

    1 25 3 9 1- 1-

    2 1- 2 9 54

    3 9 3 11 /2 144 /2 1 4 /- 3

    5 19 0 0 19 19

    - 19 1 4 15 15

    15 1 2 13 13

  • 7/23/2019 Ch10 - Simulation

    28/51

    28

    10.) Simulation of a 6ueuin- Sstem

    5n &ueuing systems time itself is a random varia$le.

    Therefore# we use the ne$t event simulationapproach.

    The simulated data are updated each time a new event

    takes place (not at a fixed time periods.

    Theprocess interactive approach is used in this kind of

    simulation (all relevant processes related to an item as it

    moves through the system# are traced and recorded.

  • 7/23/2019 Ch10 - Simulation

    29/51

    29

    C$#!$L 7$N8

    $n e4am,le of 9ueuin- sstem simulationCapital "ank is considering opening the $ank on

    %aturdays morning from B,

  • 7/23/2019 Ch10 - Simulation

    30/51

    30

    C$#!$L 7$N8

    :ata, There are > teller positions of which only three will

    $e staffed.

    !nn :oss is the head teller# experienced# and fast. "ill 1ee and Carla :omingueV are associate tellers less

    experienced and slower.

  • 7/23/2019 Ch10 - Simulation

    31/51

  • 7/23/2019 Ch10 - Simulation

    32/51

    32

    C$#!$L 7$N8

    :ata, Customer interarrival time distri$ution

    interarrival time 0ro$a$ility

    .> 6inutes .>

    3 .3>

    3.> .3>

    .

    %ervice priority rule is first come first served

    ! simulation model is re&uired to analyVe the service .

  • 7/23/2019 Ch10 - Simulation

    33/51

    33

    Calculating expected values, )(interarrival time = .>(.>L3(.3>L3.>(.3>L(. = .; customers arrive per hour on the average#

    (Q

    )(service time for !nn = .3(.L3(.3(. =

    minutes P!nn can serve

  • 7/23/2019 Ch10 - Simulation

    34/51

  • 7/23/2019 Ch10 - Simulation

    35/51

    35

    5f no customer waits in line# an arriving customer seeks service $ya free teller in the following order, !nn# "ill# Carla.

    5f all the tellers are $usy the customer waits in line and takes then

    the next availa$le teller.The waiting time is the time a customer spends in line# and iscalculated $y

    &Time service beginsQ minus&'rrival Time

    C$#!$L 7$N8 & /e Simulation lo-i

  • 7/23/2019 Ch10 - Simulation

    36/51

    36

    C$#!$L & Simulation emonstration

    6apping 5nterarrival time

    ;< U BA 3.> minutes

    6apping !nns %ervice time

    @> U A minutes

    3.:!nn"ill

    1.:1.:

    1.: 1.: 1.:1.:

    1.:

    1.:1.:1.:

  • 7/23/2019 Ch10 - Simulation

    37/51

    37

    C$#!$L & Simulation emonstration

    6apping 5nterarrival time

    ;< U BA 3.> minutes

    6apping "ills %ervice time

    A< U B .> minutes

    !nn"ill 3 :.:

    3.:1.:

  • 7/23/2019 Ch10 - Simulation

    38/51

    38

    C$#!$L & Simulation emonstration

    3.:3Waiting time

  • 7/23/2019 Ch10 - Simulation

    39/51

    39

    Average Waiting Time in Line = 1.-0

    Average Waiting Time in System = 3.993

    Waiting Waiting

    Random Arrival Random Time Time

    Customer Number Time Number Start Finish Start Finish Start Finish Line System

    1 0. 1.5 0.9- 1.5 5 0 3.5

    2 0.1 2.0 0.- 2 5 0 3.0

    3 0.49 2.5 0. 2.5 5.5 0 3.0

    4 0.- 4.0 0.49 5 1 3.0

    5 0.54 4.5 0.5 5 .5 0.5 4.0

    - 0.-1 5.0 0.55 5.5 0.5 3.0

    0.91 -.5 0.90 10 0.5 3.5 0.-4 .0 0.-2 10.5 1 3.5

    Ann Bill Carla

    C$#!$L & 1000 Customer Simulation

  • 7/23/2019 Ch10 - Simulation

    40/51

    40

    Average Waiting Time in Line = 1.-0

    Average Waiting Time in System = 3.993

    Waiting Waiting

    Random Arrival Random Time Time

    Customer Number Time Number Start Finish Start Finish Start Finish Line System

    1 0. 1.5 0.9- 1.5 5 0 3.5

    2 0.1 2.0 0.- 2 5 0 3.0

    3 0.49 2.5 0. 2.5 5.5 0 3.0

    4 0.- 4.0 0.49 5 1 3.0

    5 0.54 4.5 0.5 5 .5 0.5 4.0

    - 0.-1 5.0 0.55 5.5 0.5 3.0

    0.91 -.5 0.90 10 0.5 3.5 0.-4 .0 0.-2 10.5 1 3.5

    Ann Bill Carla

    C$#!$L & 1000 Customer Simulation

    This simulation estimates two performance measures, !verage waiting time in line (W& = 3.D minutes

    !verage waiting time in the system W = @.BB@ minutes

    This simulation estimates two performance measures, !verage waiting time in line (W& = 3.D minutes

    !verage waiting time in the system W = @.BB@ minutes

    To determine the other performance measures# we can use1ittles formulas, !verage num$er of customers in line 1& =(32.;

  • 7/23/2019 Ch10 - Simulation

    41/51

    41

    Ma,,in- for Continuous *andom Varia+les

    )xampleThe )xplicit inverse distri$ution method can $e used to

    generate a random num$er E from the exponentialdistri$ution with = (i.e. service time is exponentiallydistri$uted# with an average of customers perminute.

    +andomly select a num$er from the uniform distri$ution $etween