function reaction_ode_test ( )

%*****************************************************************************80
%
%% reaction_ode_test() solves reaction_ode().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    25 April 2021
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../reaction_ode' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'reaction_ode_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Solve reaction_ode().\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Reaction differential equation:\n' );
  fprintf ( 1, '    da/dt = - k a b\n' );
  fprintf ( 1, '    db/dt = - k a b\n' );
  fprintf ( 1, '    dc/dt = + k a b\n' );
%
%  Get parameter values.
%
  [ k, t0, y0, tstop ] = reaction_parameters ( );
%
%  Report parameter values.
%

  fprintf ( 1, '\n' );
  fprintf ( 1, '  parameters:\n' );
  fprintf ( 1, '    k     = %g, (reaction rate)\n', k);
  fprintf ( 1, '    t0    = %g, (initial time, in seconds s)\n', t0 );
  fprintf ( 1, '    a0    = %g, (initial amount of species a in Mol/L)\n', y0(1) );
  fprintf ( 1, '    b0    = %g, (initial amount of species b in Mol/L)\n', y0(2) );
  fprintf ( 1, '    c0    = %g, (initial amount of species c in Mol/L)\n', y0(3) );
  fprintf ( 1, '    tstop = %g, (final time, in seconds s)\n', tstop );
  reaction_ode45 ( );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'reaction_ode_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../reaction_ode' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

