230 B. SAMPLES OF MATLAB
®
PROGRAMS
tr=0.826*Rka(k)*Rse(k)-369*RMa(k)/(61.5*Rb(k)*Rh(k)^2-123);
if tr>0
% Number of the safe status
nn=nn+1;
end
end
% Reliability of the component
R=nn/N
% The failure probability of the component
F=1-R
% The percent relative error of the failure probability
rerror=2*(R/N/F)^0.5
% The range of the error for the failure probability
% and the reliability
erange=F*rerror
B.4 THE M-H-L METHOD FOR EXAMPLE 3.3
% The modified H-L method for Example 3.3
% The Limit State function:
% g(Sy,F,Kt, d)=Sy-Kt*4*F/(pi*d^2)
clear; %Clear the momery
% Input the distribution parameters m-first or mean,
% s-second or standard deviation
mx=[32.2,28.72];
sx=[3.63,2.87];
% Prelimary design for Kt
mx(3)=1.9; % Preliminary Kt
sx(3)=1.9*0.05; % The stadard deviation of Kt
D=3.25; % Bigger diameter in the stress
% concentration area
r=0.125; % Fillet radius
sd=0.00125; % Standard deviation of dimension d
R=0.99; % The required reliability
beta=norminv(R); % Reliability index
% The initial design point x0(i), i=1,...,3
for i=1:3
x0(i)=mx(i);
end
B.4. THE M-H-L METHOD FOR EXAMPLE 3.3 231
% Use the limit state function to determine x0(4)
x0(4)=(4*x0(3)*x0(2)/pi/x0(1))^0.5;
% Store initial design point
for i=1:4
dpp(1,i)=x0(i);
end
% Iterative process
for j=2:1000
% The Tylor series coefficent
G1=sx(1)*1;
G2=sx(2)*(-4)*x0(3)/pi/x0(4)^2;
G3=sx(3)*(-4)*x0(2)/pi/x0(4)^2;
Gd=sd*8*x0(3)*x0(2)/pi/x0(4)^3;
G0=(G1^2+G2^2+G3^2+Gd^2)^0.5;
%Calculate the new design point
x1(1)=mx(1)+sx(1)*beta*(-G1)/G0;
x1(2)=mx(2)+sx(2)*beta*(-G2)/G0;
x1(3)=mx(3)+sx(3)*beta*(-G3)/G0;
% Use the limit state function to determine x1(4)
x1(4)=(4*x1(3)*x1(2)/pi/x1(1))^0.5;
% Update the dimension-dependent Kt
dd=x1(4)-sd*beta*(-Gd)/G0; % New value for
% the dimension
mx(3)=StressAxial( D, dd, r ); % Update Kt
sx(3)=0.05*mx(3);
% Data of iterative process
for i=1:4
dpp(j,i)=x1(i);
end
dpp(j,4+1)=abs(dpp(j,4)-dpp(j-1,4));
% Check the convengence condition
if dpp(j,4+1)<=0.0001;
break
end
% Use new design point to replace previous
% design point
for i=1:4
x0(i)=x1(i);
end
..................Content has been hidden....................

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