function euler2(eps,N)
% integrates a 1st order  ODE via Euler's method
% problem 1.5.15, Nagle et al.
% to use:
% run  matlab6
% then type: euler2(.1,20)
K = 1; M = 70;
disp(' ')
   disp(        '  i           t      T(t)   ')
   disp(        '---------------------------------------')
T(1)=100; t(1) = 0; i=0;
   disp(sprintf(' %2.0f        %5.2f   %8.5f    ',i,t(1),T(1)))
for i = 1:N
    T(i+1) = T(i) + eps*K*(M-T(i));
    t(i+1) = t(i) + eps;
   disp(sprintf(' %2.0f        %5.2f   %8.5f    ',i,t(i+1),T(i+1)))
end
   disp(        '---------------------------------------')
figure; axis([0, 2 , 0, 100])
plot(t,T,t(1:N/2:N+1),T(1:N/2:N+1),'ro')
title(sprintf('graph of solution to dT/dt=K*(M-T), T0=100 with eps = %12.5f',eps));
%>> euler2(.1,20)
% 
%  i           t      T(t)   
%---------------------------------------
%  0         0.00   100.00000    
%  1         0.10   97.00000    
%  2         0.20   94.30000    
%  3         0.30   91.87000    
%  4         0.40   89.68300    
%  5         0.50   87.71470    
%  6         0.60   85.94323    
%  7         0.70   84.34891    
%  8         0.80   82.91402    
%  9         0.90   81.62261    
% 10         1.00   80.46035    
% 11         1.10   79.41432    
% 12         1.20   78.47289    
% 13         1.30   77.62560    
% 14         1.40   76.86304    
% 15         1.50   76.17673    
% 16         1.60   75.55906    
% 17         1.70   75.00315    
% 18         1.80   74.50284    
% 19         1.90   74.05256    
% 20         2.00   73.64730    
%---------------------------------------
