80 likes | 268 Views
A Different Type of Monte Carlo Simulation. Jake Blanchard Spring 2010. Introduction. We can use Monte Carlo simulation to study the reliability of a complex system Assign a failure probability (p) to each component Sample a uniform number between 0 and 1
E N D
A Different Type of Monte Carlo Simulation Jake Blanchard Spring 2010 Uncertainty Analysis for Engineers
Introduction • We can use Monte Carlo simulation to study the reliability of a complex system • Assign a failure probability (p) to each component • Sample a uniform number between 0 and 1 • If this number is less than p, assume the component failed • Use logic to handle redundancy, etc. Uncertainty Analysis for Engineers
Example • Consider a 3-stage process, as diagrammed below • Our goal is to find the probability of success of the entire operation, assuming all individual probabilities are independent • Branches represent parallel redundancy, so success in a stage requires success of, for example, A or B Pr(A)=0.9 Pr(D)=0.9 A D E C Pr(E)=0.9 B Pr(C)=0.95 F Pr(F)=0.5 Pr(B)=0.8 Uncertainty Analysis for Engineers
Solution • Pr(S)=Pr(I)Pr(II)Pr(III) • where I, II, and III represent the three stages of the system • Pr(I)=Pr(A)+Pr(B)-Pr(AB)=0.9+0.8-0.9*0.8=0.98 (success requires A or B to succeed) • Pr(II)=Pr(C)=0.95 • Pr(III)=Pr(D)+Pr(E)+Pr(F)-Pr(DE)-Pr(EF)-Pr(DF)+Pr(ABC)=0.9+0.9+0.5-0.9*0.9-0.9*0.5-0.9*0.5+0.9*0.9*0.5=0.995 • So, Pr(S)=0.98*0.95*0.995=0.926 Uncertainty Analysis for Engineers
Script pa=0.9; pb=0.8; pc=0.95; pd=0.9; pe=0.9; pf=0.5; n=10000000 ag=rand(n,1)<pa; bg=rand(n,1)<pb; cg=rand(n,1)<pc; dg=rand(n,1)<pd; eg=rand(n,1)<pe; fg=rand(n,1)<pf; Ig=ag|bg; IIg=cg; IIIg=dg|eg|fg; allgood=mean(Ig&IIg&IIIg) Uncertainty Analysis for Engineers
Another Example • What if 2 events are not independent? • Consider the system below, where event G is in both stages Pr(G)=0.9 G G H J Pr(H)=0.8 Pr(J)=0.7 Uncertainty Analysis for Engineers
Solution • Pr(S)=Pr(G)+Pr(HJ)-Pr(G)*Pr(HJ) • So, Pr(S)=0.9+0.8*0.7-0.9*0.8*0.7 • Pr(S)=0.956 Uncertainty Analysis for Engineers
Script clear all pg=0.9; ph=0.8; pj=0.7; n=10000000 gg=rand(n,1)<pg; hg=rand(n,1)<ph; jg=rand(n,1)<pj; Ig=gg|hg; IIg=gg|jg; allgood=mean(Ig&IIg) Uncertainty Analysis for Engineers