function rk4vec_step_test ( )

%*****************************************************************************80
%
%%rk4vec_step_test tests rk4vec_step.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license. 
%
%  Modified:
%
%    09 October 2013
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'rk4vec_step_test\n' );
  fprintf ( 1, '  rk4vec_step takes one Runge-Kutta step for a vector ODE.\n' );

  n = 2;
  dt = 0.1;
  tmax = 12.0 * pi;

  fprintf ( 1, '\n' );
  fprintf ( 1, '          T          U1(T)            U2(T)\n' );
  fprintf ( 1, '\n' );

  t0 = 0.0;
  u0(1) = 0.0;
  u0(2) = 1.0;

  while ( true )
%
%  Print (T0,U0).
%
    fprintf ( 1, '  %14.6g  %14.6g  %14.6g\n', t0, u0(1), u0(2) );
%
%  Stop if we've exceeded TMAX.
%
    if ( tmax <= t0 )
      break
    end
%
%  Otherwise, advance to time T1, and estimate the solution U1 there.
%
    t1 = t0 + dt;
    u1 = rk4vec_step ( t0, n, u0, dt, @rk4vec_step_test_f );
%
%  Shift the data to prepare for another step.
%
    t0 = t1;
    u0(1:n) = u1(1:n);

  end

  return
end
