Monte Carlo Simulation, named after the casino games of Monte Carlo, Monaco, originates from the research work of Neumann and Ulam in 1949 [29]. Random behavior is found in games of chance such as slots, roulette wheels, and dice.
Monte Carlo Simulation (MCS) is known as a simple random sampling method or statistical trial method that make realizations based on randomly generated sampling sets for uncertain variables. Application of the Monte Carlo method to probabilistic structural analysis problems is comparatively recent, becoming practical only with the advent of digital computers. It is a powerful mathematical tool for determining the approximate probability of a specific event that is the outcome of a series of stochastic processes. The Monte Carlo method consists of
S
digital generation of random variables and functions, statistical analysis of trial outputs, and variable reduction techniques. These are discussed briefly in this section.
The computation procedure of MCS is quite simple:
1) Select a distribution type for the random variable 2) Generate a sampling set from the distribution
3) Conduct simulations using the generated sampling set
(a) Arbitrary Area S (b) 50 Samples, Uniformly Distributed
(c) 50 Samples, Aimed at the Center (d) 500 Samples, Uniformly Distributed Figure 3.6. Example of “Hit or Miss” Method
The example shown in Figure 3.6, slightly modified from Sobol’s book [29], clearly shows the basic idea and the critical aspects of MCS. Simple random sampling is a possible tool to measure the arbitrarily selected area S from the unit square plane (Figure 3.6a). The area can be approximately calculated by the ratio ofm/n where n is the number of sampling points and m is the number of points that
fall inside the area S. The exact area is geometrically calculated as 0.47. The obtained area, determined by using 50 random samples based on uniform distribution, yields 0.42, which means that 21 points appear inside the area S. It is obvious that the distribution type and the boundary limit are decisive parts of the sampling procedure.
When the sampling scheme is aimed at the center of the unit area, a distorted result might be obtained, as shown in Figure 3.6b. In this case, 47 points appear inside, and the ratio 47/50 yields the overestimated area of 0.94. Another important factor in the accuracy of the sampling method is the number of sampling points.
When the number of sampling points is increased to 500 uniformly distributed points, the accurate result of 0.476 is obtained (Figure 3.6d).
The same idea can be extended to the analysis of structural reliability, which was described in Section 3.1. First, the sampling set of the corresponding random variables are generated according to the probability density functions. Next, we set the mathematical model of g(), namely the limit-state, which can determine failures for the drawing samples of the random variables. Then, after conducting simulations using the generated sampling set, we can easily obtain the probabilistic characteristics of the response of the structures. In the above example, “Hit or Miss” of the area S represents the function g(). If the limit-state function g() is violated, the structure or structural element has “failed.” The trial is repeated many times to guarantee convergence of the statistical results. In each trial, sample values can be digitally generated and analyzed. If N trials are conducted, the probability of failure is given approximately by
N
Pf Nf (3.13)
where Nf is the number of trials for which g() is violated out of the N experiments conducted.
Generation of Random Variables
One of the key features in Monte Carlo Sampling is the generation of a series of values of one or more random variables with specified probability distributions.
The most commonly used generation method is the inverse transform method. Let )
( i
X x
F be the CDF of random variable xi. By definition, the numerical value of )
( i
X x
F is a value in the interval of [0,1]. Assuming that vi is the generated uniformly distributed random number (0dvid1), the inverse transform method is used to equate vi to FX(xi) as follows:
FX(xi) vi or xi FX1(vi) (3.14)
Figure 3.7. Inverse CDF Method for Exponential Distribution
This method can be applied to variables for which a cumulative distribution function has been obtained from direct observation, or where an analytic expression for the inverse cumulative function, F1(.) , exists. The inverse transform technique is graphically summarized in Figure 3.7. The random number generator produces uniform random numbers between 0 and 1 based on arbitrarily selected seed values. From the generated uniform random number, the corresponding CDF value of the uniform distribution and target distribution can easily be obtained. The final step is to obtain the random number for the target PDF using Equation 3.14.
Example 3.2
Generate exponential random variables whose PDF and CDF are given in Section 2.1.2 (Equation 2.67 and 2.68), and sketch the probability density function or histogram by using the Equation obtained.
U x
xi
ui
fX(x)
x U
fU(x)
FU(x) FX(x)
Solution:
Figure 3.8. Exponential Distribution (Example 3.2)
The probability density function (Equation 2.67) of the exponential distribution is
) 0 ( ] exp[
)
(x x x !
fX O O The cumulative distribution function (Equation 2.68) is
] exp[
1 )
(x x
FX O
Letvi be the random numbers from uniform distribution over the interval [0,1].
From Equation 3.14
i i
X x v
F ( ) ẻ 1 exp[ Oxi] vi Solve for xi
) 1 1 ln(
i
i v
x
O
Hence, for any vi, the exponential random variables can be generated with the above equation. The corresponding sketch of the histogram (Figure 3.8) is obtained after generating 10,000 samples of vi with O 1.
0 1 2 3 4 5 6 7 8 9 10
0 500 1000 1500 2000 2500 3000 3500 4000
x
Frequency
Calculation of the Probability of Failure
Equation 3.13 gives the simplest Monte Carlo approach for reliability problems; it may be the most widely used, but it is not the most efficient, especially in complex systems. As defined in Section 3.1, failure occurs when the limit-state g(X)d0, and the failure probability
³ ³
d
d
0 ) (
) ( ...
] 0 ) ( [
X g
X
f P g X f X dX
P (3.15)
is written as
Pf ³ ³... I[X]fX(X)dX (3.16)
where I[X] is an indicator function, which equals 1 if [g(X)d0] is “true” and 0 if [g(X)d0] is “false.” It can be seen that the expectation of the indicator random variable for the failure event is just the probability that failure occurs. Hence, Pf P[g(X)d0] E[I(X)] PI PPf (3.17) and its variance is
Var[I(X)] E[I(X)2]{E[I(X)]}2 (3.18) E[I(X) ]{E[I(X)]}2
E[I(X) ]{1E[I(X)]} Pf(1Pf)
In order to evaluate Pf by the Monte Carlo method, a sample value for basic variable xi with a cumulative distribution Fx(xi) must be drawn. The inverse transform method can be used to obtain the random variate, in which a uniformly distributed random number ui(0duid1) is generated and equated to Fx(xi),i.e.,
)
1 (
x i
i F u
x .
Hence, independent random numbers u1,u2,...,un are drawn from the density )
( i
x x
f , and the estimate of Pf is obtained:
¦n
i i
f I u
P n
ˆ
1
) 1 (
ˆ (3.19)
where Pˆ represents the Monte Carlo estimator of f PPfand nˆ is the number of independent random numbers.
The variance of the sample mean is computed as
2
2
) ˆ
(ˆf I Pf P n
Var V V
(3.20) So the sample variance is given as
¦ ¦n
i i n
i i
I I u
n n u n I
S
ˆ
1 2 ˆ
1 2
2 ( )] }
ˆ [1 ) ˆ ( 1{ ˆ
1 (3.21)
In principle, the Monte Carlo simulation is only worth exploiting when the number of trials of simulation is less than the number of integration points required in numerical integration. This is achieved for higher dimensions by replacing the systematic selection of points by a random selection, under the assumption that the options selected will be in some way unbiased in their representation of the function being integrated. To produce defensible results for a case with a large number of random variables, a large number of sampling sets is required. Thus, there are limitations to obtaining high accuracy for large-scale problems, which require tremendous computational time and effort. To improve the rate of convergence, several modifications can be introduced to MCS using quasi-random points [31]. The next two sections describe well-known approaches in variance reduction methods.
Example 3.3
Estimate the safety index E of Example 3.1 by using the MCS method with the same limit-state function, mean values, standard deviations, and distributions of the random variables.
Solution:
No. of Simulations 1,000 10,000 50,000 100,000200,000500,0001,000,0002,000,000 E 3.0902 2.9290 2.8228 2.8175 2.8574 2.8642 2.8507 2.8499 Pf 0.001 0.00170.002380.002420.002140.00209 0.002181 0.002187 As shown in the table, the MCS results (using MATLAB®) are converged to three digits after 200,000 runs (E 2.85,Pf 0.0021).
Example 3.4
Find solutions of x1 and x2 for the following problem by using a sampling method.
Minimize f x122x224x1x28 subject to x12x2900d0
0
2 1000
1x d
x 999
0 , 999
0dx1d dx2 d
Hint:x1 and x2 are uniformly distributed in the interval [0, 999]
Solution:
This problem is called a constrained nonlinear optimization problem. Although efficient numerical methods exist, i.e., Sequential Quadratic Programming (SQP), to solve these kinds of problems, we are obtaining the solution by using a sampling method. The basic strategy is very simple: Check all possible combinations of x1 and x2 with corresponding f values. Then, we seek a minimum value of f and a corresponding sampling set of x1 and x2. If the sampling set satisfies the given constraints, the data set is our solution.
Accordingly, the procedure requires large simulation numbers to obtain accurate results through numerical simulation tools. The following solutions are obtained by using the MCS and SQP methods in MATLAB®:
(a) MCS Results No. of
Simula-
tions 10,000 20,000 50,000 100,000 200,000 500,000 1,000,000 2,000,000 x1 32.63 39.00 34.91 36.51 36.91 36.89 36.98 38.11 x2 28.65 21.71 27.40 27.05 25.82 26.97 27.01 26.21 f -1025.08 -915.22 -1098.19 -1145.89 -1108.14 -1155.95 -1160.90 -1161.30 (b) SQP result with 11 iterations of optimization
x1 = 37.61, x2 = 26.59, and f = -1163.57
As shown in the MCS result of Example 3.4, the number of simulations required to provide optimum designs similar to the SQP result is quite large. But the SQP also has drawbacks; for instance, inappropriate initial points may result in local optima.