A.3. THE MONTE CARLO METHOD FOR EXAMPLE 3.14 245
R=normcdf(beta0)
% Display iterative process and write it to Excel file
disp(ddp)
xlswrite('example3.13',ddp)
A.3 THE MONTE CARLO METHOD FOR EXAMPLE 3.14
% Monte Carlo Method for Example 3.14
% Limit State function: g(Sy,P1,P2,d)
% =Sy-(4P1)/(?d^2 )-(4P2)/(?d^2 )
clear
% Input the data
msy=61.5;% mean of the yield strength
ssy=5.95;% standard deviation of the yield strength
mp1=10.2;% mean of the force P1
sp1=1.2;%standard deviation of the force P1
cp2=4.5;%the scale parameter of the force P2
sp2=1.5;%the shape function of the force P2
md=0.75;% mean of the diameter
sd=0.003;% standard deviation of diameter
% The trial number N
N=1598400;
% Generate the sample data for each random variable
Rsy=random('norm',msy,ssy,1,N); % the sampling for yiled strength
Rp1=random('norm',mp1,sp1,1, N); % Random sampling for force p1
Rp2=random('wbl',cp2,sp2,1,N); % Random sampling for force p2
Rd=random('norm',md,sd,1,N); % Random sampling for dimension d
% Start the Monte Carlo Method
for J=1:N
gJ=Rsy(J)-4*Rp1(J)/pi/Rd(J)^2-4*Rp2(J)/pi/Rd(J)^2;
if gJ >= 0
NT(J)=1;
else
NT(J)=0;
end
end
% Calculate the reliability
RR=0
for J=1:N
246 A. SAMPLES OF MATLAB
®
PROGRAMS
RR=RR+NT(J);
end
display ('Reliability R')
R=RR/N
display ('The relative error')
rerror=2*(R/N/(1-R))^0.5
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.218.215