function sawtooth_ode45 ( )

%*****************************************************************************80
%
%% sawtooth_ode45() tests sawtooth_ode with ode45.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 March 2021
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'sawtooth_ode45():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Solve sawtooth_ode using ode45.\n' );

  [ omega, t0, y0, tstop ] = sawtooth_parameters ( );

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

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

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

  figure ( 1 );
  hold ( 'on' );
    plot ( t, y(:,1), 'r-', 'linewidth', 3 );
    plot ( t, y(:,2), 'b-', 'linewidth', 3 );
  hold ( 'off' );
  grid ( 'on' );
  xlabel ( '<-- T -->', 'Fontsize', 16 );
  ylabel ( '<-- Y(1), Y(2) -->', 'Fontsize', 16 );
  title ( 'sawtooth ODE using ode45()' );
  legend ( 'Y1(t)', 'Y2(t)' );
  filename = 'sawtooth_ode45.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );

  return
end
