function rigid_body_ode_test ( )

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

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'rigid_body_ode_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Solve rigid_body_ode().\n' );
%
%  Get the parameters.
%
  [ i1, i2, i3, t0, xyz0, tstop ] = rigid_body_parameters ( );
%
%  Ensure that tstop = 50.
%
  tstop = 50.0;
  [ i1, i2, i3, t0, xyz0, tstop ] = rigid_body_parameters ( i1, i2, i3, t0, xyz0, tstop );

  n = 1000;
  rigid_body_backward_euler (  n );

  n = 1000;
  rigid_body_euler (  n );
%
%  Ensure that tstop = 10,000.
%
  tstop = 10000.0;
  [ i1, i2, i3, t0, xyz0, tstop ] = rigid_body_parameters ( i1, i2, i3, t0, xyz0, tstop );

  n = 20000;
  rigid_body_midpoint ( n );

  n = 20000;
  rigid_body_rk4 ( n );

  rigid_body_ode15s ( );

  rigid_body_ode23 ( );

  rigid_body_ode23s ( );

  rigid_body_ode45 ( );

  n = 20000;
  rigid_body_trapezoidal ( n );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'rigid_body_ode_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../rigid_body_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

