function [out]=fprint(ncase,n,t,u)
%
% Function fprint displays the numerical and exact 
% solutions to the 2 x 2 ODE problem
%
% Global variables
  global abserr relerr ncalls;
%
% Return current value of independent variable
% (Matlab requires at least one return argument)
  out=t;
%
% Problem parameters
  a=5.5;
  b=4.5;
%
% Print a heading for the solution at t = 0 
  if(t<=0.0)
%
%   Label for ODE integrator
%
%   Fixed step modified Euler 
    if(ncase==1)
      fprintf('\n\n euler2a integrator\n\n');
% 
%   Variable step modified Euler
    elseif(ncase==2)
      fprintf('\n\n euler2b integrator\n\n');
%
%   Fixed step classical fourth order RK
    elseif(ncase==3)
      fprintf('\n\n rkc4a integrator\n\n');
%
%   Variable step classical fourth order RK 
    elseif(ncase==4)
      fprintf('\n\n rkc4b integrator\n\n');
%
%   Fixed step RK Fehlberg 45 
    elseif(ncase==5)		
      fprintf('\n\n rkf45a integrator\n\n');
%		
%   Variable step RK Fehlberg 45 
    elseif(ncase==6)
      fprintf('\n\n rkf45b integrator\n\n');
%
%   Fixed step RK (2,3) embedded pair
    elseif(ncase==7)     
      fprintf('\n\n ode23a integrator\n\n');
%		
%   Variable step RK (2,3) embedded pair
    elseif(ncase==8)
      fprintf('\n\n ode23b integrator\n\n');
%
%   Fixed step RK (4,5) embedded pair
    elseif(ncase==9)     
      fprintf('\n\n ode45a integrator\n\n');
%		
%   Variable step RK (4,5) embedded pair
    elseif(ncase==10)
      fprintf('\n\n ode45b integrator\n\n');
    end
%
% Heading 
  fprintf(' ncase = %2d   n = %2d   abserr = %8.1e   relerr = %8.1e \n\n',...
          ncase,n,abserr,relerr);
  fprintf('        t        u1         u2       u1(ex)     u2(ex)    diff(1)    diff(2)\n');
%                                                            
% End of t = 0 heading
  end
%
% Numerical and analytical solution output 
  e1=-(a+b);
  e2=-(a-b);
  ue(1)=-exp(e1*t)+exp(e2*t);
  ue(2)= exp(e1*t)+exp(e2*t);
  diff=ue-u;
  fprintf('%10.2f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f\n',...
          t,u,ue,diff);
  if t > 9.999
    fprintf(' \n ncalls = %5d\n',ncalls);
  end
