function sine_gordon_exact_test ( )

%*****************************************************************************80
%
%% sine_gordon_exact_test() tests sine_gordon_exact().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    01 May 2024
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../sine_gordon_exact' );

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

  a = 1.5;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Parameters:\n' );
  fprintf ( 1, '    a     = %g\n', a );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Evaluate solution and residual at selected points (X,Y)\n' );
  
  x = linspace ( 0.0, 1.0, 6 );
  y = linspace ( 0.0, 1.0, 6 );

  fprintf ( 1, '\n' );
  fprintf ( 1, '      X       T       U(X,Y)      Resid(X,Y)\n' );
  fprintf ( 1, '\n' );
  for j = 1 : 6
    for i = 1 : 6
      [ u, uxy ] = sine_gordon_exact ( a, x(i), y(j) );
      r = sine_gordon_residual ( u, uxy );
      fprintf ( 1, '  %f  %f  %f  %g\n', x(i), y(j), u, r );
    end
    fprintf ( 1, '\n' );
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'sine_gordon_exact_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

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

