function flame_exact_test ( )

%*****************************************************************************80
%
%% flame_exact_test() tests flame_exact().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    27 April 2024
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../flame_exact' )

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'flame_exact_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  flame_exact() evaluates the exact solution of the flame ODE.\n' );
%
%  Get parameters.
%
  [ t0, y0, tstop ] = flame_parameters ( );
%
%  Extend time interval.
%
  tstop = 300.0;
  flame_parameters ( t0, y0, tstop );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  parameters:\n' );
  fprintf ( 1, '    t0    = %g\n', t0 );
  fprintf ( 1, '    tstop = %g\n', tstop );

  t = linspace ( t0, tstop, 101 );

  clf ( );
  hold ( 'on' );

  for y0 = [ 0.005, 0.01, 0.02, 0.05 ]

    fprintf ( 1, '    y0    = %g\n', y0 );
    flame_parameters ( t0, y0, tstop );
    y = flame_exact ( t );
    plot ( t, y, 'linewidth', 3 );

  end

  hold ( 'off' );

  title ( 'flame\_exact()' );
  legend ( '0.005', '0.01', '0.02', '0.05' )
  grid ( 'on' );
  xlabel ( '<--- T --->' );
  ylabel ( '<--- Y(T) --->' );
%
%  Save a copy in a file.
%
  filename = 'flame_exact.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'flame_exact_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../flame_exact' )

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

