B.6. THE MODIFIED MONTE CARLO METHOD FOR EXAMPLE 3.7 235
if (DD > Dt(1))
DD = Dt(1);
end
if (DD < Dt(4))
DD = Dt(4);
end
A = interp1 (Dt, At, DD);
b = interp1 (Dt, bt, DD);
% Compute the stress concentration factor
kt = A * (r / d) ^ b;
end
B.6 THE MODIFIED MONTE CARLO METHOD FOR
EXAMPLE 3.7
%The modified Monte Carlo method for Example 3.7
%Limit state function g(Sy,F,d)=Sy-4F/(pi*d^2)
%Input data
clear
mx=[34.5,7.0]; % The first parameter or mean
sx=[3.12,9.0]; % The second parameter or mean
sd=0.00125; % The standard deviation of the dimension
R=0.99; % The required reliability
% The first value for mean of d
xstar=norminv(1-R,mx(1),sx(1));
% Mean for F
mf=(mx(2)+sx(2))/2;
% The initial value of the dimension
mdd=(4*mf/pi/xstar)^0.5
N=15998400; % the trial number
Rsy=random('norm',mx(1),sx(1),1,N); % Random samples
% for Sy
Rf=random('unif',mx(2),sx(2),1,N); % Random samples
% for F
for K=1:2000
nn=0;
K
md=mdd+0.001; % Iterative dimension with an
% incremental 0.001"
236 B. SAMPLES OF MATLAB
®
PROGRAMS
Rd=random('norm',md,sd,1,N); % Random samples for d
for j=1:N
fj=Rsy(j)-4*Rf(j)/pi/Rd(j)^2; % Value of the limit
% state function
if fj>0
nn=nn+1;
end
end
Rstar=nn/N; % the reliability of component with d
% Store the iterative process
dpp(K,1)=md;
dpp(K,2)=Rstar;
dpp(K,3)=Rstar-R;
% Check the convergence condition
if dpp(K,3)>0.0001
break
end
mdd=md;
end
format short e
% Displaye iterative process and write it to Excel file
disp(dpp)
xlswrite('example6.7',dpp)
display('The mean of the dimension with the required reliability')
md
..................Content has been hidden....................

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