% Script to solve the temperature DE

% Just try using the derivative function: put in T, get back rate of
% change.
T_0 = 40;  % initial temperature
dT_dt = tempDE(0, T_0);
fprintf('The object is initially cooling from %.1f deg at a rate of %.3g deg/hour\n', T_0, dT_dt);

% Now use the built-in DE solver 'ode45' to generate a long-term prediction
% of the temperature
[t, T] = ode45(@tempDE, [0, 100], T_0);

plot(t, T);
xlabel('Time (hours)');
ylabel('Temp (^o C)');
ylim([0, T_0]);


