monte carlo simulation for system reliability and availability … · 2018-12-05 · 11 the state...
TRANSCRIPT
Monte Carlo Simulation for System Reliability and Availability Analysis
The experimental view
3
Simulation of system stochastic process
Simulation for reliability/availability analysis of a component
Examples
Contents
Sampling Random Numbers
4
Buffon
Gosset (Student)
Fermi, von Neumann, Ulam
Neutron transport
System Transport (RAMS)
Kelvin
The History of Monte Carlo Simulation
1707-88
1908
1824-1907
1950’s
1930-40’s
1990’s
SAMPLING RANDOM NUMBERS
6
Example: Exponential Distribution
Probability density function:
Expected value and variance:
00
0)(
=
= −
t
tetf t
T
2
1][
1][
=
=
TVar
TE
t
fT(t)
( ) t
Tf t e −=
7
Sampling Random Numbers from FX(x)
( ) x
X exF −−=1
Sample R from UR(r) and find X:
( )RFX X
1−=
( ) x
X exFR −−== 1
( ) ( )RRFX X −−== − 1ln11
Example: Exponential distribution
8
sample an
Graphically:
0 1, ,..., ,...kx x x =
0
k
k k i
i
F P X x P X x=
= = =
~ [0,1)R U
Sampling from discrete distributions
9
Arc number i Failure
probability Pi
1 0.050
2 0.025
3 0.050
4 0.020
5 0.075
Failure probability estimation: example
• 1- Calculate the analytic solution for the failure probability of the network, i.e., the probability of no connection between nodes S and T
• 2- Repeat the calculation with Monte Carlo simulation
10
Analytic solution
10
43
1
[ 1] [ ] 3.07 10T j
j
P X P M −
=
= = 3
1 1 4
3
2 2 5
4
3 1 3 5
5
4 2 3 4
[ ] 0.05 0.02 1 10
[ ] 0.025 0.075 1.875 10
[ ] 0.05 0.05 0.075 1.875 10
[ ] 0.025 0.05 0.02 7.5 10
P M p p
P M p p
P M p p p
P M p p p
−
−
−
−
= = =
= = =
= = =
= = =
1) Minimal cut sets
M2={2,5}
M3={1,3,5}
M4={2,3,4}
2) Network failure probability (rare event approximation):
11
The state of arc i can be sampled by applying the inverse transform method to the set of discrete probabilities of the mutually exclusive and exhaustive states
•We calculate the arrival state for all the arcs of the newtork
•As a result of these transitions, if the system falls in anyconfiguration corresponding to a minimal cut set, we add 1 to Nf
•The trial simulation then proceeds until we collect N trials. We obtain the estimation of the failure probability dividing Nf by N
0 1
R
S
B
B
1
31→
B
B
1
21→
SRU[0,1)
,1i ip p−
ip 1 ip−
Monte Carlo simulation
12
• N number of trials
• NF number of trials corresponding to realization of a minimal cut set
• The failure probability is equal to NF / N
clear all;
%arc failure probabilities
p=[0.05,0.025,0.05,0.02,0.075]; nf=0;
n=1e6; %number of MC simulations
for i=1:n
%sampling of arcs fault events
r=rand(1,5); s=zeros(1,5); rpm=r-p;
for j=1:5
if (rpm(1,j)<=0)
s(1,j)=1;
end
end
%cut set check
fault=s(1,1)*s(1,4)+s(1,2)*s(1,5)+s(1,1)*s(1,3)*s(1,5)+s(1,2)*s(1,3)*s(1,4);
if fault >= 1
nf=nf+1;
end
end
pf=nf/n; %system failure probability
For n=106, we obtain3[ 1] 3.04 10TP X −=
Monte Carlo simulation
SIMULATION OF SYSTEM STOCHASTIC PROCESS
14Monte Carlo simulation of system
stochastic process
• PLANT = system of Nc suitably connected components.
• COMPONENT = a subsystem of the plant (pump, valve,...) which maystay in different exclusive (multi)states (nominal, failed, stand-by,... ).Stochastic transitions from state-to-state occur at stochastic times.
• STATE of the PLANT at t = the set of the states in which the Nc
components stay at t. The states of the plant are labeled by a scalarwhich enumerates all the possible combinations of all the componentstates.
• PLANT TRANSITION = when any one of the plant componentsperforms a state transition we say that the plant has performed atransition. The time at which the plant performs the n-th transition iscalled tn and the plant state thereby entered is called kn.
• PLANT LIFE = stochastic process.
15
Random walk = realization of the system life generated by the underlying
state-transition stochastic process.
Realization of system, stochastic process:
random walk
16Phase Space of System Stochastic
Process
17
( ) ( ) 0,R R
MC t C t t T=
( ) ( ) 1 ,R R
MC t C t t T= +
( ) ( ) 1 ,R R
MC t C t t T= +
( ) ( ) 0,R R
MC t C t t T=
( )ˆ ( )R
T
C tF t
M=
Example: System Reliability Estimation
Events at components
level, which do not entail
system failure
18
• T(tt’; k’)dt = conditional probability of a transition at tdt, given that thepreceding transition occurred at t’ and that the state thereby enteredwas k’.
• C(k k’; t) = conditional probability that the plant enters state k, giventhat a transition occurred at time t when the system was in state k’. Boththese probabilities form the ”trasport kernel”:
K(t; k t’; k’)dt = T(t t’; k’)dt C(k k’; t)
• (t; k) = ingoing transition density or probability density function (pdf) ofa system transition at t, resulting in the entrance in state k
Stochastic Transitions: Governing
Probabilities
19
SIMULATION OF COMPONENT STOCHASTIC PROCESS FOR AVAILABILITY / RELIABILITY
ESTIMATION
20
12
m
State 2
State 1
State X=1 → ON
State X=2 → OFF
Single component with exponential
distribution of the failure time
21
12
m
State 2
State 1
State X=1 → ON
State X=2 → OFF
Single component with exponential
distribution of the failure time
22
12
m
State 2
State 1
State X=1 → ON
State X=2 → OFF
Single component with exponential
distribution of the failure time
23
12
m
State X=1 → ON
State X=2 → OFF
Single component with exponential
distribution of the failure time
values
3· 10-3 h-1
m 25· 10-3 h-1
Limit unavailability:
1 /0.1071
1 / 1 /U
m
m = =
+
24Monte Carlo simulation for estimating
component availability at time t
• Nt time intervals Δt
• If the component fails in t+Δt, the counter increases cA(tj)= cA(tj) +1; otherwise, cA(tj) = cA(tj)
Trial 1
25Monte Carlo simulation for estimating
component availability at time t
• … another trial
Trial 1Trial 1
Trial i-th
26Monte Carlo simulation for estimating
component availability at time t
• … another trial
Trial 1
Trial i-th
Trial 1
Trial i-th
Trial M-th
27Monte Carlo simulation for estimating
component availability at time t
Trial 1
Trial i-th
Trial M-th
Trial 1
Trial i-th
Trial M-th
The counter cA(tj) adds 1 until M trials have been sampled
= unavailability at time tj
= mean value of cA(tj) at time tj
( ) { ( ) 1}A j
G t P X t =
( )( )
A
j
A j
c tG t
M=
28
Pseudo Code
%Initialize parameters
Tm=mission time; Nt=number of trials; Dt=bin length;
Time_axis=0:Dt:Tm;
FOR i=1:Nt
%parameter initialization for each trial
t=0; failure_time=0; repair_time=0; state=1;
while t<Tm
if state=1
t=t+exprnd(1/lambda); state=2; failure_time=t;
lower_b=minimum(find(time_axis>=failure_time));
counter(i,lower_b)=1;
Else
t=t+exprnd(1/mu); state=1; repair_time=t;
upper_b=find(time_axis<up_time,1,'last');
counter(i,lower_b+1:upper_b)=1;
Endif
End while
End For
unav=sum_channel(counter)/n_simulations
0 100 200 300 400 500 600 700 800 900 1000
0
0.2
0.4
0.6
0.8
1
Tiempo
Falta d
e d
isponib
ilidad
único ensayo
Simulacion Monte Carlo
Falta de disponibilidad en estado estacionario
Single trial
Monte Carlo simulation
Limit unavailability
Time
Una
va
ilab
ility
29
SIMULATION OF SYSTEM STOCHASTIC PROCESS FOR AVAILABILITY / RELIABILITY
ESTIMATION
30Phase Space of System Stochastic
Process
31
A
B
C
Components’ times of transition between states are exponentially distributed
( = rate of transition of component i going from its state ji to the state mi)i
mji 1→
Arrival
Init
ial
1 2 3
1 -
2 -
3 -
)(
21BA
→ )(
31BA
→
( )2 1A B
→
)(32
BA→
)(
13BA
→ )(
23BA
→
Indirect Monte Carlo: Example
32
▪ The components are initially (t=0) in their nominal states (1,1,1)
▪One minimal cut set of order 1 (C in state 4:(*,*,4)) and one minimal
cut set of order 2 (A and B in 3: (3,3,*)).
Arrival
1 2 3 4
Init
ial
1 -
2 -
3 -
4 -
C
21→ C
31→ C
41→
C
12→ C
32→ C
42→
C
13→ C
23→ C
43→
C
14→ C
24→ C
34→
Indirect Monte Carlo: Example
33
SAMPLING THE TIME OF TRANSITION
The rate of transition of component A(B) out of its nominal state 1 is:
• The rate of transition of component C out of its nominal state 1 is:
•The rate of transition of the system out of its current configuration (1,1, 1) is:
•We are now in the position of sampling the first system transition timet1, by applying the inverse transform method:
where Rt ~ U[0,1)
)(
31)(
21)(
1BABABA
→→ +=
CCCC
4131211 →→→ ++=
( ) CBA
1111,1,1 ++=
( ) )1ln(1
1,1,101 Rtt t−−=
Analog Monte Carlo Trial
34
• Assuming that t1 < TM (otherwise we would proceed to the successive trial), we now need to determine which transition has occurred, i.e. which component has undergone the transition and to which arrivalstate.
• The probabilities of components A, B, C undergoing a transition out oftheir initial nominal states 1, given that a transition occurs at time t1, are:
• Thus, we can apply the inverse transform method to the discrete distribution
( ) ( ) ( )1,1,1
1
1,1,1
1
1,1,1
1 , ,
CBA
0
R
C ( )1,1,1
1
A
( )1,1,1
1
B
( )1,1,1
1
C
C
10
Sampling the kind of Transition (1)
35
• Given that at t1 component B undergoes a transition, its arrival state
can be sampled by applying the inverse transform method to the set of
discrete probabilities
of the mutually exclusive and exhaustive arrival states
→→
B
B
B
B
1
31
1
21 ,
0 1
R
S
B
B
1
31→
B
B
1
21→
S
• As a result of this first transition, at t1 the system is operating in
configuration (1,3,1).
• The simulation now proceeds to sampling the next transition time t2 with
the updated transition rate
( ) CBA
1311,3,1 ++=
Sampling the Kind of Transition (2)
RSU[0,1)
36
• The next transition, then, occurs at
where Rt ~ U[0,1).
•Assuming again that t2 < TM, the component undergoing the transition and
its final state are sampled as before by application of the inverse trasform
method to the appropriate discrete probabilities.
•The trial simulation then proceeds through the various transitions from one
system configuration to another up to the mission time TM.
( ) )1ln(1
1,3,112 Rtt t−−=
Sampling the Next Transition
37
• When the system enters a failed configuration (*,*,4) or
(3,3,*), where the * denotes any state of the component,
tallies are appropriately collected for the unreliability and
instantaneous unavailability estimates (at discrete times tj [0, TM]);
• After performing a large number of trials M, we can
obtain estimates of the system unreliability and
instantaneous unavailability by simply dividing by M, the
accumulated contents of CR(tj) and CA(tj), tj[0,TM]
Unreliability and Unavailability Estimation
38
For any arbitrary trial, starting at t=0 with the system in nominal
configuration (1,1,1) we would sample all the transition times:
where
)1ln(1
1,
1
01 Rtti
mtim
im i
i
i →
→
→ −−=
==
==
=
Cm
BAim
CBAi
i
i
ifor 4,3,2
,for 3,2
,,
)1,0[~1, URi
mt i→
A
B
C
Direct Monte Carlo: Example
39
Direct Monte Carlo: Example
The theoretical view
41
Sampling
Evaluation of definite integrals
Simulation of system transport
Contents
Simulation for reliability/availability analysis
42
Sampling
Evaluation of definite integrals
Simulation of system stochastic process
Contents
Simulation for system reliability/availability analysis
44
( ) rrRPrUR == :cdf
( )( )
1 :pdf ==dr
rdUru R
R
0
Sampling (pseudo) Random Numbers
Uniform Distribution
46
Sample R from UR(r) and find X:
( )RFX X
1−=
Question: which distribution does X obey?
Application of the operator Fx to the argument of P above yields
Summary: From an R UR(r) we obtain an X FX(x)
( ) xRFPxXP X = −1
( ) ( )xFxFRPxXP XX ==
1
1 r 0
( )rUrR R=Pr ( )xFX
R X x
Sampling (pseudo) Random Numbers
Generic Distribution
47
• Markovian system with two states (good, failed)
• hazard rate, = constant
• cdf
•Sampling a failure time T
( ) t
T etTPtF −−== 1
( ) dtedttTtPdttf t
T =+= −
( ) ( ) t
TR etFrFR −−== 1
( ) ( )RRFT T −−== − 1ln11
Example: Exponential Distribution
48
• hazard rate not constant
•CDF
• Sampling a failure time T
( ) 1 t
Tf t dt P t T t dt t e dt − − = + =
( ) ( ) 1 t
R TR F r F t e− = = −
( ) ( )
1
1 1ln 1TT F R R
− = = − −
Example: Weibull Distribution
( ) 1 t
TF t P T t e−= = −
49
sample an
•
•
Graphically:
0 1, ,..., ,...kx x x =
0
k
k k i
i
F P X x P X x=
= = =
~ [0,1)R U
1 1
1 1
( ) ( )
~ [0,1) and ( )
k k R k R k
R
k k k k k k
P F R F F F F F
R U F r r
P F R F F F f P X x
− −
− −
= −
=
= − = = =
Sampling by the Inverse Transform
Method: Discrete Distributions
50
Sampling
Evaluation of definite integrals
Simulation of system transport
Contents
Simulation for reliability/availability analysis
51
MC analog dart game: sample x from f(x)
• the probability that a shot hits x dx is f(x)dx
• the award is g(x)
Consider N trials with result {x1, x2, …,xn}: the average award is
( )=
=N
i
iN xgN
G1
1
( ) ( )
( ) ( ) ( ) 1 ; 0 pdf =→
=
dxxfxfxf
dxxfxgGb
a
MC Evaluation of Definite Integrals (1D)
Analog Case
52
( ) ( )
( )
1
0
1
2 2
0
22
2
2cos 0.6366198
2
By setting: 1, g cos2
( )
1 ( ) cos
2 2
1 1 ( ) ( )
1 1 2 1 9
2
N
N
G x dx
f x x x
G E g x
E g x x dx
Var G Var g x E g x E g xN N
Var GN N
= = =
= =
=
= =
= = −
= − =
( )
2
4
2 6
.47 10
for 10 histories, ~ [0,1) cos2
0.6342, 9.6 10N
i i i
N G
N x U g x x
G s
−
−
= =
= =
MC Evaluation of Definite Integrals (1D)
Example
53
MC biased dart game: sample x from f1(x)
• the probability that a shot hits x dx is f1(x)dx
• the award is
( )( )( )
( ) ( )=
==N
i
iN xgN
Gxgxf
xfxg
1
11
1
1
1
The expression for G may be written
( )( )
( ) ( ) ( ) ( )
=
DDdxxfxgdxxfxg
xf
xfG 111
1
MC Evaluation of Definite Integrals (1D)
Biased Case
54
The pdf f1*(x) is:
From the normalization condition:
For the minimum value
* 2
1 ( )f x a bx= −
( )1 1
* 2
1
0 0
* 2
1
( ) 1 1 3( 1)3
( ) 3( 1)
bf x dx a bx dx a b a
f x a a x
= − = − = = −
= − −
31.5
2a = =
1
1
1 1
2
2
0 0 ( )( )
cos 12cos (1.5 1.5 )
2 1.5 1.5f x
g x
x
G xdx x dxx
= = −−
1
0
2cos 0.6366198
2G x dx
= = =
MC Evaluation of Definite Integrals (1D)
Biased Case: Example
55
2
4
1 1
1 2 10.406275 9.9026 10NVar G
N N
−
= − =
Finally we obtain:
( )( )
1
4 *
1 1 2
2 8
1
cos2
for 10 histories, ~1.5 1.5
0.6366, 9.95 10N
i
i i
i
N G
x
N x f g xx
G s
−
= =−
= =
MC Evaluation of Definite Integrals (1D)
Biased Case: Example
56
Sampling
Evaluation of definite integrals
Simulation of system stochastic process
Contents
Simulation for system reliability/availability analysis
57Monte Carlo simulation for system
reliability
• PLANT = system of Nc suitably connected components.
• COMPONENT = a subsystem of the plant (pump, valve,...) which may stay in different exclusive (multi)states (nominal, failed, stand-by,... ). Stochastictransitions from state-to-state occur at stochastic times.
• STATE of the PLANT at t = the set of the states in which the Nc componentsstay at t. The states of the plant are labeled by a scalar which enumerates allthe possible combinations of all the component states.
• PLANT TRANSITION = when any one of the plant components performs a state transition we say that the plant has performed a transition. The time at whichthe plant performs the n-th transition is called tn and the plant state therebyentered is called kn.
• PLANT LIFE = stochastic process.
59
60
T(tt’; k’)dt = conditional probability of a transition at t dt, given that the preceding transition occurred at t’ and that the state thereby entered was k’.C(k k’; t) = conditional probability that the plant enters state k, given that a transition occurred at time t when the system was in state k’.Both these probabilities form the ”trasport kernel”:
K(t; k t’; k’)dt = T(t t’; k’)dt C(k k’; t)
(t; k) = ingoing transition density or probability density function (pdf) of a system transition at t, resulting in the entrance in state k
Stochastic Transitions: Governing
Probabilities
61The von Neumann’s Approach and
the Transport Equation
61
The transition density (t; k) is expanded in series of the partialtransition densities:n(t; k) = pdf that the system performs the n−th transition at t, entering the state k.Then,
Transport equation for the plant states
+=
==
=
'
0
0
0
)','|,()','('),(
),(),(
k
t
t
n
n
ktktKktdtkt
ktkt
62
)**,,(),,(),(),( 11001100
0
*011
1
0
1
ktktKktktKktdtktk
t
t==
),,()**,,(
),,(),(),(
112211*
1
112211
1
*122
2
1
2
1
2
ktktKktktKdt
ktktKktdtkt
k
t
t
k
t
t
=
==
……
),,(),,(*)*,,(...
...),(
11112211*
1
*2
,...,,*
1
2
1
121
−−
−−
=
−
−
nn
t
t
t
tn
kkk
t
tn
n
ktktKktktKktktKdt
dtdtktn
n
n
Initial Conditions: (t*, k*)
Formally rewrite the partial transition densities:
Monte Carlo Solution to the Transport
Equation
63
•MC analog dart game: sample x = (t1, k1; t2, k2; ...) from
f(x)=
•
•the probability that a shot hits x dx is f(x)dx
• the award is g(x)=1
Consider N trials with result {x1, x2, …,xn}: the average award is
( )=
=N
i
iN xgN
G1
1
( ) ( )
( ) ( ) ( ) 1 ; 0 pdf =→
=
dxxfxfxf
dxxfxgGb
a
),,(),,(*)*,,( 11112211 −− nn ktktKktktKktktK
MC Evaluation of Definite Integrals
64
Sampling
Evaluation of definite integrals
Simulation of system stochastic process
Contents
Simulation for system reliability/availability analysis
65
Monte Carlo Simulation in RAMS
=k
t
k dtRktG0
),(),()(
• = subset of all system failure states
• Rk(,t) = 1 G(t) = unreliability
• Rk(,t) = prob. system not exiting before t from the state k
entered at <t
G(t) = unavailability
Monte Carlo solution of a definite integral:
expected value sample mean
Expected value
66
A real example of Indirect Simulation
PRODUCTION AVAILABILITY EVALUATION OF AN
OFFSHORE INSTALLATIONZio, E., Baraldi, P., Patelli E. Assessment of the availability of an offshore installation by Monte Carlo simulation. International
Journal of Pressure Vessels and Piping 83 (2006) 312–320
68
2.2 MSm3/d
2.2 MSm3/d
4.4 MSm3/d
Production Gas : 5 MSm
3/d
Oil : 26500 Sm3/ d
Water : 8000 Sm3/d
4.4 MSm3/d
23300 Sm3/d
7000 Sm3/d
TC
TEG
Fuel Gas 25 b
50%
50%
Gas Lift 100b
Wells Separation
50%
50%
Gas Lift 60b
Gas Export 3.0 MSm
3/d, 60b
Oil export
TC
Flare
EC
Oil Trt °
TG
TG
Water Inj . Sea Wat . Trt °
13 MW
13 MW
7 MW
7 MW
6 MW
6 MW
0.1
MSm3
0.1
MSm3
0.1
MSm3
0.1
MSm3
1
MSm3/d
The offshore production plant
69
State 0 = as good as new
State 1 = degraded (no function lost, greater failure rate value)
State 2 = critical (function is lost)
2
12
02
m20
0 1
01
m10
TC TG
01 0.89 · 10-3 h-1 0.67 · 10-3 h-1
02 0.77 · 10-3 h-1 0.74 · 10-3 h-1
12 1.86 · 10-3 h-1 2.12 · 10-3 h-1
m10 0.033 h-1 0.032 h-1
m20 0.048 h-1 0.038 h-1
Component failures and repairs:
TCs and TGs
70Component failures and repairs:
EC and TEG
0 2
m
State 0 = as good as new
State 2 = critical (function is lost)
EC TEG
0.17 · 10-3 h-
1
5.7 · 10-5 h-1
m 0.032 h-1 0.333 h-1
71
Production priority
When a failure occurs, the system is reconfigured tominimise (in order):
• the impact on the export oil production
• the impact on export gas production
➢ The impact on water injection does not matter
72
2.2 MSm3/d
2.2 MSm3/d
4.4 MSm3/d
Production Gas : 5 MSm
3/d
Oil : 26500 Sm3/ d
Water : 8000 Sm3/d
4.4 MSm3/d
23300 Sm3/d
7000 Sm3/d
TC
TEG
Fuel Gas 25 b
50%
50%
Gas Lift 100b
Wells Separation
50%
50%
Gas Lift 60b
Gas Export 3.0 MSm
3/d, 60b
Oil export
TC
Flare
EC
Oil Trt °
TG
TG
Water Inj . Sea Wat . Trt °
13 MW
13 MW
7 MW
6 MW
0.1
MSm3
0.1
MSm3
0.1
MSm3
0.1
MSm3
1
MSm3/d
Production priority: example
73
Maintenance policy: reparation
Only 1 repair team
Priority levels of failures:1. Failures leading to total loss of export oil (both TG’s or both TC’s
or TEG)
2. Failures leading to partial loss of export oil (single TG or EC)
3. Failures leading to no loss of export oil (single TC failure)
74Maintenance policy: preventive
maintenance
➢ Only 1 preventive maintenance team
➢ The preventive maintenance takes place only if the system is in perfect state of operation
Type of maintenance Frequency [hours] Duration [hours]
Type 1 2160 (90 days) 4
Type 2 8760 (1 year) 120 (5 days) Turbo-Generator and
Turbo-Compressors Type 3 43800 (5 years) 672 (4 weeks)
Electro Compressor Type 4 2666 113
75
Number of components = 6
Number of states for component = 2 or 322·34 = 324 plant states
+1 repair team 129 new plant states
1 maintenance team Non homogeneous Markov chain
+
MONTE CARLO APPROACH
Markov approach too complex
MARKOV APPROACH
76
Mean Std
Oil [k
m3/d]23.230 0.263
Gas[k Sm3/d]
2929 194.0
Water[k m3/d]
6.811 0.883
P.Maintenance Type 1 (TC,TG)
P.Maintenance Type 2 (EC)
P.Maintenance Type 3(TC,TG)
Case A: perfect system and preventive
maintenances
77
Questions & Answers