function flame_ode45 ( )

%*****************************************************************************80
%
%% flame_ode45() uses ode45() to solve flame_ode().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 April 2021
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Shirley Abelman, Kailash Patidar,
%    Comparison of some recent numerical methods for initial-value problems
%    for stiff ordinary differential equations,
%    Computers and Mathematics with Applications,
%    Volume 55, Number 4, 2008, pages 733-744.
%    
%    Cleve Moler,
%    Cleve's Corner: Stiff Differential Equations,
%    MATLAB News and Notes,
%    May 2003, pages 12-13.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'flame_ode45():\n' );
  fprintf ( 1, '  Use ode45() to solve flame_ode().\n' );
  fprintf ( 1, '\n' );
%
%  Get the parameters.
%
  [ t0, y0, tstop ] = flame_parameters ( );
%
%  Call ODE45 to estimate the solution.
%
  f = @ flame_deriv
  tspan = [ t0, tstop ];

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

  n = size ( t, 1 );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of variable-size steps = %d\n', n );

  ye = flame_exact ( t );
%
%  Plot the solution curve.
%
  plot ( t, y, 'bo', ...
         t, ye, 'r-', 'Linewidth', 3 );

  title ( sprintf ( 'flame\\_ode(): ode45(), DELTA = %g', y0 ) );
  grid ( 'on' );
  xlabel ( '<--- T --->' );
  ylabel ( '<--- X(T) --->' );
  legend ( 'Computed', 'Exact' );
%
%  Save a copy in a file.
%
  filename = 'flame_ode45.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  return
end

