ME or Vxii Simulation

Embed Size (px)

Citation preview

  • 7/30/2019 ME or Vxii Simulation

    1/14

    Parul Institute of Engineering & Technology

    Subject Code : 171901

    Name Of Subject :Operation Research

    Name of Unit : Simulation

    Topic : Monte Carlo Simulation& Generation of random

    Numbers

    Name of Faculty : R.N Barot

    Name of Students: (i) Shah Devanshu[49]

    (ii) Mehta Hardik[50]

  • 7/30/2019 ME or Vxii Simulation

    2/14

    Simulation:A type of model where the computer is used to

    imitate the behavior of the system

    Monte Carlo simulation: Simulation that makes use of

    internally generated (pseudo) random numbers.It is a technique which involves conducting experiments on

    the model of the system under study, with some probability

    distribution to draw random samples using random numbers.

    Monte Carlo Simulation:

  • 7/30/2019 ME or Vxii Simulation

    3/14

    3

    Ways to Study System

    Focus of class

    System

    Experiment w/

    actualsystemExperiment w/

    modelof

    system

    Physical

    ModelMathematical

    Model

    Analytical

    Model

    Simulation

    Model

  • 7/30/2019 ME or Vxii Simulation

    4/14

    In a Monte Carlo simulation we attempt to follow the `time

    dependence of a model for which change, or growth, does

    not proceed in some rigorously predefined fashion (e.g.

    according to Newtons equations of motion) but rather in a

    stochastic manner which depends on a sequence of randomnumbers which is generated during the simulation.

    MC method is often referred to as the method of last

    resort, as it is apt to consume large computing resources;

  • 7/30/2019 ME or Vxii Simulation

    5/14

    1) Calculate Probability distribution for variables to beanalysed .

    2) Calculate a cumulative probability distribution for each

    random variable.

    3) Generate random numbers.4) Assign appropriate set of random numbers

    5) Conduct simulation experiment using random numbers.

    6) Repeat the steps until satisfactory runs are not completed.

    7) Design and implement the course of outcome ofsimulation and maintain it.

    Steps of Monte Carlo simulation:

  • 7/30/2019 ME or Vxii Simulation

    6/14

    consuming vast computing resourceshave historically had to be executed upon the fastestcomputers available at the timeand employ the most advanced algorithms implemented with substantial programming acumen.

    The name "Monte Carlo" comes from the city of MonteCarlo in the principality of Monaco, famous for itsgambling house

    Characteristics:

  • 7/30/2019 ME or Vxii Simulation

    7/14

    Monte Carlo methods can help in design and prediction of

    behavior of systems in nuclear applications and radiationphysics

    The use of MC in the area of nuclear power has undergone

    an important evolution. Notable are the extensions to

    compute burnup in reactor cores, and full core neutronic

    simulations. Random numbers generated by the computer

    are used to simulate naturally random processes

    many previously intractable thermodynamic and quantummechanics problems have been solved using Monte Carlo

    techniques.

    Applications:

  • 7/30/2019 ME or Vxii Simulation

    8/14

    Random number generators produce a flow of numbers that

    Are observations from a continuous uniform distribution

    between 0 and 1

    Are independent of each other

    Remember the discussion on pseudorandom numbers

    Need of RNs in simulation

    Generation of random variates to recapture prob. distribution

    of stochastic process parameters

    Random number generation

  • 7/30/2019 ME or Vxii Simulation

    9/14

    The Midsquare method (von Neumann and Metropolis1940s)

    EX: Start with an arbitrary 3-digit #

    Z0 = 123 Z02 = (123)2 = 15129

    Z1 = 512 U1 = 0.512 Z12 = (512)2 = 262144Z2 = 621 U2 = 0.621 Z22 = (621)2 = 385641

    EX: A 4-digit example (see L&K Table 7.1)

    ProblemsZero problem 002 004 zero will stay

    Cycle length

    The one trap 001 001 001

    Methods of number generation

  • 7/30/2019 ME or Vxii Simulation

    10/14

    10

    Random-Number Generators

    The Midproduct Method

    Variation of Midsquare method and improved

    EX:Start with two arbitrary 3-digit #s

    Z0 = 123 Z1 = 456

    Z0Z1 = (123)(456) = 56088 U1 = 0.608 Z2 = 608

    Z1Z2 = (456)(608) = 277248 U2 = 0.772 Z3 = 772

    Z2Z3 = (608)(772) = 469376 U3 = 0.693 Z4 = 693

  • 7/30/2019 ME or Vxii Simulation

    11/14

    11

    Linear Congruential Generators (LCG)

    Problems and Concerns Zis are not really random at all, i.e., Zi can be

    determined by m, a, c, and Z0

    However, by careful choice of these four parameters

    we try to make the corresponding Uis appear to beIID U(0,1) random variates subjected to some tests

    Uis are 0, 1/m, 2/m, 3/m, (m-1)/m, impossible toget fractions, say 0.3/m or 1.5/m

    i.e., m needs be very large to have desired density

    Ex: m109, there are at least a billion possiblevalues, a good approximation to the truecontinuous U(0,1) distribution

  • 7/30/2019 ME or Vxii Simulation

    12/14

    12

    Finding the ith RN Directly from Z0

    Also -

    Zi can be obtained directly from Z0 withoutgoing through Z1, Z2, , Zi-1,

    For i = 1, 2, ...Zi = [a

    iZ0 + c(ai - 1)/(a- 1)] (mod m)

    This shows Zis are not really random at all.

    ===> Predictablity

    However, Zis are predictable does not meanthey are correlated.

  • 7/30/2019 ME or Vxii Simulation

    13/14

    13

    Linear Congruential Generators (LCG)

    Problems and Concerns

    Looping (or Repeating cycle):

    LCG: m = 16, a = 5, c = 3, Z0= 7 for i = 1, 2, , 19

    Zi = (5 Zi-1 + 3) (mod 16) Z0 = 7

    Z1 = Z17 = 6, Z2 = Z18 = 1, Z3 = Z19 = 8

    (see L&K Table 7.2)

    Length of cycle mIf length of cycle = m, then LCG has a full period

    If m and loop m, then LCG is adequate

  • 7/30/2019 ME or Vxii Simulation

    14/14