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