function pendulum_nonlinear_ode_test ( )

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

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'pendulum_nonlinear_ode_test:\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test pendulum_nonlinear_ode using ode23.\n' );

  y0 = [ 70.0; 0.0 ];

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Initial angular deflection = %g degrees\n', y0(1) );
  fprintf ( 1, '  Initial angular velocity = %g degrees/second\n', y0(2) );

  tspan = [ 0.0, 50.0 ];
  y0 = [ 70.0*pi/180.0, 0.0 ];

  [ tl, yl ] = ode23 ( @pendulum_nonlinear_deriv, tspan, y0 );

  yl = yl * 180.0 / pi;

  plot ( tl, yl(:,1), 'b-', 'linewidth', 2 );
  grid ( 'on' );
  xlabel ( '<-- Time -->' );
  ylabel ( '<-- Angular deflection (degrees) -->' );
  title ( 'Deflection of nonlinear pendulum.' );

  filename = 'pendulum_nonlinear_ode_test.png';
  print ( '-dpng', filename );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Graphics saved in "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'pendulum_nonlinear_ode_test:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../pendulum_nonlinear_ode' );

  return
end
