function lindberg_ode45 ( )

%*****************************************************************************80
%
%% lindberg_ode45() solves lindberg_ode() using ode45().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    18 August 2021
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'lindberg_ode45:\n' );
  fprintf ( 1, '  Solve lindberg_ode() using ode45()\n' );

  [ t0, y0, tstop ] = lindberg_parameters ( );

  tspan = [ t0, tstop ];
  f = @ lindberg_deriv;

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

  y2 = lindberg_exact ( t );

  clf ( );
  hold ( 'on' );
  plot ( t, y(:,1), 'ro', 'linewidth', 3 );
  plot ( t, y2(:,1), 'b-', 'linewidth', 3 );
  hold ( 'off' );
  grid ( 'on' );
  xlabel ( '<-- t -->' );
  ylabel ( '<-- y1(t) -->' );
  legend ( 'Computed', 'Exact' );
  title ( 'lindberg\_ode(): ode45 y1' );
  filename = 'lindberg_ode45_y1.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  clf ( );
  hold ( 'on' );
  plot ( t, y(:,2), 'ro', 'linewidth', 3 );
  plot ( t, y2(:,2), 'b-','linewidth', 3 );
  hold ( 'off' );
  grid ( 'on' );
  xlabel ( '<-- t -->' );
  ylabel ( '<-- y2(t) -->' );
  legend ( 'Computed', 'Exact' );
  title ( 'lindberg\_ode(): ode45 y2' );
  filename = 'lindberg_ode45_y2.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  clf ( );
  hold ( 'on' );
  plot ( t, y(:,3), 'ro', 'linewidth', 3 );
  plot ( t, y2(:,3), 'b-','linewidth', 3 );
  hold ( 'off' );
  grid ( 'on' );
  xlabel ( '<-- t -->' );
  ylabel ( '<-- y3(t) -->' );
  legend ( 'Computed', 'Exact' );
  title ( 'lindberg\_ode(): ode45 y3' );
  filename = 'lindberg_ode45_y3.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  clf ( );
  hold ( 'on' );
  plot ( t, y(:,4), 'ro', 'linewidth', 3 );
  plot ( t, y2(:,4), 'b-','linewidth', 3 );
  hold ( 'off' );
  grid ( 'on' );
  xlabel ( '<-- t -->' );
  ylabel ( '<-- y4(t) -->' );
  legend ( 'Computed', 'Exact' );
  title ( 'lindberg\_ode(): ode45 y4' );
  filename = 'lindberg_ode45_y4.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  return
end
