% Solution to First Order Equation	of the form:
%
% dT/dt = - H * (T - Ta)
%
% subject to initial conditions:
%
% T (t=0) = To
%
% where: 
% H is a cooling constant (1/time)
% T is the temperature of the element of interest (deg C)
% Ta is the ambient temperature (deg C)

global Ta H

% Define Initial Conditions of the Problem

To = 200;			% To is the initial temperature of the fin
to = 0.0;			% to is the initial time to solve this equation
tf = 50;			% tf is the final time

% define T ambient (Ta) and cooling constant (H)

Ta = 30;
H = 0.10;
tspan =[to tf];

[t,T] = ode23('ftem',tspan,To);

% Plot the results of the numerical integration procedure

plot(t,T)
xlabel('Time (min)')
ylabel('Temperature (deg C)')
grid
