In: Mechanical Engineering
The useful life of a machine bearing depends on its operating temperature, as the following data show. Obtain a functional description of these data. Plot the function and the data on the same plot. Estimate a bearing’s life if it operates at 150°F.
Program plan:
• To write a matlab code to fit the given data of temperature and bearing life with a most suitable function.
• To find the bearing life if it operated at 150 Fahrenheit using the function.
Program:
%**********************************************************
%A matlab code is written to fit the given date using the
%suitable equation and find the life of bearing which
%operates at a temperature. The given date and the function
%are plotted and labeled properly.
%**********************************************************
%Program codes
%Declaration of array
T=100:20:220;
%Declaration of array
life=[28 21 15 11 8 6 4];
%Curve fitting, computes the value of coefficient
p=polyfit(T,log10(life),1);
%Computes the value
life1=10.^polyval(p,T);
%Displays text
disp(\'The life of bearing when the temperature is 150 F is\');
%Displays value
disp(10.^polyval(p,150));
%Plotting
plot(T,life,\'.\',T,life1,150,10.^polyval(p,150),\'*\')
%Assigns text to x-axis
xlabel(\'Temperature\')
%Assigns text to y-axis
ylabel(\'Bearing life\')
Output:
>> Untitled
The life of bearing when the temperature is 150 F is
12.8284.
Output:
>> Untitled
The life of bearing when the temperature is 150 F is
12.8284.