function rk2_test ( )

%MATLAB version of the script for algorithm 8.2 on pages 365 of conte/deboor
% Program to solve the first order differential equation
%   Y'(X) = F(X,Y)
% with initial condition of
%   Y(XBEGIN) = YBEGIN
% to the point  XEND , using the second-order Runge-Kutta method.
% This is Example 8.2
%
%  Reference:
%
%    Samuel Conte, Carl de Boor,
%    Elementary Numerical Analysis,
%    Third Edition,
%    SIAM, 2017,
%    ISBN: 978-1-611975-19-2.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'rk2_test\n' );
  fprintf ( 1, '  Test rk2()\n' );
  fprintf ( 1, '  Demonstrate second order Runge Kutta method.\n' );

F = @(x,y) (1./x - y)./x - y.*y;

disp(' Method 2 -- Simplified Runge-Kutta order 2')
disp(['  H                Y(1.5)           YPRIM(1.5)       Y(2)  ', ...
      '           YPRIM(2)'])
for NSTEPS=2.^(4:7)
   rk2(F,1,-1,2,NSTEPS)
end

  return
end

