Professional Documents
Culture Documents
theoretical view
Introduction
Buffon
Kelvin
Gosset (Student)
170788
18241907
1908
193040s
1950s
1990s
Y
S
P( F ) P( x F ) I F ( x)q( x)d x
x :T
hot
out,core
x :T
x 1200 C
avg
out,core
Tout,core
x 850 C
Residual Heat in
Reactor Core
radiation
Water-Cooled Wall
Natural circulation
Air-Cooler in the
Tower
Atmosphere
37 Inputs
natural convection
Problem statement
Description of phenomena Adoption of mathematical models
(which are for example turned into
operative computer codes for simulations)
Models Deterministic or Stochastic
y = m(x)
m(x)
y = m(x)
x = vector of n uncertain input
parameters
m(x) = model structure
Deterministic (e.g., advection-dispersion equation, Newton law)
(e.g., Poisson model, exponential model)
Stochastic
y = output vector correspondent
to x and m(x)
11
Fuel cladding
Temperature, Y(x)
NT independent runs
Failure threshold, Y
S
Time
System
performance indicator, Y(x)
number Y x Y
Sample estimate of the failure probability P(F), P F
NT
12
numberY x Y
P F
NT
LONG CALCULATIONS!
+
UNCERTAINTY/CONFIDENCE
13
Issues:
TRANSIENTS
GENERATION
Solutions:
Advanced MC Simulation
methods
1. Subset Simulation (SS)
2. Line Sampling (LS)
Order statistics
Long calculations
Meta-models (e.g. Artificial Neural Networks)
1. Identification of important directions for pointing towards the failure region FD
2. Pre-selection of failure transients
Contents
SAMPLING RANDOM
NUMBERS
f T ( t ) e t
t0
t0
fT(t)
fT (t ) e t
Var[T ]
2
t
X FX1 R
FX x 1 ex
R FX x 1 ex
X FX1 R
ln 1 R
x0 , x1 ,..., xk ,...
k
Fk P X xk P X xi
i 0
sample an R ~ U [0,1)
Graphically:
Arc number i
1
2
3
4
5
Failure
probability Pi
0.050
0.025
0.050
0.020
0.075
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
Analytic solution
B
1
S
3
B
1i
1 p
R
S
We calculate the arrival state for all the arcs of the newtork
As a result of these transitions, if the system falls in any configuration
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
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
P[ X T 1] 3.04 103
SIMULATION OF SYSTEM
TRANSPORT
Phase Space
C R (t ) C R (t ) t 0, TM
C R (t ) C R (t ) 1 t , TM
C R (t ) C R (t ) 1 t , TM
C R (t ) C R (t ) t 0, TM
R
Events at components
level, which do not entail
system failure
C (t )
FT (t )
M
1
m
State 2
State 1
State X=1 ON
State X=2 OFF
1
m
State 2
State 1
State X=1 ON
State X=2 OFF
1
m
State 2
State 1
State X=1 ON
State X=2 OFF
values
2
3 10-3 h-1
25 10-3 h-1
State X=1 ON
State X=2 OFF
Limit unavailability:
1/ m
U
0.1071
1/ m 1/
Trial 1
Trial 1
Trial i-th
Trial 1
Trial i-th
Trial M-th
GA (t j )
Trial 1
Trial i-th
Trial M-th
GA (t j )
c A (t j )
M
Pseudo Code
%Initialize parameters
Tm=mission time; Nt=number of trials; Dt=bin length;
Time_axis=0:Dt:Tm;
0.8
Unavailability
Falta de disponibilidad
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
nico
Singleensayo
trial
Monte CarloMonte
simulation
Simulacion
Carlo
Limit de
unavailability
Falta
disponibilidad en estado estacionario
0.6
0.4
0.2
0
0
100
200
300
400
500
Tiempo
Time
600
700
800
900
1000
Phase Space
A
C
B
Initial
Arrival
2
1A( B2)
1A( B3)
21
( B)
2A
3
3A( B1)
A( B )
3A( B2)
Initial
Arrival
1
C
1
2
C
1
3
C
1
4
C21
C23
C24
C31
C32
C34
C41
C42
C43
where Rt ~ U[0,1)
1,1,1
ln(1 Rt )
1A ,
1,1,1
1B ,
1,1,1
1C
1,1,1
Thus, we can apply the inverse transform method to the discrete distribution
1A C
1,1,1
R
C
1B
1,1,1
1C
1,1,1
1
B
1
3
B
1
S
R
RSU[0,1)
1 3 1
t 2 t1
1,3,1
ln(1 Rt )
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.
A
C
B
For any arbitrary trial, starting at t=0 with the system in nominal
configuration (1,1,1) we would sample all the transition times:
i A, B, C
1
i
i
ln(1 Rt ,1mi )
t1mi t 0 i
m
2
,
3
for
i
A
,
B
i
1mi
mi 2,3,4 for i C
i
where Rt ,1mi ~ U [0,1)
A
C
B
Example (2)
A
3m A
t1
A
3m A
ln(1 R
A
t , 3m A
k 1,2
A
Rt ,3m A ~ U [0,1)
Contents
Sampling
Evaluation of definite integrals
Simulation of system transport
Simulation for reliability/availability analysis
Contents
Sampling
Evaluation of definite integrals
Simulation of system transport
Simulation for reliability/availability analysis
Buffons needle
P P Y L sin
fY ( y )
f ( )
P
1
D
1
y [0, D]
[0, ]
dy d
L/D
A D / 2
cdf :
U R r PR r r
pdf :
u R r
0
dU R r
1
dr
R ~ U [0,1)
xi axi 1 c mod m
Where
a, c [0, m 1]
m 1
ri
xi
m
Example: a = 5, c = 1, m = 16
x0 2 r0
2
16
x1 (5 2 1) mod 16 11 r1
...
x15 13 r15
x16 2
13
16
11
16
PrR r U R r
X FX1 R
r
1 R
PX x PFX1 R x
PX x PR FX x FX x
Summary: From an R UR(r) we obtain an X FX(x)
FT t PT t 1 et
pdf fT t dt Pt T t dt et dt
Sampling a failure time T
R FR r FT t 1 et
1
T
T F
ln 1 R
pdf fT t dt P t T t dt t 1e t dt
Sampling a failure time T
R FR r FT t 1 e
T F R ln 1 R
1
T
x0 , x1 ,..., xk ,...
k
Fk P X xk P X xi
i 0
sample an R ~ U [0,1)
P Fk 1 R Fk FR ( Fk ) FR ( Fk 1 )
R ~ U [0,1) and FR (r ) r
P Fk 1 R Fk Fk Fk 1 f k P X xk
Graphically:
Contents
Sampling
Evaluation of definite integrals
Simulation of system transport
Simulation for reliability/availability analysis
G g x f x dx
b
f x pdf
f x 0 ;
f x dx 1
1
GN
N
g x
i 1
0.6366198
0 2
By setting: f
x 1,
G E g ( x)
g x cos x
2
2
cos
x
dx
0
2
1
Var GN
Var
g x
N
2
1 1 2
Var GN
N
2
E
g ( x)
1
2
1
2
2
E
g
(
x
)
E
g
(
x
)
N
1
9.47 10 2
N
f x
G
g x f1 x dx g1 x f1 x dx
D
D
f1 x
f x
g1 x
g x
f1 x
G1N
1 N
g1 xi
N i 1
2
0
1
f ( x)dx a bx 2 dx 1 a
*
1
b
1 b 3(a 1)
3
f1* ( x) a 3(a 1) x 2
G cos
0
xdx
cos
3
1.5
2
x 1
2
2
(1.5
1.5
x
) dx
2
1.5 1.5 x
0
f ( x)
g1 ( x )
2 1
4
0.406275 9.9026 10
N
cos xi
2
for N 104 histories, xi ~ f1* g1 xi
1.5 1.5 xi2
Contents
Sampling
Evaluation of definite integrals
Simulation of system transport
Simulation for reliability/availability analysis
(t , k ) n (t , k )
n 0
k0
t*
(t 2 , k 2 ) dt1 1 (t1 , k1 ) K (t 2 , k 2 t1 , k1 )
t2
k1
t*
t*
k1
(t , k )
n
k1 ,k 2 ,...,kn 1
t2
tn
t*
dtn 1
tn 1
t*
dtn 2 ...
G g x f x dx
b
f x pdf
f x 0 ;
f x dx 1
MC analog dart game: sample x = (t1, k1; t2, k2; ...) from
f(x)= K (t1 , k1 t*, k*)K (t2 , k2 t1 , k1 ) K (t , k tn1 , kn1 )
1
GN
N
g x
i 1
Contents
Sampling
Evaluation of definite integrals
Simulation of system transport
Simulation for reliability/availability analysis
G(t ) ( , k ) Rk ( , t )d
t
Expected value
References