function chirikov_iteration_test ( )

%*****************************************************************************80
%
%% chirikov_iteration_test() tests chirikov_iteration().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    07 July 2023
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../chirikov_iteration' );

  timestamp ( );

  fprintf ( 1, '\n' );
  fprintf ( 1, 'chirikov_iteration_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test chirikov_iteration()\n' );

  [ k, n, xy0 ] = chirikov_parameters ( );

  fprintf ( 1, '' );
  fprintf ( 1, '  Chirikov parameters:\n' );
  fprintf ( 1, '    k   = %g\n', k );
  fprintf ( 1, '    n   = %d\n', n );
  fprintf ( 1, '    xy0 = (%g,%g)\n', xy0 );

  [ t, xy ] = map_iteration ( @chirikov_map, n, xy0 );

  clf ( );
  plot ( xy(:,1), xy(:,2), 'bo', 'markersize', 10 );
  grid ( 'on' );
  xlabel ( '<-- X -->' );
  ylabel ( '<-- Y -->' );
  title ( 'Chirikov iteration' );
  filename = 'chirikov.png';
  print ( '-dpng', filename );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'chirikov_iteration_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  timestamp ( );

  rmpath ( '../chirikov_iteration' );

  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 November 2022
%
%  Author:
%
%    John Burkardt
%
  t = now ( );
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

