function quasiperiodic_ode_test ( )

%*****************************************************************************80
%
%% quasiperiodic_ode_test tests quasiperiodic_ode.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 July 2020
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../quasiperiodic_ode' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'quasiperiodic_ode_test:\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test quasiperiodic_ode using ode23.\n' );

  tmin = 0.0;
  tmax = 20.0;

  f = @ quasiperiodic_deriv;
  tspan = [ tmin, tmax ];
  y0 = [ 2.0; 0.0; -(1.0+pi^2); 0.0 ];

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

  clf ( );
  hold ( 'on' );
  plot ( t, y(:,1), 'bo', 'linewidth', 2 );
  y2 = quasiperiodic_exact ( t );
  plot ( t, y2(:,1), 'r-', 'linewidth', 2 );
  hold ( 'off' );
  grid ( 'on' );
  xlabel ( '<-- Time -->' );
  ylabel ( '<-- Y(T) -->' );
  legend ( 'ODE23', 'Exact' );
  title ( 'Quasiperiodic ODE.' );

  filename = 'quasiperiodic_ode_test.png';
  print ( '-dpng', filename );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics saved in "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'quasiperiodic_ode_test:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../quasiperiodic_ode' );

  return
end
