1

I want to calculate the probability of failure, pf adopting the monte carlo method.

The limit state equation is obtained by comparing the substance content at a time t, C(x=a,t), and the critical content, Ccrit:

LSF: g(Ccrit, C(x=a,t)) = Ccrit - C(x=a, t) < 0

Ccrit follows a beta distribution Ccrit~B(mean=0.6, s=0.15, a=0.20, b=2.0). Generated distribution:

r=((mean-a)/(b-a))*((((mean-a)*(b-mean))/(s^2))-1)
t=((b-mean)/(b-a))*((((mean-a)*(b-mean))/(s^2))-1)
Ccrit=beta.rvs(r,t,a,b,1e6)

C(x=a, t) is function of 11 other variables (beta, normal, deterministic, lognormal etc) and varies with time t. These variables have been defined adopting scipy.stats eg:

Var1=truncnorm.rvs(0, 1000, 60e-3, 6e-3, 1e6)

(...)

Var11=Csax=dist.lognormal(l, z, 1e6)

After all the variables are generated I am having difficulty computing the pf.

I have seen that:

P(Ccrit < C) = integral -inf to +inf Fccrit(c) * fC(c) dc

leads to the pf but I am clueless on how to calculate it.

Will appreciate your help,

Thank you

NFil
  • 13
  • 3

1 Answers1

1

Well, how I understood your question, this is the way to compute the probability of failure from crude Monte Carlo simulation:

pf = sum(I(g(x))/N 

where:
N      - is the number of simulations
x      - is the vector of all the involved random variables
I(arg) - is an indicator function, defined as:

   if arg < 0
     I = 1
   else
     I = 0
   end

The simulation methods are basically invented to circumvent complicated or impossible integrals, no need in this case for the integration you mentioned.

Keep in mind that the coefficient of variation of the estimate is proportional to 1/sqrt(N).

I tried to be clear as possible with the notations, in case it is problematic to follow, see this lecture notes for better formatting. I assumed you used crude Monte Carlo, but for importance sampling you can find the formulas in the linked source as well.

The above formulation is time-invariant; the fact that your problem involves time makes the task much harder in general. The solution technique depends on the time-variance, because no details are given in this regard I can only recommend you a book (Melchers, Structural Reliability Analysis and Prediction) where the question is treated in details:

In general, time-variant problems can be reduced (at least in an approximate manner) to time-variant problems and the above formulation can be used. Or you might calculate the probability of failure in every time moments with the above sketched 'method' if that makes sense for your problem.

Because C is substance content the problem might contain no stochastic process but only a monotonically increasing (in time) random variable, in this case the probability of failure is the time-invariant probability of failure at the last time instant (when the concentration is closest to the critical value), so the above mentioned Monte Carlo technique could be directly used. This type of problem is called right-boundary problem, more details: Construction Reliability: Safety, Variability and Sustainability. Chapter 10.

If this is not you want to accomplish please give us more details.

rozsasarpi
  • 1,621
  • 20
  • 34
  • Arpi, thanks it worked. Really easy after reading your suggestion. I've used the following: `g=Ccrit - C` `N=1e6` `#pf probability of failure` `numbers = g` `I=sum(1 for number in numbers if number < 0)` `pf = I/N` – NFil Nov 10 '14 at 09:40
  • @NFil I'm glad I was able to help. How did you handle time? – rozsasarpi Nov 10 '14 at 09:44
  • Parametrically. Basically I had to set up x number of equations and solve them separately for each time step. So time ends up being a constant, because what I am looking for is the failure at a specific moment. I have plotted the function against known results derived using reliability analysis software (FORM) and the results match perfectly. Once again thank you for your help. P.S. I am using 10^6 simulations, which should be ok for the probability of failure I am looking for (to stay within the limits of 10%). – NFil Nov 11 '14 at 12:03
  • @NFil Looks good to me. Your problem sounds like probabilistic analysis of corrosion (e.g. carbonation, chloride diffusion) of concrete or something like that. Or I see into it because I am interested in that.. – rozsasarpi Nov 11 '14 at 12:21
  • indeed you're right again:) btw, I have already ordered Melchers from Amazon. – NFil Nov 11 '14 at 14:53
  • @NFil I have made some (limited) research on the mentioned topic (corrosion of concrete + reliability), if you are interested I would be glad to share experience. In that case you can find contact info in my profile. – rozsasarpi Nov 11 '14 at 15:17