When an object with an initial temperature T is placed in a substance that has a temperature S, according to Newton’s law of cooling in t minutes it will reach a temperature Tt using the formula Tt = S + (T – S) e(-kt) where k is a constant value that depends on properties of the object. For an initial temperature of 100 and k = 0.6, graphically display the resulting temperatures from 1 to 10 minutes for two different surrounding temperatures: 50 and 20. Use the plot function to plot two different lines for these surrounding temperatures, and store the handle in a variable. Note that two function handles are actually returned and stored in a vector. Change the line width of one of the lines.
Ch12Ex13.m
% Plot the cooling temperatures of an object placed in
% two different surrounding temperatures
time = linspace(1,10,100);
T1 = 50 + (100 - 50)*exp(-0.6*time);
T2 = 20 + (100 - 20)*exp(-0.6*time);
hdl = plot(time,T1,'b-',time,T2,'r-');
xlabel('Time')
ylabel('Temperature')
legend('50 degrees', '20 degrees')
set(hdl(1),'LineWidth',3)
need an explanation for this answer? contact us directly to get an explanation for this answer