SIMULATION Simulation of a process the examination of any emulating process simpler than that under consideration Examples Systems Simulation such as simulation of engineering systems large organizational systems and governmental systems ID: 661391
Download Presentation The PPT/PDF document "MONTE CARLO SIMULATION MATH 182" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
MONTE CARLO SIMULATION
MATH 182Slide2Slide3
SIMULATION
Simulation
of a process
– the examination
of any emulating process simpler than that under consideration
.
Examples:
System’s Simulation such as simulation of engineering systems, large organizational systems, and governmental systems
Operational Gaming such as military gaming and business gaming
Monte Carlo Simulation
Agent-Based simulationSlide4
AGENT-BASED SYSTEMS
Using
NetlogoSlide5
MONTE CARLO SIMULATION
The process is similar to gambling in casinos such as using roulette wheels, dice and playing cards.
Monte Carlo is a technique for selecting numbers randomly from a probability distribution (not necessarily from a standard distribution). Slide6
MONTE CARLO SIMULATION
The computer-generated random numbers are called
pseudo-random numbers
.Slide7
A PSEUDO-RANDOM
NUMBER GENERATOR
FOLLOWING
Uniform Distribution [0,1]
Linear
Congruential
Generator (LCG)
Period=
m–1
x
0
≠0
is the seed number
Example:
a
=13,
b=0, m=31, x0 =8 Hence, u0 =0.2581; x1 =11, u1=0.3548Minimal Standard Random Number Generator: a=75, b=0, m=231–1 (a Mersenne prime)Slide8
EXAMPLE 1A simple example:
DEMAND
RANGE
OF RANDOM NUMBER
Let
r
ϵ
{1,2,…,100}
10
1-20
15
21-50
20
51-100Slide9
Example 1
Run
Random Number
Simulated Demand
1
83
20
2
45
15
3
48
15
4
14
10
5
52
20
6
1
10
7
67
20
8
42
15
9
81
20
10
73
20
11
21
15
12
22
15
13
77
20
14
73
20
15
2
10
Sample Formula:
ROUNDUP(RAND()*100,0)
IF(B2<=20,10,IF(B2<=50,15,20))Slide10
example 1
So the average demand is:
Using simulation (15 runs):
16.333…
Using expected value:
0.2*10+0.3*15+0.5*20=16.5
Notice that Monte Carlo simulation is just a statistical experiment.Slide11
RAND
RAND
RAND
RAND
RAND
ANOTHER EXAMPLE:Slide12
Integration by MC Simulation
Generate
n
random sequence
x
i
є
[
a,b
]
, then for
m
clusters of runs
If you want to consolidate your
m
clusters of runs into just
one
cluster.Slide13
RAND()*5
CLUSTER
RUNS 1
RAND
CLUSTER RUNS 2
RAND
CLUSTER RUNS 3
3.58
12.81
1.22
1.49
4.29
18.37
0.76
0.58
1.12
1.26
1.46
2.12
4.50
20.22
2.68
7.17
4.58
20.93
4.90
24.02
4.74
22.49
0.33
0.11
3.97
15.77
0.26
0.07
3.89
15.11
3.50
12.25
2.04
4.15
0.80
0.64
5.0024.962.255.071.582.492.174.720.080.010.730.532.838.004.6621.753.3110.941.622.624.5420.632.646.95AveSUM(B2:B11)/10*562.98 42.04 39.0948.04Slide14
Integration by MC Simulation
Generate
n
random sequence
x
i
є
[
a,b
]
,
n
random sequence
y
i
є [c,d]
and n random sequence zi
є [e,f] , then for m clusters of runsIf you want to consolidate your m clusters of runs into just one cluster.Slide15
HIT OR MISS MONTE CARLO
Find the AREA of the set of points (
x
,
y
) inside the unit square
x
,
y
ϵ
[0,1] that satisfy:
Area=(length of interval1)x(length of interval2)x(number of hits)/(total count of generated random pairs)
Area≈0.547Slide16
HIT OR MISS MONTE CARLO
Find the VOLUME:Slide17
x
y
z
count
RAND()*2-1
RAND()*2-1
RAND()*2
IF(AND(A3^2+B3^2<=C3^2,A3^2+B3^2+(C3-1)^2<=1),1,0)
0.142973094
-0.166680645
1.407409063
1
-0.783836654
-0.936474685
1.659525168
0
-0.272318721
0.131424335
0.899121291
1
0.309445838
-0.02570091
0.717548985
1
-0.770113876
-0.638294195
0.509448198
0
0.475610449
0.012623621
0.507359561
1
0.644456842
0.19929642
0.36582555
0
-0.04857905
0.476761013
0.167943641
0
-0.222669404
0.803157266
1.339139434
10.987939698-0.6429319760.8362443230-0.115050608-0.1895847460.36176457210.8150996850.7578109530.2435496750-0.045867733-0.6752795040.2710118190 SUM(D3:D502)205 D503/500*83.28Slide18
MONTE CARLO ERROR