function doughnut_exact_test ( )

%*****************************************************************************80
%
%% doughnut_exact_test() tests doughnut_exact().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    09 October 2025
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../doughnut_exact' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'doughnut_exact_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test doughnut_exact().\n' );

  [ m, n, t0, y0, tstop ] = doughnut_parameters ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Parameter values:\n' );
  fprintf ( 1, '    m     = %g\n', m );
  fprintf ( 1, '    n     = %g\n', n );
  fprintf ( 1, '    t0    = %g\n', t0 );
  fprintf ( 1, '    y0    = (%g,%g,%g)\n', y0 );
  fprintf ( 1, '    tstop = %g\n', tstop );
  fprintf ( 1, '\n' );

  t = linspace ( t0, tstop, 1001 );
  y = doughnut_exact ( t );

  size ( y )
%
%  Plot the data.
%
  clf ( );
  plot3 ( y(:,1), y(:,2), y(:,3) );
  grid ( 'on' );
  xlabel ( '<-- X -->' );
  ylabel ( '<-- Y -->' );
  zlabel ( '<-- Z -->' );
  title ( 'doughnut\_exact()' );
  filename = 'doughnut_exact.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'doughnut_exact_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../doughnut_exact' );

  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

