Vous êtes sur la page 1sur 116

Warning

This document is the property of United Technologies Corporation (UTC). You may not possess, use, copy or
disclose this document or any information in it, for any purpose without UTC's express written permission.
Neither receipt nor possession of this document alone, from any source, constitutes such permission.
Possession, use, copying or disclosure by anyone without UTC's express written
permission is not authorized and may result in criminal and/or civil liability.

Introduction to
MONTE CARLO
Simulation

Jim Breneman
P&W Fellow, Reliability & Statistics
Export controlled Material March 14, 2007
Unpublished Work - © United Technologies Corporation 2006
Introduction to Monte Carlo Simulation … outline

• Background
• Definition & history of Monte Carlo
Simulation
• Fundamentals of using EXCEL™ for
Monte Carlo simulation
• In-class examples
• Buffon needle problem
• Tolerancing using Monte Carlo Simulation
• Calculating Load
• Monte Carlo simulation of fleet reliability

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
2 of 116
Unpublished Work - © United Technologies Corporation 2007
Simulation

Simulation is a modeling technique in which the cause-


and-effect relationships of a system are captured in a
computer model, which then becomes capable of
generating the same behavior that would occur in the
actual system.

Simulation is a powerful analysis tool that helps make


intelligent and timely decisions in the design and
operation of a system.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
3 of 116
Unpublished Work - © United Technologies Corporation 2007
Simulation History (Continued)

• Increased awareness & understanding of technology.


• Increased availability, capability & ease-of-use of
simulation software.
• Increased computer memory
and processing speeds.
• Declining computer
hardware costs.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
4 of 116
Unpublished Work - © United Technologies Corporation 2007
The Cliff-hanger..what’s his chance of surviving

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
5 of 116
Unpublished Work - © United Technologies Corporation 2007
Monte Carlo Simulation Uses

• Manufacturing systems:
The possible permutations and combinations of
workpieces, tools, pallets, transport vehicles, routes,
operations.
• Service systems:
The complexities of customer scheduling, staffing,
resource management, customer flow, and info
processing.
• Design systems:
Variation in stresses, temperatures, mission,
tolerances, flow, pressure drop, material properties.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
6 of 116
Unpublished Work - © United Technologies Corporation 2007
Objective

• Apply the basics of Monte Carlo simulation in EXCEL to solve simple


simulation problems.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
7 of 116
Unpublished Work - © United Technologies Corporation 2007
Detailed Learning Objectives

The objective of this class is to introduce the Monte Carlo simulation concept, to learn how
to use Monte Carlo simulation in EXCEL, and to learn how to use the results to answer
various engineering questions.

This “Introduction to Monte Carlo” simulation class is ~3 hours in length and has the
following major learning objectives:

1. Understanding Monte Carlo simulation and its uses.


2. How to generate random numbers in EXCEL.
3. How to generate a flow chart for a typical Monte Carlo simulation.
4. Using EXCEL software; how to build a simple Monte Carlo simulation.
5. Introduction to Monte Carlo Simulation with Crystal Ball™

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
8 of 116
Unpublished Work - © United Technologies Corporation 2007
Example of Monte Carlo simulation link to Standard Work

SDCI/RMS:DP-IN: 97-211

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
9 of 116
Unpublished Work - © United Technologies Corporation 2007
History of Monte Carlo simulation

• Monte Carlo Simulation is a method that has many


applications and flavors.
• “simulation” refers to the fact that we build an artificial model
of a real system in order to study and understand the
system.
• The “Monte Carlo” part of the name alludes to the
randomness inherent in the analysis.
• The name “Monte Carlo” was coined by [physicist
Nicholas] Metropolis (inspired by [Stanislaw] Ulam's
interest in poker) during the Manhattan Project of
World War II, because of the similarity of statistical
simulation to games of chance, and because the
capital of Monaco was a center for gambling and
similar pursuits

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
10 of 116
Unpublished Work - © United Technologies Corporation 2007
Why the name Monte Carlo ?

• Consider the fact that the random nature of a game


of chance is designed so that the owners of a casino
can be assured (in the long run) they will make a
profit, while the gambler has a reasonable chance of
winning.
• The random nature of Monte Carlo simulation is
designed so that the statistician can be assured that
in the long run the simulation will approach
equilibrium values, while an individual move has a
realistic chance of taking the simulation away from
equilibrium.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
11 of 116
Unpublished Work - © United Technologies Corporation 2007
Monte Carlo Simulation...Definition

• A simple, fast, intriguing, educational method for


solving stochastic (random) system problems.

• Application: Any system or situation with some random


variables, i.e. production lines, tolerancing, instrumentation
data handling, test schedules, bus schedules, trimming
controls, waiting lines, etc.

• The more variables, the more randomness, the better


it works.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
12 of 116
Unpublished Work - © United Technologies Corporation 2007
Random Numbers

* Sources: Telephone numbers,


Dice,
RAND tables,
Computer programs

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
13 of 116
Unpublished Work - © United Technologies Corporation 2007
Summarizing so far………

• The Monte Carlo method provides approximate


solutions to a variety of mathematical problems
by performing statistical sampling experiments on
a computer.
• The method applies to problems with no
probabilistic content as well as to those with
inherent probabilistic structure.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
14 of 116
Unpublished Work - © United Technologies Corporation 2007
Two types of Monte Carlo Simulation

• Discrete Event simulation - models systems


that change at discrete points in time as a
result of specific events. (e.g. manufacturing
systems, service systems ...barber shops,
banks, cafeterias)
• Continuous simulation - models systems
whose state changes continuously with time
(e.g. LCF, HCF, Stress-rupture, systems of
ODE’s or PDE’s)

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
15 of 116
Unpublished Work - © United Technologies Corporation 2007
Major Components of a Monte Carlo Simulation

• Probability Density Functions


• Random number generator(s)
• Sampling rule - a prescription for sampling from the specified
pdf’s.
• Description of interrelationships of variables.(usually through
use of the engineering model)
• Scoring (tallying)
• Error estimation - an estimate of the statistical error(variance) as
a function of the number of trials and other quantities.
• Lots of graphs!!!

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
16 of 116
Unpublished Work - © United Technologies Corporation 2007
How to build a simulator

• Obtain or assume probability distributions

• Program model or computer with random numbers

• Exercise model for 10,000 or 100,000 trials.

• Compare statistical output with reality...ask an expert!!

• Modify model for new change

• Exercise the model.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
17 of 116
Unpublished Work - © United Technologies Corporation 2007
Transforming Random Numbers to Random
Variables

• The inverse method is used to generate


random variates from any distribution
or histogram.

Uniform (0,1)
random number

Weibull, Normal, etc. random


variate Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
18 of 116
Unpublished Work - © United Technologies Corporation 2007
Generating Pseudo-random Numbers

• One common technique is an iterative technique given


by:
xi+1= [a(xi) + c] (Mod b). i=1,2,...,b
where: xi is the ith pseudo-random number in the
sequence,
xi+1 is the next pseudo-random number
a and b are constants of the form (2m+1) and 2n
c is unity or an odd positive prime number
m and n are positive integers
Mod b means that the quantity in brackets is divided by b
and the remainder is taken for the next value of x.
e.g. [11] (Mod 3)=2

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
19 of 116
Unpublished Work - © United Technologies Corporation 2007
Generating Pseudo-random Numbers

• Let m=17, n=33, and c=1; then


xi+1= [a(xi) + c] (Mod b)
=[(217+1) xi +1] [Mod 233], i=1,2,...,233
This process generates a total of 233=8,589,934,592
different numbers.
• To obtain random numbers in the range 0 ≤ yi < 1,
each number generated is normalized by dividing by
233

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
20 of 116
Unpublished Work - © United Technologies Corporation 2007
What makes random numbers random?

• The values of yi should be uniformly


distributed over the interval [0,1).
• Successive values of yi should be
independent.
• No unusual runs up or down.
• Frequency tests
• Poker test
• Gap test
• k’th random number tested with all of the
above Introduction to Monte Carlo Simulation
Jim Breneman
860-565-3959
21 of 116
Unpublished Work - © United Technologies Corporation 2007
Generating Uniform Random Numbers
Most simulation studies involve the generation of random numbers
from a uniform distribution (i.e. where all numbers are
distributed evenly between 0 and 1.
Some methods for doing this is:
1. In EXCEL, use the function rand()
2. In FORTRAN use Ran1, Ran2, Ran3, or gasdev
3. Same routines in C.
Or, if you are stuck on a desert island:
Initialize ISEED, the random number seed (should be a large,
positive, odd integer)... Then each successive random number is:
ISEED=ISEED * 65549
P=0.5 +REAL(ISEED)* 0.2328306E-9

The values of P are uniformly distributed between 0 and 1.


NOTE: This procedure can be used on a system where the largest
integer allowable is 231-1.
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
22 of 116
Unpublished Work - © United Technologies Corporation 2007
Comments on RAND()

• The RAND function in versions of Excel <2003 used a pseudo-random number


generation algorithm whose performance on standard tests of randomness(see
http://www.csis.hku.hk/~diehard) was miserable. Luckily it only affected users
who made a large number of calls to RAND, such as a million or more.
• The following pseudo-random number generation algorithm was first
implemented for Excel 2003. It passes these same tests of randomness with
flying colors. The algorithm was developed by B.A. Wichman and I.D. Hill*.

The basic idea is that if you take three random numbers on [0,1] and sum them, the fractional part of the sum is itself a random number

on [0,1]. The statements in the Fortran code listing from the original Wichman and Hill article are:
C IX, IY, IZ SHOULD BE SET TO INTEGER VALUES BETWEEN 1 AND 30000 BEFORE FIRST ENTRY

IX = MOD(171 * IX, 30269)

IY = MOD(172 * IY, 30307)

IZ = MOD(170 * IZ, 30323)

RANDOM = AMOD(FLOAT(IX) / 30269.0 + FLOAT(IY) / 30307.0 + FLOAT(IZ) / 30323.0, 1.0)

*Wichman, B.A. and I.D. Hill, Algorithm AS 183: An Efficient and Portable Pseudo-Random Number Generator, Applied Statistics, 31, 188-190, 1982.
Cycle =10^13
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
23 of 116
Unpublished Work - © United Technologies Corporation 2007
Results of Uniform Random Number Generator

Histogram Uniform Random Numbers


120
100
frequency

80
60
40
20
0
0 0.2 0.4 0.6 0.8 1
Uniform Random Numbers

A statistical “Goodness-of-fit” test shows that these 1000 random


numbers are probably Uniform

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
24 of 116
Unpublished Work - © United Technologies Corporation 2007
The CDF Method...Weibull case

Recall that F(x) is the CDF (cumulative Distribution Function) of a


statistical distribution.
If F(x)=p, solve for x in terms of p and generate uniform (0,1) values
for
p and calculate x.
For example, the Weibull CDF is given by:
− (x /η )β
p = F (x ) = 1 − e
solving for x in terms of p:
1 1/ β
x = η (ln )
1− p

If p is a uniform (0,1) random number, then x is a random number


from a Weibull (β,η) distribution.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
25 of 116
Unpublished Work - © United Technologies Corporation 2007
The CDF Method...Normal case

While the Weibull CDF is invertible, the Normal CDF is not, so a rational
polynomial approximation can be used to convert uniform random
deviates to normal random deviates.
(Typical of what software packages use)

z=t-(2.515517+.802853*t+.010328*t^2)/
(1+1.432788*t+.189269*t^2+.001308*t^3)
where t=sqrt(ln(1/p^2)), where p is the uniform random deviate.
z is the standard deviation units from the mean (in standardized normal
units). To convert this to a random normal variate x with mean
µ and standard deviation σ, remember that z=(x-µ)/σ, so
x=z*σ+µ.

But, there are many other ways to generate normal random deviates.
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
26 of 116
Unpublished Work - © United Technologies Corporation 2007
Random Number Generation in Excel

• =RAND() returns a uniform random number between 0 and 1.


• Can be transformed to generate numbers for other intervals:
• =10*RAND() generates a random number between 0 and 10
• =5+2*RAND() generates a random number between 5 and 7
• =x+(y-x)*RAND() generates a random number between x and y
(All numbers in these examples are, of course, equally likely)
• =NORMINV(RAND(),x,y) returns a random variable that is normally
distributed with mean x and standard deviation y.
• =LOGINV(RAND(),log_µ,log_σ) returns a random variable that is
lognormally distributed with mean log_µ, standard deviation log_σ.
• =η*(LN(1./(1-RAND()))^(1/β)) returns a Weibull random number
with slope β and characteristic life η.
• =IF(RND<(MO-LO)/(HI-LO),LO+SQRT((MO-LO)*(HI-LO)*RND),HI-
SQRT((HI-MO)*(HI-LO)*(1-RND))) gives a triangular distribution,
where HI is rightmost point of the triangle, LO is the leftmost
point, and MO is the modal or topmost point.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
27 of 116
Unpublished Work - © United Technologies Corporation 2007
Examples of random number generation in EXCEL

Normal Distribution: Mean 10, Std Dev 2. Lognormal: Log mean=2,Log Std Dev=.3
200 160
160
frequency

120

frequency
120
80
80

40 40

0 0
0 3 6 9 12 15 18 0 3 6 9 12 15 18
Value Value

Weibull: Beta=3, Eta=1000 Triangular:


Histogram ofLO=2, MO=3,
Triangular HI=5
Distribution
120
100
100
80
frequency

frequency
80
60
60
40 40

20 20

0 0
0 0.4 0.8 1.2 1.6 2 2 2.5 3 3.5 4 4.5 5
(X 1000)
Value Value

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
28 of 116
Unpublished Work - © United Technologies Corporation 2007
EXCEL

Generating Random numbers in EXCEL

• Generate the sum of the four random


variables:
• A=Normal(100,10)
• B=Weibull(3.,120.)
• C=Uniform(50,100)
• D=Triangular(25,50,100)

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
29 of 116
Unpublished Work - © United Technologies Corporation 2007
Buffon’s Needle Problem

1707-1788
• Buffon's Needle is one of the oldest problems
in the field of geometrical probability. It was
first stated in 1777. It involves dropping a
needle on a lined sheet of paper and
determining the probability of the needle
crossing one of the lines on the page. The
remarkable result is that the probability is
directly related to the value of pi.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
30 of 116
Unpublished Work - © United Technologies Corporation 2007
Buffon Needle… simplest case

• In this case, the length of the needle is one unit and the distance
between the lines is also one unit. There are two variables, the angle at
which the needle falls (theta) and the distance from the center of the
needle to the closest line (D). Theta can vary from 0 to 180 degrees
and is measured against a line parallel to the lines on the paper. The
distance from the center to the closest line can never be more that half
the distance between the lines.

• The needle in the picture misses the line. The needle will hit the line if
the closest distance to a line (D) is less than or equal to 1/2 times the
sine of theta. That is, D ≤ (1/2)sin(theta). How often will this occur? Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
31 of 116
Unpublished Work - © United Technologies Corporation 2007
Buffon Needle… simplest case

• Plot Distance D vs (1/2)sine(theta). The values on or below the curve


represent a hit (D <= (1/2)sin(theta)). Thus, the probability of a success is the
ratio of the shaded area to the entire rectangle. What is this value?

• The shaded portion is found by using the definite integral of (1/2)sin(theta)


evaluated from zero to pi. The result is that the shaded portion has a value of
1. The value of the entire rectangle is (1/2)(pi) or pi/2. So, the probability of a
hit is 1/(pi/2) or 2/pi. That's approximately .6366197.
• To calculate pi from the needle drops, simply take the number of drops and
multiply it by two, then divide by the number of hits, or
2(total drops)/(number of hits) = pi (approximately).
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
32 of 116
Unpublished Work - © United Technologies Corporation 2007
EXCEL
Buffon needle simulation outline using EXCEL™

1. Generate a random angle θ (0 το 180°)


2. Generate a random distance D between 0 and
1.Divide by 2.
3. Generate the distance to the line, dist as
(1/2)sin(θ). Remember, θ should be in radians.
4. Is D£ (1/2)sin(θ)? If it is, call it a “hit.”
5. Repeat 1-4 1,000 times
6. Calculate PI=(Number iterations*2/Number of hits)
7. Using EXCEL, build this simulator.
8. Increase the iterations to 5,000, 10,000. How much
better do your estimates of PI get?
9. Do multiple runs and average your results. Better
estimates?
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
33 of 116
Unpublished Work - © United Technologies Corporation 2007
Example: generate discrete r.v.

• Suppose monthly demand follows the


following distribution (pmf)
Demand (x) p(x)
5 0.10
20 0.40
30 0.30
50 0.20
We want to generate 12 random demands
(may be for next 12 months). How?
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
34 of 116
Unpublished Work - © United Technologies Corporation 2007
Example: generate discrete random variable(r.v.)
Demand (x) p(x) F(x)
5 0.1 0.1
Step 1: Find CDF 20 0.4 0.5
30 0.3 0.8
50 0.2 1

F(x)

0.8

Step 2: Generate
random number, u 0.5

0.1

Step 3: Locate 0 x
5 20 30 50
r.v. x

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
35 of 116
Unpublished Work - © United Technologies Corporation 2007
Example: generate discrete random variable(r.v.)

• The Inverse Transformation Method (Steps 2 &


3) Essentially Establishes a Relationship
between Random Number Range and
Corresponding Demand

Demand 5 20 30 50

Rand # 0 0.1 0.5 0.8 1

• What is the probability that a random number will be


in range [0, 0.1], [0.1, 0.5], [0.5, 0.8], or [0.8, 1]?

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
36 of 116
Unpublished Work - © United Technologies Corporation 2007
Random number range Demand (x)
0 - 0.1 5
0.1 - 0.5 20
0.5 - 0.8 30
0.8 - 1.0 50
Replication Random numbers Demand
1 0.76269 30
2 0.93813 50
3 0.57897 30
4 0.25200 20
5 0.14009 20
6 0.98889 50
7 0.07436 5
8 0.47831 20
9 0.66928 30
10 0.19625 20
11 0.55519 30
12 0.45593 20 Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
37 of 116
Unpublished Work - © United Technologies Corporation 2007
Generating Discrete r.v. in Excel

• First, find cumulative distribution of the r.v.


• Second, generate random numbers by
“RAND()”
• Finally, use VLOOKUP function

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
38 of 116
Unpublished Work - © United Technologies Corporation 2007
EXCEL
Generating Discrete r.v. in Excel
2
3 Random number range Demand
4 0 0.1 5
5 0.1 0.5 20
6 0.5 0.8 30
7 0.8 1 50
8
9 Random number Outcome
10 0.474424547 20 The range A4:C7 has Values
11 0.713128343 30 needed
12 0.844783096 50
13 0.826109451 50
14 0.432246824 20
15 0.307382727 20
16 0.01709212 5
17
18

A B C D E F G
9 Random number Outcome
The second column in the Table range
10 =RAND() =VLOOKUP(A10,A4:C7,3) (A4:C7) is not necessary. Without it
11 =RAND() =VLOOKUP(A10,A4:C7,3) (only two columns in the TABLE
12 =RAND() =VLOOKUP(A10,A4:C7,3) range), the VLOOKUP function will be
13 =RAND() =VLOOKUP(A10,A4:C7,3) VLOOKUP(A10,A4:B7,2)
14 =RAND() =VLOOKUP(A10,A4:C7,3)
15 =RAND() =VLOOKUP(A10,A4:C7,3)
16 =RAND() =VLOOKUP(A10,A4:C7,3) Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
39 of 116 17 Unpublished Work - © United Technologies Corporation 2007
Comparison of Analytical vs Monte Carlo Modeling

Analytical Monte Carlo


a. Gives exact results (given a. Very flexible. There is
the assumptions of the model). virtually no limit to the type of
b. Once the model is analyses. Empirical
developed, output is rapidly distributions can be used.
obtained. b. Can be easily extended and
Advantages c. It need not always be developed as required.
implemented on a computer, c. Easily understood by non-
paper analyses may suffice. mathematicians

a. Generally requires a. Calculations can take longer


restrictive assumptions to than analytical models.
make problem tractable. b. Solutions are not exact but
b. Because of a. it is less depend on the number of
flexible than Monte Carlo. repeated runs used to produce
Disadvantages c. Model may only be the output statistics; that is, all
understood by outputs are ‘estimates.’
mathematicians. This may
cause credibility problems if
output conflicts with
preconceived ideas of
designers and management.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
40 of 116
Unpublished Work - © United Technologies Corporation 2007
One More Thing: Simulation vs Optimization

• In an optimization model, the decision


variables are outputs.
• The model produces the values for the decision
variables that optimize the objective function.
• In Monte Carlo simulation, the decision
variables are inputs.
• The model uses the values that we provide for
the decision variable to compute the Objective
Function.
• Objective function is output !

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
41 of 116
Unpublished Work - © United Technologies Corporation 2007
Monte Carlo in-class work

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
42 of 116
Unpublished Work - © United Technologies Corporation 2007
Monte Carlo Tolerancing

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
43 of 116
Unpublished Work - © United Technologies Corporation 2007
Three kinds of Tolerancing

• Worst case-- use the worst side of each dimension in


a tolerance stack
• Ideal case-- sometimes called RMS or RSS method,
assume each dimensional tolerance is + or - 2σ(or
3σ), then calculate the overall tolerance of the dimensional
stack as:
Overall tolerance = ( x1 ) 2 + ( x2 ) 2 + ... + ( xn ) 2
• Realistic case -- each dimension has its own distribution,
normal, log-normal, uniform, triangular, etc….. Must use
Monte Carlo simulation to solve this case.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
44 of 116
Unpublished Work - © United Technologies Corporation 2007
Tolerancing using Monte Carlo Simulation

• TF30 9th Compressor Disk: minimum thread engagement


of TF30-P100 9th stage LPC tierod & nut.

X2

X5
X4 Blueprint dimensions:
X1 Spacer .095”-.105”
X2 Disk .179”-.183”
X3 Key washer .027”-.0295”
X4 Tierod .345”-.375”
X1 X5 Tierod nut .050”-.070”

X3
Interference occurs when X1+X2+X3-X4+X5<0
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
45 of 116
Unpublished Work - © United Technologies Corporation 2007
Options for Tolerancing

• Assume that the dimensions are either


1. “Worst case”
2. normally distributed and that the blueprint limits are the
upper and lower 3σ bounds.
3. uniformly distributed and that the blueprint limits are the
upper and lower bounds.
Or,
Use more realistic distributions that estimate the individual
tolerances, based on prior knowledge.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
46 of 116
Unpublished Work - © United Technologies Corporation 2007
Case 1:Tolerancing using “Worst Case”

The probability of interference is the probability that


X1+X2+X3-X4+X5<0

PART Limits Average “Worst Case”


Spacer(X1) .095-.105 .100 .095

Disk(X2) .179-.183 .181 .179

Key Washer(X3) .027-.0295 .02825 .027

Tierod(X4) .345-.375 .36 .375

Tierod nut(X5) .050-.070 .06 .050`

Nominally, we have a 0.3696”-0.36”=.00925” clearance


But, worst case gives us an interference of 0.024”
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
47 of 116
Unpublished Work - © United Technologies Corporation 2007
Case 2:Tolerancing using RSS or RMS method

To calculate the tolerance set


Overall Tolerance= X1 + X2 + X3 - X4 + X5

PART Limits Average Std Dev


Spacer(X1) .095-.105 .100 .00167

Disk(X2) .179-.183 .181 .00067

Key Washer(X3) .027-.0295 .02825 .0004167

Tierod(X4) .345-.375 .36 .005

Tierod nut(X5) .050-.070 .06 .00333

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
48 of 116
Unpublished Work - © United Technologies Corporation 2007
Normal Distribution overview

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
49 of 116
Unpublished Work - © United Technologies Corporation 2007
Case 2:Tolerancing using RSS or RMS method(continued)

RSS = ( X 1) 2 + ( X 2) 2 + ( X 3) 2 + ( X 4) 2 + ( X 5) 2
RSS = (.00167) 2 + (.00067) 2 + (.0004167) 2 + (.005) 2 + (.00333) 2
RSS = 0.0000395
RSS = .006285 which is 1σ for the tolerance stack
So, looking at the int erval 0.00925"± 3(.006285)
[.00925 − .018855,.00925 + .018855] = [−0.009605, 0.028105]
And the probability of int erference is
0.0 − 0.00925
Pr ob( Z < 0.0) = Z ( ) = Z (−1.47)
.006285
From Normal tables, Pr ob of int erference = 0.0708
or 708 /10, 000
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
50 of 116
Unpublished Work - © United Technologies Corporation 2007
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
51 of 116
Unpublished Work - © United Technologies Corporation 2007
Case 3: Tolerancing using Monte Carlo Simulation

• Simulator outline:

Randomly determine Part Dimensions

Assemble Disk Configuration

Check for Rod/Nut Interference

1st, assume all dimensions are uniformly distributed,


what is the probability of interference?
Now, assume all dimensions are normally distributed.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
52 of 116
Unpublished Work - © United Technologies Corporation 2007
EXCEL
Case 3: Tolerancing using Monte Carlo Simulation
Using Uniform distribution assumptions

•To do this, generate a Uniform (0,1) random number,


P, for each of the 5 components.
•Let size= LOW + P*(HIGH-LOW)
Tierod Clearance
Spacer Disk Washer Tierod Nut or
Sample (X1) (X2) (X3) (X4) (X5) Interference
1 0.1018 0.1820 0.0285 0.3683 0.0630 0.0070(C)

2 0.1017 0.1793 0.0281 0.3711 0.0580 -0.0040(I)

3 0.0961 0.1798 0.0271 0.3674 0.0693 0.0050(C)

4 0.1024 0.1808 0.0273 0.3701 0.0569 -0.0026(I)


. . . . . . .
. . . . . . .
9999 0.1040 0.1792 0.0288 0.3533 0.0516 0.0103(C)

10000 0.0922 0.1796 0.0289 0.3605 0.0512 -0.0016(I)

Probability of Interference=2110/10000
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
53 of 116
Unpublished Work - © United Technologies Corporation 2007
Case 3: Tolerancing using Monte Carlo Simulation
Using Normal distribution assumptions

• Now assume that the dimensions are normally distributed and


that the given limits are 3 standard deviations below and above the
mean:
PART Limits Average Std Dev
Spacer(X1) .095-.105 .100 .00167

Disk(X2) .179-.183 .181 .00067

Key Washer(X3) .027-.0295 .02825 .0004167

Tierod(X4) .345-.375 .36 .005

Tierod nut(X5) .050-.070 .06 .00333

• The probability of interference is the probability that


X1+X2+X3-X4+X5<0
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
54 of 116
Unpublished Work - © United Technologies Corporation 2007
EXCEL
Case 3: Tolerancing using Monte Carlo Simulation
Using normal distribution assumptions(continued)

Tierod Clearance
Spacer Disk Washer Tierod Nut or
Sample (X1) (X2) (X3) (X4) (X5) Interference
1 0.1016 0.1816 0.0286 0.3526 0.0660 0.0252(C)

2 0.0986 0.1810 0.0282 0.3569 0.0588 0.0097(C)

3 0.0989 0.1799 0.0281 0.3643 0.0617 0.0043(C)

4 0.1005 0.1809 0.0283 0.3630 0.0598 0.0066(C)


. . . . . .
. . . . . . .
9999 0.1001 0.1804 0.0280 0.3666 0.0576 -0.0005(I)

10000 0.1012 0.1811 0.0290 0.3548 0.0602 0.0167(C)

Probability of Interference= 696/10000


Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
55 of 116
Unpublished Work - © United Technologies Corporation 2007
Case 3: Using “More realistic” assumptions on dimensions

Blueprint dimensions:
X2 X1 Spacer .095”-.105”
X2 Disk .179”-.183”
X5 X3 Key washer .027”-.0295”
X4 X4 Tierod .345”-.375”
X5 Tierod nut .050”-.070”

X1

X3

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
56 of 116
Unpublished Work - © United Technologies Corporation 2007
EXCEL
Case 3: Tolerancing using Monte Carlo Simulation
Using “realistic” distribution assumptions(continued)

PART Limits Assumption


Spacer(X1) .095-.105 Normal(.1,.00167)

Disk(X2) .179-.183 Uniform(.179,.183)

Key Washer(X3) .027-.0295 Triangular(.027,.028.0295)

Tierod(X4) .345-.375 Triangular(.345,.37,375)

Tierod nut(X5) .050-.070 Normal(.06,.00333)

Following the same simulator outline, calculate the number of parts


With interference out of 10,000.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
57 of 116
Unpublished Work - © United Technologies Corporation 2007
Tolerancing using Monte Carlo Simulation
Using Crystal Ball™

Crystal Ball demo

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
58 of 116
Unpublished Work - © United Technologies Corporation 2007
Monte Carlo Simulation of Load

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
59 of 116
Unpublished Work - © United Technologies Corporation 2007
In Class Example

PROBLEM:

1000 parts are each subjected to an axial load. The load varies
from part to part, and is normally distributed with a mean of
1000 pounds and a standard deviation of 200 pounds.

The cross section of the part is circular, with a radius r. Fun Class Participation
r is uniformly distributed between 0.9 inches and 1.1 inches.

A part fails if the stress it sees exceeds ultimate tensile


strength (UTS). UTS is normally distributed with a mean
of 400 pounds per square inch (psi) and a standard deviation
of 50 psi.

How many parts are expected to fail?

First: Create a flow chart for a Monte Carlo Simulation

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
60 of 116
Unpublished Work - © United Technologies Corporation 2007
In Class Example (Continued)

CREATE A FLOW CHART FOR THE MONTE CARLO SIMULATION:

1. Generate 1 normal random number to represent axial load


(mean = 1000, sigma = 200)
2. Generate 1 uniform random number between 0.9 and 1.1 to represent the radius
3. Calculate the area of the part
4. Calculate stress (stress = load/area)
5. Generate 1 normal random number to represent UTS (mean = 400, sigma = 50)
6. Compare stress to UTS. If stress > UTS add 1 to failure counter.
7. Repeat steps 2 -7 1,000 times
8. Write out the number of failures.

Will this answer the question?

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
61 of 116
Unpublished Work - © United Technologies Corporation 2007
In Class Example (Continued)
If you are using FORTRAN or C
Start

Print total number of


Set Counter: End
failures from 1,000 parts
Fail = 0.0

NO
YES
Normal Random
Determine Axial Load Another Part
Number

Repeat for
1,000 parts
Uniform Random
Determine Radius
Number

Area = π * r2 Calculate Area

π = 3.141592654

Calculate Stress
NO

Normal Random YES


Number Calculate UTS Stress > UTS Fail = Fail + 1.0

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
62 of 116
Unpublished Work - © United Technologies Corporation 2007
In Class Example (Continued)

Start

Print total number of


End
Set Counter:
Fail = 0.0
failures from 1,000 parts Not good enough!
NO
- This simulator only
YES
Normal Random
Determine Axial Load Another Part
Number
estimates the risk for
Repeat for
1,000 parts
Uniform Random
Determine Radius
one iteration (for the
Number

1,000 parts).
Calculate Area - A Monte Carlo
Simulation averages
Calculate Stress
NO the results from
Normal Random YES
Number Calculate UTS Stress > UTS Fail = Fail + 1.0
multiple iterations.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
63 of 116
Unpublished Work - © United Technologies Corporation 2007
In Class Example (Continued)

Start
Calculate Average
Number of Failures End
For all Trials
Set Counter: Fail = 0.0
NO Averaging multiple
YES Repeat for
Set Counter: Failx = 0.0 Another Trial
100.000 trials iterations provides
the required
Fail = Fail + Failx
output.
NO
YES
Determine Axial Load Another Part

Repeat for
Determine Radius 1,000 parts

Calculate Area

Calculate Stress NO
YES
Calculate UTS Stress > UTS Failx = Failx + 1.0

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
64 of 116
Unpublished Work - © United Technologies Corporation 2007
EXCEL
In Class Example (Continued)

Now that we have the flow chart – let’s put together the simulator:
• Basic simulators (like this example) can be constructed in EXCEL™.
• More complex simulations will require packages like Crystal Ball™
• Very complex simulations will still require FORTRAN or C.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
65 of 116
Unpublished Work - © United Technologies Corporation 2007
Probability of an F-16 pilot finding a
runway

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
66 of 116
Unpublished Work - © United Technologies Corporation 2007
How Can You Solve This?

• What is the probability of an F-16 finding a 5,000 ft


runway with zero oil pressure (due to MOP idler
bearing failure)?

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
67 of 116
Unpublished Work - © United Technologies Corporation 2007
If the dry run time is constant...easy solution.

Warning time=8 min


Dry run time =3 min
Total time =11 min
to find runway

Therefore, Prob(Finding a
Runway)= 0.85

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
68 of 116
Unpublished Work - © United Technologies Corporation 2007
BUT, Dry run time is random

* Could plug in the average run


time, but the “average” may not
accurate.

* Need Monte Carlo simulation


for an accurate estimate.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
69 of 116
Unpublished Work - © United Technologies Corporation 2007
Finding a Runway

• There is an 8 minute warning time prior to


zero oil pressure.
• The time an aircraft can fly with zero oil
pressure is represented by a Weibull
distribution.
• A probability distribution is known, giving the
probability of finding a runway given a certain
amount of time.
• Determine the probability of finding a suitable
runway for landing once the warning is given.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
70 of 116
Unpublished Work - © United Technologies Corporation 2007
Flying with Zero Oil Pressure

(minutes)

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
71 of 116
Unpublished Work - © United Technologies Corporation 2007
Finding a Runway

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
72 of 116
Unpublished Work - © United Technologies Corporation 2007
EXCEL

Finding a Runway Simulation outline

• Randomly determine dry-run time

• Add 8 minutes of warning

• Determine probability of finding runway

• Randomly generate a Uniform [0,1] number

• Determine if runway was actually found

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
73 of 116
Unpublished Work - © United Technologies Corporation 2007
More (general) Safety risk….

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
74 of 116
Unpublished Work - © United Technologies Corporation 2007
Monte Carlo Simulation of Fleet Reliability

+ • Exposure time
• Corrective actions

3.5
Cumulative Expected Incidents

2.5

1.5

0.5

0
Jim Breneman
0 5 10 15 20 25 30
Introduction to Monte Carlo Simulation 860-565-3959
75 of 116 Months from Now
Unpublished Work - © United Technologies Corporation 2007
Monte Carlo Simulation of Fleet Reliability
Example using 4 failure modes

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
76 of 116
Unpublished Work - © United Technologies Corporation 2007
Procedure for Calculating Incidents Using A
Weibull Life Distribution

1. For each operating unit, calculate its contribution to total risk


βˆ

F(c i + ∆ i ) - F(c i ) ⎛x⎞


-⎜ ⎟
w here F(x) = 1 - e ⎝ ηˆ ⎠

1 - F(c i )
βˆ, ηˆ are MLE' s of β, η

2. Sum the individual risk contributions over all operating units to compute
total fleet-wide risk

F(c i + ∆ i ) - F(c i )
Risk = ∑
operating
units
1 - F(c i )

Assumptions: Units are not repaired or replaced with a similar unit at time
of failure, having the same Weibull life distribution.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
77 of 116
Unpublished Work - © United Technologies Corporation 2007
Compiled FORTRAN

In-class risk analysis program use.

• The program MONTE is supplied on the CD.


• The input file(MONTEONE) contains the following input population:
100. hours
200.
300.
400.
500.
600.
700.
800.
900.
1000.
150.
250.
350.
450.
550.
650.
750.
850.
950.
1050.
575.

With a failure mode β=1, η=1000 hours; Usage rate=27 hours/month


Risk length of 60 months.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
78 of 116
Unpublished Work - © United Technologies Corporation 2007
Compiled FORTRAN

In-class risk analysis program(continued)

1. Run MONTE with MONTEONE input; note the cumulative failures after 60 months.
2. Change the usage rate to 54 hours per month, rerun, note the increase in risk.
3. Change the usage rate back to 27 hours per month and rerun… did the answer change
from 1)?.. Why?
4. Now change the Weibull failure parameters to β=2, η=1000 hours, rerun and note the
change in risk.
5. Change the Weibull failure parameters to β=3, η=1000 hours and rerun, noting the
change in risk… repeat for β=4, & β=5 (leaving η alone).
6. Change the Weibull failure parameters to β=3, η=2000 and change the usage rate to
54 hours per month… rerun the risk, noting the cumulative risk.
7. Change the renewals parameter to turn renewals “ON”… rerun and note the increase
in risk.
8. Change the inspection interval to 1200 hours. Rerun the risk and note the decrease.
This is the affect of the inspection interval making the units “good as new.”

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
79 of 116
Unpublished Work - © United Technologies Corporation 2007
EXCEL
Procedure for Calculating Incidents Using a Weibull
Life Distribution
• The program Risk_analyzer.xls is supplied for this exercise.
• With a failure mode β=1, η=1000 hours; β=2, η=1500 hours
β=3, η=2000 hours, β=4, η=3000 hours. Usage rate=27 hours/month
• Risk length of 5 years(60 months).
• Use the population of 100 engines in column 1 of input.
• Set EFH/Month=20.

1. Run Risk_analyzer.xls; note the cumulative failures after 60 months.


2. Change the usage rate to 54 hours per month, rerun, note the increase in risk.
3. Change the usage rate back to 27 hours per month and rerun… did the answer change
from 1)?.. Why?
4. Now change the Weibull failure parameters for the 3rd failure mode from
β=3, η=2000 hours to β=3, η=1500 hours, rerun … did the cumulative risk due to
all failure modes change or did the distribution of failures among modes change?
5. Change the inspection interval to 1200 hours. Rerun the risk and note the decrease.
Again, this is the affect of the inspection interval making the units “good as new.”
6. Change the number of simulation trials to 100, rerun 3 times. What was the change
in cumulative failures for each failure mode?
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
80 of 116
Unpublished Work - © United Technologies Corporation 2007
EXCEL macro for multiple Buffon Needle runs

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
81 of 116
Unpublished Work - © United Technologies Corporation 2007
Macro for running Multi-runs
To do this macro (or any macro for that matter) in EXCEL:
In EXCEL (in the case the Buffon Needle problem .xls):
Select Tools, Macro, Visual Basic Editor, Insert, Module
Type in this macro:
Sub MonteIter() Name of macro is up to you
the 100 is the number of samples of 1000 I decided to do
Calculate resets all the random numbers to new random numbers
For sample = 1 To 100 Cells(sample,8).value=Cells(3,6).value copies the result of the
iteration into the cell (sample,8), I.e. the 1st sample is in 1,8,
the 2nd sample is in 2,8, etc. (Note that Visual Basic refers to
Calculate the cells in EXCEL differently than EXCEL does.VB uses
standard matrix notation. 1,8 is element in 1st row, 8th column)

Cells(sample, 8).Value = Cells(3, 6).Value


Next sample
End Sub
Now, go to BuffonNeedle.xls; from EXCEL pulldown Tools, MACRO,
MACROS, click on buffonneedle.xls!Module.Monteiter, then click Run.
And you should generate the 100 average pi values from the 1000 pin droppings.
On the next page is a normal plot of my 100.. Notice the spread
in the estimate of pi even though you’re using 1000 pin drops to get
each estimate of pi. Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
82 of 116
Unpublished Work - © United Technologies Corporation 2007
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
83 of 116
Unpublished Work - © United Technologies Corporation 2007
Additional examples

• F100 Operational Support Model


• Saudi Pipeline Simulation
• Reliability in Design (Probabilistic Design)

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
84 of 116
Unpublished Work - © United Technologies Corporation 2007
F100 Operational Support Model

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
85 of 116
Unpublished Work - © United Technologies Corporation 2007
Cumulative Depot Modules Helps Determine
Depot Workload

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
86 of 116
Unpublished Work - © United Technologies Corporation 2007
Going to 1350 Cycles Saves Depot Visits

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
87 of 116
Unpublished Work - © United Technologies Corporation 2007
F15 /F16 HPT 3600/4100 Depot Inspections

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
88 of 116
Unpublished Work - © United Technologies Corporation 2007
F15 HPC Module Demands

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
89 of 116
Unpublished Work - © United Technologies Corporation 2007
Aids in LCC Payoff

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
90 of 116
Unpublished Work - © United Technologies Corporation 2007
Increased CIP Funding Saves LCC$

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
91 of 116
Unpublished Work - © United Technologies Corporation 2007
Aids in Determining Which Failure Modes are
Most Important

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
92 of 116
Unpublished Work - © United Technologies Corporation 2007
Weibull Plot input for Risk Analysis

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
93 of 116
Unpublished Work - © United Technologies Corporation 2007
Number 4 Oil Tube Chafe & ‘B’ Nut

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
94 of 116
Unpublished Work - © United Technologies Corporation 2007
Advantages of F100 O&S Simulation

• One basic model with regularly updated input


was used to forecast:
• Depot/IM Module Generations
• Spares Requirements
• Life Cycle Cost
• Maintenance Effectiveness
• Risk/Safety

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
95 of 116
Unpublished Work - © United Technologies Corporation 2007
Saudi Arabian Crude Oil Pipeline

Would the System Provide 99% Availability?


Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
96 of 116
Unpublished Work - © United Technologies Corporation 2007
Saudi Pipeline Simulation

• Number of simultaneous repairs:


Facility Capacity Repairs
3 Maintenance sites One engine/ * Module changeout
module * Main engine bearing
compartments.
1 Major Repair facility Two engine/ * Module repair
modules
plus one
Free turbine
* Main engine bearings
* Free turbine repairs
* All other

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
97 of 116
Unpublished Work - © United Technologies Corporation 2007
Saudi Pipeline Simulation...Spares distribution

Spare Item East-3 Central-6 West-10


Gas generator 1 1 1
HPT module 1 2 1
LPT module 1 1 1
Free turbine 1
All other items Unlimited Unlimited Unlimited

Repair:
* Repairs done by captured crews at repair sites and the major repair facility.
* Lack of spares results in wait Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
98 of 116
Unpublished Work - © United Technologies Corporation 2007
Saudi Pipeline Simulation...Module Repair Times

Engine Remove
Failure & Repair
Item Chance(%) Replace Time
LPC 21 1 day 2-4 weeks
HPC 28 4 days 1.5-3 weeks
HPT 27 3 days 1-2 weeks
LPT 16 1 day 1-2 weeks
Exh case 2 1/2 day 3-6 days
Bearings 5 1/2 day -
Gearbox 1 1/2 day 4-8 days
100
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
99 of 116
Unpublished Work - © United Technologies Corporation 2007
Saudi Pipeline Simulation

• Utilized GPSS for simulation, FORTRAN for


output tables and plots.
• Base case run found to be questionable...
70% availability and a $2.6B loss/year.
• What if......

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
100 of 116
Unpublished Work - © United Technologies Corporation 2007
Saudi Pipeline Simulation....options

Possibility Answer
More repair crews No change required
More spare modules Additional compressor
module as spares
More repair facilities Add 2 additional
repair facilities

Result: 99+% System Availability

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
101 of 116
Unpublished Work - © United Technologies Corporation 2007
The Need for a Probabilistic Approach in Design

• Most design factors (e.g. applied forces, materials, geometry)


possess variability.

• More meaningful - “This system has a probability of 1/1000 of


failing in 8000 cycles.”

• Easier to compare competing designs in terms of reliability.

• Effect of uncertainties on the final design can be quantified,


Hence the cost of removing this uncertainty can be assessed.

• Develop policies towards warranties, spare part requirements.


Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
102 of 116
Unpublished Work - © United Technologies Corporation 2007
Uncertainties in the Design Process

• Strength uncertainties
• Material properties
• Machining & processing operations
• Assembly operations
• Effects of time(cycling)

• Stress uncertainties
• Stress analysis assumptions
• Magnitude of peak loads
• Discontinuities and stress concentrations

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
103 of 116
Unpublished Work - © United Technologies Corporation 2007
General Approach

A, area
R, strength
S, stress Stress Strength

Prob Stress `> Strength Jim Breneman


Introduction to Monte Carlo Simulation 860-565-3959
104 of 116
Unpublished Work - © United Technologies Corporation 2007
Monte Carlo Simulation solution of the Problem

• Generate a random value from each design variable distribution


(e.g. stress, temperature, geometry)
• Evaluate the engineering formulation; say gi=Ri - Si
• Repeat many time (100,000 or more)
• Count the number of gi’s<0

Conclusion
• Easy to formulate, easy to program (FORTRAN,C,PASCAL, even SAS)
• Computer time is no longer a concern with faster processors.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
105 of 116
Unpublished Work - © United Technologies Corporation 2007
Example: F100 3-4 Spacer .2% Creep

• Stress - Snap Load


- Speeds

Stress
- Spacer thickness

• Metal Temperature - FTIT


(TMetal) - Chamber 19 leaks
- Chamber 19 Temps

Reliability goal is 4/1000 at 580 hours intermediate & above.

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
106 of 116
Unpublished Work - © United Technologies Corporation 2007
Example input

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
107 of 116
Unpublished Work - © United Technologies Corporation 2007
Output

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
108 of 116
Unpublished Work - © United Technologies Corporation 2007
Output, Assessing the impact of increasing FTIT 1000

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
109 of 116
Unpublished Work - © United Technologies Corporation 2007
FORTRAN Routines for Random Number
Generation

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
110 of 116
Unpublished Work - © United Technologies Corporation 2007
FORTRAN routines for Random number
generation
• Uniform random number generation:
1. Intrinsic function random_number(harvest)
generates uniform random numbers either one at a time or as an array.
2. Functions ran1(idum), ran2(idum), ran3(idum) (in back of presentation)
These all use a negative integer to initialize, and are good uniform
random number generators (see “Numerical Recipes in FORTRAN 77”)

• Normal random number generation


1. Function gasdev(idum) in the back of the presentation,
where idum is a negative integer, generates a standard normal deviate.
2. Subroutine Gauss6(IX,Stddev,Mean,Xnormal) returns a normal
random number, where IX is an integer.(also in the back of the presentation)
3. After the program statement put the statement
use numerical_libraries
then
call rnnor(1,z) will generate a standard normal variate z.

• Generating Weibull, exponential, lognormal random numbers in FORTRAN :


use the above routines. Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
111 of 116
Unpublished Work - © United Technologies Corporation 2007
Algorithm for Generating Uniform Random numbers.. #1
FUNCTION RAN1(IDUM)
DIMENSION R(97)
PARAMETER (M1=259200,IA1=7141,IC1=54773,RM1=3.8580247E-6)
PARAMETER (M2=134456,IA2=8121,IC2=28411,RM2=7.4373773E-6)
PARAMETER (M3=243000,IA3=4561,IC3=51349)
DATA IFF /0/
IF (IDUM.LT.0.OR.IFF.EQ.0) THEN
IFF=1
IX1=MOD(IC1-IDUM,M1)
IX1=MOD(IA1*IX1+IC1,M1)
IX2=MOD(IX1,M2)
IX1=MOD(IA1*IX1+IC1,M1)
IX3=MOD(IX1,M3)
DO 11 J=1,97
IX1=MOD(IA1*IX1+IC1,M1)
IX2=MOD(IA2*IX2+IC2,M2)
R(J)=(FLOAT(IX1)+FLOAT(IX2)*RM2)*RM1
11 CONTINUE
IDUM=1
ENDIF
IX1=MOD(IA1*IX1+IC1,M1)
IX2=MOD(IA2*IX2+IC2,M2)
IX3=MOD(IA3*IX3+IC3,M3)
J=1+(97*IX3)/M3
IF(J.GT.97.OR.J.LT.1)PAUSE
RAN1=R(J)
R(J)=(FLOAT(IX1)+FLOAT(IX2)*RM2)*RM1
RETURN
END
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
112 of 116
Unpublished Work - © United Technologies Corporation 2007
Algorithm for Generating Uniform Random numbers.. #2

FUNCTION RAN2(IDUM)
PARAMETER (M=714025,IA=1366,IC=150889,RM=1.4005112E-6)
DIMENSION IR(97)
DATA IFF /0/
IF(IDUM.LT.0.OR.IFF.EQ.0)THEN
IFF=1
IDUM=MOD(IC-IDUM,M)
DO 11 J=1,97
IDUM=MOD(IA*IDUM+IC,M)
IR(J)=IDUM
11 CONTINUE
IDUM=MOD(IA*IDUM+IC,M)
IY=IDUM
ENDIF
J=1+(97*IY)/M
IF(J.GT.97.OR.J.LT.1)PAUSE
IY=IR(J)
RAN2=IY*RM
IDUM=MOD(IA*IDUM+IC,M)
IR(J)=IDUM
RETURN
END

Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
113 of 116
Unpublished Work - © United Technologies Corporation 2007
Algorithm for Generating Uniform Random numbers.. #3

FUNCTION RAN3(IDUM) INEXT=INEXT+1


C IMPLICIT REAL*4(M) IF(INEXT.EQ.56)INEXT=1
C PARAMETER (MBIG=4000000.,MSEED=1618033.,MZ=0.,FAC=2.5E-7) INEXTP=INEXTP+1
PARAMETER (MBIG=1000000000,MSEED=161803398,MZ=0,FAC=1.E-9) IF(INEXTP.EQ.56)INEXTP=1
DIMENSION MA(55) MJ=MA(INEXT)-MA(INEXTP)
DATA IFF /0/ IF(MJ.LT.MZ)MJ=MJ+MBIG
IF(IDUM.LT.0.OR.IFF.EQ.0)THEN MA(INEXT)=MJ
IFF=1 RAN3=MJ*FAC
MJ=MSEED-IABS(IDUM) RETURN
MJ=MOD(MJ,MBIG) END
MA(55)=MJ
MK=1
DO 11 I=1,54
II=MOD(21*I,55)
MA(II)=MK
MK=MJ-MK
IF(MK.LT.MZ)MK=MK+MBIG
MJ=MA(II)
11 CONTINUE
DO 13 K=1,4
DO 12 I=1,55
MA(I)=MA(I)-MA(1+MOD(I+30,55))
IF(MA(I).LT.MZ)MA(I)=MA(I)+MBIG
12 CONTINUE
13 CONTINUE
INEXT=0
INEXTP=31
IDUM=1
Jim Breneman
ENDIF Introduction to Monte Carlo Simulation 860-565-3959
114 of 116
Unpublished Work - © United Technologies Corporation 2007
Algorithm for Generating Normal Random numbers.. #1

FUNCTION gasdev(idum)
integer idum
real gasdev
integer iset
real fac,gset,rsq,v1,v2,ran1
save iset, gset
data iset/0/
if (iset .eq. 0) then
1 call random_number(ran1)
v1=2.*ran1-1.
call random_number(ran1)
v2=2.*ran1-1.
rsq=v1**2+v2**2
if (rsq .ge. 1. .or. rsq .eq. 0.)goto 1
fac=sqrt(-2.*log(rsq)/rsq)
gset=v1*fac
gasdev=v2*fac
iset=1
else
gasdev=gset
iset=0
endif
return
end
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
115 of 116
Unpublished Work - © United Technologies Corporation 2007
Algorithm for Generating Normal Random numbers.. #2

SUBROUTINE GAUSS6(IX,SIGMA,XMEAN,X)
DATA XI/2.2160359/ F = EXP(-(T**2)/2.) / 2.5066283 - .1800252 * (XI - ABS(T))
C IF (A.LE.F) GO TO 100
C KINDERMAN/RAMAGE NORMAL RANDOM NUMBER GENERATOR GO TO 25
C REFERENCE : JASA, DECEMBER 1976, PAGES 893 - 896 30 IF (U.LT..9113128) GO TO 40
C PROGRAMMER : GRANT REINMAN 35 IX = IX * 65549
C V = .5 + FLOAT(IX) * .2328306E-9
IX = IX * 65549 IX = IX * 65549
U = .5 + FLOAT(IX) * .2328306E-9 W = .5 + FLOAT(IX) * .2328306E-9
IF (U.GE..884074) GO TO 10 Z=V-W
IX = IX * 65549 T = .4797274 + 1.1054737 * AMIN1(V,W)
V = .5 + FLOAT(IX) * .2328306E-9 IF (AMAX1(V,W).LE..872835) GO TO 100
X = XI * (1.1311316 * U + V - 1.) A = .0492645 * ABS(Z)
X = XMEAN + X * SIGMA F = EXP(-(T**2)/2.) / 2.5066283 - .1800252 * (XI - ABS(T))
RETURN IF (A.LE.F) GO TO 100
10 IF (U.LT..973311) GO TO 20 GO TO 35
15 IX = IX * 65549 40 IX = IX * 65549
V = .5 + FLOAT(IX) * .2328306E-9 V = .5 + FLOAT(IX) * .2328306E-9
IX = IX * 65549 IX = IX * 65549
W = .5 + FLOAT(IX) * .2328306E-9 W = .5 + FLOAT(IX) * .2328306E-9
T = (XI**2) / 2. - ALOG(W) Z=V-W
IF ((T*V**2).GT.((XI**2)/2.)) GO TO 15 T = .4797274 - .5955071 * AMIN1(V,W)
X = -SQRT(2.*T) IF (AMAX1(V,W).LE..8055779) GO TO 100
IF (U.LT..9866555) X = SQRT(2.*T) A = .0533775 * ABS(Z)
X = XMEAN + X * SIGMA F = EXP(-(T**2)/2.) / 2.5066283 - .1800252 * (XI - ABS(T))
RETURN IF (A.GT.F) GO TO 40
20 IF (U.LT..9587208) GO TO 30 100 X = XMEAN + SIGMA * T
25 IX = IX * 65549 IF (Z.GE.0.) X = XMEAN - SIGMA * T
V = .5 + FLOAT(IX) * .2328306E-9 RETURN
IX = IX * 65549 END
W = .5 + FLOAT(IX) * .2328306E-9
Z=V-W
T = XI - .6308348 * AMIN1(V,W)
IF (AMAX1(V,W).LE..7555915) GO TO 100
A = .0342405 * ABS(Z)
Jim Breneman
Introduction to Monte Carlo Simulation 860-565-3959
116 of 116
Unpublished Work - © United Technologies Corporation 2007

Vous aimerez peut-être aussi