In the manufacturing of ball bearings, the components, such as the ball, are har
ID: 3792604 • Letter: I
Question
In the manufacturing of ball bearings, the components, such as the ball, are hardened through a process of heating and then rapid cooling or "quenching" by submersion in an oil or water bath. The temperature of the ball as a function of time, T(t), in the bath may be estimated as: T(t) = (T_i - T_infinity)e^-t/tau + T_infinity where t is the time in seconds in the bath; T_i is the initial ball temperature; T_infinity is the oil temperature; and tau is the time constant in seconds and depends upon the material of the ball, the geometry of the ball, and oil properties. Write a MATLAB function that utilizes T_i; T_infinity; tau; and three separate times, t, as input arguments and returns the ball temperature for the three times as a one-dimensional array. Assuming an initial ball temperature of 1000^degree C, an oil temperature of 60^degree C, and the time constant tau = 60 s, determine the ball temperature for times of 1, 10, and 100 seconds.Explanation / Answer
%matlab code
function ballTemp = getBallTemp(initialTemp,oilTemp,tow)
ballTemp = [];
t = input('Enter t: ');
ballTemp(1) = (initialTemp - oilTemp)*exp(-1*t/tow) + oilTemp;
t = input('Enter t: ');
ballTemp(2) = (initialTemp - oilTemp)*exp(-1*t/tow) + oilTemp;
t = input('Enter t: ');
ballTemp(3) = (initialTemp - oilTemp)*exp(-1*t/tow) + oilTemp;
end
initialTemp = 1000;
oilTemp = 60;
tow = 60;
ballTemp = getBallTemp(initialTemp,oilTemp,tow);
fprintf('Ball temperature for t = 1 is %f C ',ballTemp(1));
fprintf('Ball temperature for t = 10 is %f C ',ballTemp(2));
fprintf('Ball temperature for t = 100 is %f C ',ballTemp(3));
%{
output:
Enter t: 1
Enter t: 10
Enter t: 100
Ball temperature for t = 1 is 984.463167 C
Ball temperature for t = 10 is 855.692821 C
Ball temperature for t = 100 is 237.543067 C
%}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.