function sir_ode_test ( )

%*****************************************************************************80
%
%% sir_ode_test tests sir_ode.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 February 2020
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../sir_ode' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'sir_ode_test:\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test sir_ode using euler.\n' );

  n = 5000;
  T = 5000;
  S0 = 99;
  I0 = 1;
  R0 = 0;
  beta = 0.0075;
  gamma = 0.005;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of steps = %d\n', n );
  fprintf ( 1, '  Final time = %g\n', T );
  fprintf ( 1, '  Initial S = %g\n', S0 );
  fprintf ( 1, '  Initial I = %g\n', I0 );
  fprintf ( 1, '  Initial R = %g\n', R0 );
  fprintf ( 1, '  Infection parameter beta = %g\n', beta );
  fprintf ( 1, '  Recovery parameter gamma = %g\n', gamma );

  [ t, S, I, R ] = sir_ode_euler ( n, T, S0, I0, R0, beta, gamma );

  clf ( );
  hold ( 'on' );
  plot ( t, S, 'g', 'LineWidth', 3 );
  plot ( t, I, 'r', 'LineWidth', 3 );
  plot ( t, R, 'b', 'LineWidth', 3 );
  hold ( 'off' );
  grid ( 'on' );
  xlabel ( '<-- Time -->' );
  ylabel ( '<-- Cases -->' );
  legend ( 'Susceptible', 'Infected', 'Recovered' );
  title_string = sprintf ( '\\beta = %g, \\gamma = %g\n', beta, gamma );
  title ( title_string, 'Fontsize', 24 );
  filename = 'sir_ode_test.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
  pause ( 5 );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'sir_ode_test:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../sir_ode' );

  return
end
