function humps_rk2_implicit_test ( tspan, y0, n )

%*****************************************************************************80
%
%% humps_rk2_implicit_test() solves the humps ODE using rk2_implicit().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    13 November 2024
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N: the number of steps to take.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'humps_rk2_implicit_test():\n' );
  fprintf ( 1, '  Solve the humps ODE using rk2_implicit().\n' );

  f = @ humps_deriv;

  [ t, y ] = rk2_implicit ( f, tspan, y0, n );

  y2 = humps_exact ( t );

  clf ( );
  hold ( 'on' );
  plot ( t, y, 'r-', 'linewidth', 3 );
  plot ( t, y2, 'b-', 'linewidth', 3 );
  hold ( 'off' );
  grid ( 'on' );
  xlabel ( '<-- t -->' );
  ylabel ( '<-- y(t) -->' );
  title ( 'humps rk2\_implicit(): plot' );
  legend ( 'rk2_implicit', 'Exact' );
  filename = 'humps_rk2_implicit.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  return
end
