function robertson_ode_test ( )

%*****************************************************************************80
%
%% robertson_ode_test tests robertson_ode().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 August 2020
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../robertson_ode' )

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'robertson_ode_test:\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test robertson_ode using ode45.\n' );

  t0 = 0.0;
  y0 = [ 1.0; 0.0; 0.0 ];
  tspan = [ t0, 40.0 ];
  [ t, y ] = ode45 ( @(t,y)robertson_deriv(t,y), tspan, y0 );

  figure ( 1 );
  clf ( );
  hold ( 'on' );
  plot ( t, y(:,1), 'linewidth', 3 );
  plot ( t, y(:,2), 'linewidth', 3 );
  plot ( t, y(:,3), 'linewidth', 3 );
  hold ( 'off' );
  grid ( 'on' );
  xlabel ( '<---  t  --->' );
  ylabel ( '<---  y(t)  --->' );
  title ( 'Robertson ode' );
  legend ( 'y1', 'y2', 'y3' );
  filename = 'robertson_ode.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  h = robertson_conserved ( t, y );

  figure ( 2 );
  plot ( t, h, 'b-', 'linewidth', 3 );
  grid ( 'on' );
  xlabel ( '<---  t  --->' );
  ylabel ( '<---  y1+y2+y3  --->' );
  title ( 'Robertson ode conservation' );
  filename = 'robertson_ode_conservation.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'robertson_ode_test:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../robertson_ode' )

  return
end
