function ozone_ode15s ( )

%*****************************************************************************80
%
%% ozone_ode15s() uses ode15s() to solve ozone_ode().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    24 April 2021
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'ozone_ode15s():\n' );
  fprintf ( 1, '  Use ode15s() to solve ozone_ode().\n' );

  [ k2, k3, t0, y0, tstop ] = ozone_parameters ( );

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

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

  n = size ( t, 1 );
  dt = tstop / ( n - 1 );
  fprintf ( 1, '  Number of time steps = %d\n', n );
  fprintf ( 1, '  Average timestep =     %g seconds\n', dt );

  figure ( 1 );
  clf ( );
  plot ( t, y(:,1), 'r-', 'linewidth', 3 );
  grid ( 'on' );
  xlabel ( '<---  t  --->' );
  ylabel ( '<---  y  --->' );
  title ( 'ozone_ode(): ode15s(), y1' );
  filename = 'ozone_ode15s_y1.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  figure ( 2 );
  clf ( );
  plot ( t, y(:,2), 'r-', 'linewidth', 3 );
  grid ( 'on' );
  xlabel ( '<---  t  --->' );
  ylabel ( '<---  y2  --->' );
  title ( 'ozone_ode(): ode15s() y2' );
  filename = 'ozone_ode15s_y2.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  figure ( 3 );
  clf ( );
  plot ( t, y(:,3), 'r-', 'linewidth', 3 );
  grid ( 'on' );
  xlabel ( '<---  t  --->' );
  ylabel ( '<---  y3  --->' );
  title ( 'ozone_ode(): ode15s() y3' );
  filename = 'ozone_ode15s_y3.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  figure ( 4 );
  clf ( );
  plot ( t, y(:,4), 'r-', 'linewidth', 3 );
  grid ( 'on' );
  xlabel ( '<---  t  --->' );
  ylabel ( '<---  y4  --->' );
  title ( 'ozone_ode(): ode15s() y4' );
  filename = 'ozone_ode15s_y4.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  h = ozone_conserved ( y );

  figure ( 5 );
  clf ( );
  hold ( 'on' );
    plot ( t, h, 'r-', 'linewidth', 3 );
    plot ( tspan, [h(1),h(1)], 'b--', 'linewidth', 3 );
    plot ( tspan, [0.0,0.0], 'k--', 'linewidth', 3 );
  hold ( 'off' );
  grid ( 'on' );
  xlabel ( '<---  t  --->' );
  ylabel ( '<---  h  --->' );
  title ( 'ozone_ode(): ode15s conservation' );
  filename = 'ozone_ode15s_conservation.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  return
end

