Академический Документы
Профессиональный Документы
Культура Документы
What.....................................................................................................................................................2
Some examples...........................................................................................................................2
Example 1: estimate using Monte Carlo method............................................................2
Example 2: Finding global minimum of a function using Simulated annealing...............3
Example 3: improve a real product with simulated data...................................................3
Why......................................................................................................................................................4
Why Monte Carlo is used for optimization.................................................................................4
Why Monte Carlo is used for numerical integration...................................................................5
Why Monte Carlo is used for improving real products...............................................................6
How......................................................................................................................................................6
How to measure the Pi number using Monte Carlo....................................................................6
How to find global minimum using Monte Carlo.......................................................................7
How to reduce defects using Monte Carlo..................................................................................7
What do we need to perform Monte Carlo method..............................................................................8
Random number generators........................................................................................................8
Middle-square method.......................................................................................................8
Simple Linear Congruential Generators [7]......................................................................8
Software for Random Number Generation.................................................................................9
Some hand-on examples.......................................................................................................................9
On matlab....................................................................................................................................9
Calculate Pi number...........................................................................................................9
Rolling three dice.............................................................................................................10
Application of Monte Carlo on Geophysics.......................................................................................11
Geostatistical Reservoir Modeling............................................................................................11
Geophysical softwares using Monte Carlo.........................................................................................13
Petrel Platform's uncertainty and optimization.........................................................................13
References..........................................................................................................................................14
What
Monte Carlo simulation is the use of experiments with random numbers to evaluate mathematical
expression [7]. They are often used in physical and mathematical problems and are most
useful when it is difficult or impossible to use other mathematical methods. Monte Carlo
methods are mainly used in three distinct problem classes [1]:
+ optimization.
+ numerical integration.
+ simulating systems with many coupled degrees of freedom, such as fluids, disordered
materials, strongly coupled solids, and cellular structures.
+ modeling phenomena with significant uncertainty in inputs such as the calculation of risk
in business.
+ Inverse problems.
The idea of Monte Carlo calculation is a lot older than the computer. The name Monte Carlo is
relatively recentit was coined by Nicolas Metropolis in 1949but under the older name of
statistical sampling the method has a history stretching back well into the last century,when
numerical calculations were performed by hand using pencil and paper [4]. In the very first
applications, it used to calculate Pi number , calculating integrals.
Some examples
Example 1: estimate using Monte Carlo method
Consider a circle inscribed in a unit square. Given that the circle and the square have a ratio of
areas that is /4, the value of can be approximated using a Monte Carlo method [1]:
1.
2.
3.
4.
Illustration 1: Estimating Pi
using Monte Carlo method.
With this type of linear model, you can enter the process input values into the equation and predict
the process output. However, in the real world, the input values wont be a single value thanks to
variability. Unfortunately, this input variability causes variability and defects in the output.
To design a better process, you could collect a mountain of data in order to determine how input
variability relates to output variability under a variety of conditions. However, if you understand the
typical distribution of the input values and you have an equation that models the process, you can
easily generate a vast amount of simulated input values and enter them into the process equation
to produce a simulated distribution of the process outputs.
You can also easily change these input distributions to answer "what if" types of questions. That's
what Monte Carlo simulation is all about. In the example we are about to work through, we'll
change both the mean and standard deviation of the simulated data to improve the quality
of a product [5].
Today, simulated data is routinely used in situations where resources are limited or gathering real
data would be too expensive or impractical.
This process can help to:
Simulate product results while accounting for the variability in the inputs
In a nutshell, Monte Carlo methods (or Monte Carlo experiments) are a broad class of
computational algorithms that rely on repeated random sampling to obtain numerical
results. Monte Carlo method is used widely in many fields, above examples are just to name
some.
Why
Why Monte Carlo is used for optimization
Optimization is a process to find a good solution, it is even a maximum or a minimum of a function.
Simulated annealing (SA) is a probabilistic technique for approximating the global optimum of a
given function [2]. If global mininum is less imporant than a local minimum then we can use
Steepest descent, gradient descent. But for a function with many local minimum, Steepest descent
and gradient descent will fail to find a global minimum/maximum and would rather be stuck at a
local instead.
Mathematical approaches like gradient descent or steepest descent are only suitable for
find a local minimum/maximum or global minimum of a very simple function having only
one minimum or maximum.
The fast fluctuation near the origin makes it very difficult to solve this analytically. Monte Carlo is
used to solve this problem [4].
How
How to measure the Pi number using Monte Carlo
Taking the example as in What section:
Basing on the theory of probability, one can calculate the probability that a random grain falling into
the red section equals to the area of red section over the whole square section: pi/4.
By using the law of large number, when you repeat the action of dropping grains onto this square
and the number of repetition, N, is large enough. The fraction of number of grains fall onto red
section, n, and N will tend to converge to pi/4.
and
of the two states, and on a global time-varying parameter T called
the temperature. States with a smaller energy are better than those with a greater energy. The
probability function P must be positive even when e' is greater than e. This feature prevents the
method from becoming stuck at a local minimum that is worse than the global one.
When T tends to zero, the probability
must tend to zero if e'>e and to a positive value
otherwise. For sufficiently small values of T, the system will then increasingly favor moves that go
"downhill" (i.e., to lower energy values), and avoid those that go "uphill." With T=0 the procedure
reduces to the greedy algorithm, which makes only the downhill transitions.
In the original description of SA, the probability
was equal to 1 when e'<e i.e., the
procedure always moved downhill when it found a way to do so, irrespective of the temperature.
Many descriptions and implementations of SA still take this condition as part of the method's
definition. However, this condition is not essential for the method to work.
The P function is usually chosen so that the probability of accepting a move decreases when the
difference (e'-e) increasesthat is, small uphill moves are more likely than large ones. However,
this requirement is not strictly necessary, provided that the above requirements are met.
Given these properties, the temperature T plays a crucial role in controlling the evolution of the
state s of the system with regard to its sensitivity to the variations of system energies. To be
precise, for a large T, the evolution of s is sensitive to coarser energy variations, while it is sensitive
to finer energy variations when T is small.
This scheme make Simulated Annealing method get out of local minimum since it still gives a
chance to change to a state having a bigger energy.
In a nutshell, Monte Carlo uses Law of large number, table list of random number or pseurandom numbers to mimic the random of nature and to simulate nature.
a is call the multiplier, c is called the increment, and m is called the modulus of the generator.
Often, c in equation above is taken to be 0, and, in this case, the generator is called a
multiplicative congruential generator:
For c not equal to 0, the generator is sometimes called a mixed congruential generator. The seed
for this generator is just the single starting value in the recursion, x0. A sequence resulting from the
recursion above called a Lehmaer sequence. Each xi is scaled into the unit interval (0,1) by
division by m, that is,
If a and m are properly chosen, the ui will look like they are randomly and uniformly distributed
between 0 and 1.
NInside = 0;
for nloops=1:Nrand
Xrand = rand;
% Generate Random XY Point
Yrand = rand;
Rrand = Xrand^2 + Yrand^2; % Find its distance from origin
if (Rrand <= 1)
NInside = NInside + 1;
end
end
disp(['Total Generated: ' num2str(Nrand) ' Inside Pts: ' ...
num2str(NInside)]);
piapprox = 4*NInside/Nrand;
disp([' Approximation to pi = ' num2str(piapprox)]);
porosity.
* Seismic-derive structural interpretation, that is, surface grids and fault locations that define largescale reservoir geometry.
* Well test and production data yield interpreted permeability thickness, channel widths, connected
flow paths and barriers. The use of inversion methods provide coarse scale porosity and
permeability models with and associated measure of uncertainty.
There is uncertainties on all these input values and all uncertainties can be modeled using Monte
Carlo method. Moreover, there are maybe conflicts of information from these inputs. For examples,
Core data maybe conflict with well data on permeability since there are some structures of high
permeability like faults.
References
[1] Monte Carlo method: https://en.wikipedia.org/wiki/Monte_Carlo_method.
[2] Simulated annealing: https://en.wikipedia.org/wiki/Simulated_annealing.
[3] Gradient descent: https://en.wikipedia.org/wiki/Gradient_descent.
[4] M. E. J. Newman and G.T. Barkema (1999), Monte Carlo Methods in Statistical Physics.
[5] http://blog.minitab.com/blog/adventures-in-statistics/understanding-monte-carlo-simulation-withan-example.
[6] Middle-square method https://en.wikipedia.org/wiki/Middle-square_method.
[7] James E. Gentle (2003), Random number generation and Monte Carlo method.
[8] Guide to Available Mathematical Software (GAMS), http://gams.nist.gov.
[9] Introduction to Monte Carlo
Simulation,http://physics.gac.edu/~huber/envision/instruct/montecar.htm.
[10] Monte Carlo Simulation and Matlab.
[11] Geostatistical reservoir modeling, http://petrowiki.org/Geostatistical_reservoir_modeling.
[12] Clayton V. Deutsch, Geostatistical Reservoir Modeling.
[13] Petrel Reservoir Geo-mechanics documentation.