232 B. SAMPLES OF MATLAB
®
PROGRAMS
end
% Display reliability
format short e
% Displaye iterative process and write it to
% Excel file
disp(dpp)
xlswrite('example6.3',dpp)
%Display the mean of the dimension
dmean=x1(4)-sd*beta*(-Gd/G0)
% the end of the program
% The stress concentration Kt for a stepped shaft under
% axial loading.
function [ kt ] = StressAxial( D, d, r )
Dt = [2.0 1.5 1.3 1.2 1.15 1.1 1.07 1.05 1.02 1.01]';
At = [1.01470 .99957 .99682 .96272 .98084 .98450 .98498
1.00480 1.01220 .98413]';
bt = [-.30035 -.28221 -.25751 -.25527 -.24485 -.20818
-.19548 -.17076 -.12474 -.10474]';
% Compute the diameter ratio and then interpolate A and
% b from the tables
DD = D / d;
A = interp1 (Dt, At, DD);
b = interp1 (Dt, bt, DD);
% Compute the stress concentration factor
kt = A * (r / d) ^ b;
end
B.5 THE M-R-F PROGRAM FOR EXAMPLE 3.5
% The Modified R-F method for Example 3.5
% The Limit State function:
% g(T, Ssy, Kts, d)=Ssy-Kts*16T/(pi*d^3)
clear
% Input the distribution parameters
mx=[20,31]; % Mean or the first parameter
sx=[3,2.4,]; % Stadard deviatio or the second parameter
% Prelimary design for Kts
mx(3)=1.6; % Preliminary Kts
sx(3)=1.6*0.05; % The stadard deviation of Kts
B.5. THE M-R-F PROGRAM FOR EXAMPLE 3.5 233
sd=0.00125; % The standard deviation of dimension
R=0.99; % The required reliability
beta=normcdf(R), % Reliability index beta
D=3.25; % The bigger radius in stress
% concentration area
r=1/16; % The fillet radius
% Calculate the mean of T (Weibull) and the initial
% point x0(i)
% Initial design point
x0(1)=mx(1)*gamma(1/sx(1)+1);
x0(2)=mx(2);
x0(3)=mx(3);
% Use the limit state function to determine x0(4)
x0(4)=(16*x0(1)*x0(3)/pi/x0(2))^(1/3);
% Store initial design point
for i=1:4
ddp(1,i)=x0(i);
end
% Iterative process starting
for j=2:1000
% Calculate the equivalent mean and standard deviation
zteq=norminv(wblcdf(x0(1),mx(1),sx(1)));
steq=normpdf(zteq)/wblpdf(x0(1),mx(1),sx(1));
mteq=x0(1)-zteq*steq;
% Mean and standard deviation matrix at the
% design point
meq(1)=mteq;
seq(1)=steq;
for i=2:3
meq(i)=mx(i);
seq(i)=sx(i);
end
% Calculate the Taylor Series Coefficient
G1=-seq(1)*16*x0(3)/pi/x0(3)^3;
G2=seq(2);
G3=seq(3)*(-16)*x0(1)/pi/x0(4)^3
Gd=sd*48*x0(1)/pi/x0(3)^4;
G0=(G1^2+G2^2+G3^2+Gd^2)^0.5;
% New design proint
234 B. SAMPLES OF MATLAB
®
PROGRAMS
x1(1)=-seq(1)*beta*G1/G0+meq(1);
x1(2)=-seq(2)*beta*G2/G0+meq(2);
x1(3)=-seq(3)*beta*G3/G0+meq(3);
% Use the limit state function to determine x1(4)
x1(4)=(16*x1(1)*x0(3)/pi/x1(2))^(1/3);
% Update the stress concentration factor
dd=x1(4)-sd*beta*(-Gd)/G0; % the new value of the
% dimension
mx(3)=StressTorsion( 3.25, dd, r );
s(3)=0.05*mx(3);
%store iterative process
for i=1:4
ddp(j,i)=x1(i);
end
ddp(j,4+1)=abs(ddp(j-1,4)-ddp(j,4));
% Check the convengence condition
if ddp(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
end
format short e
% Display e iterative process and write it to Excel file
disp(ddp)
xlswrite('example6.5',ddp)
display('mean of the dimension with given reliability')
md=x1(4)-sd*beta*(Gd/G0)
% This routine computes the stress concentration factor
% for an torsional load
function [ kt ] = StressTorsion( D, d, r )
Dt = [2.0 1.33 1.20 1.09]';
At = [.86331 .84897 .83425 .90337]';
bt = [-.23865 -.23161 -.21649 -.12692]';
% Compute the diameter ratio and then interpolate A and
% b from the tables
DD = D / d;
..................Content has been hidden....................

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