function minimal_surface_exact_test ( )

%*****************************************************************************80
%
%% minimal_surface_exact_test() tests minimal_surface_exact().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 May 2025
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../minimal_surface_exact' );

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

  n = 5;
  X = rand ( n, 1 );
  Y = rand ( n, 1 );
  a = 1.0;
  b = 2.0;
  c = 3.0;
%
%  Linear solution.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Linear solution residual at random points:\n' );

  R = minimal_surface_linear_residual ( X, Y, a, b, c );

  fprintf ( 1, '  RMS norm of residuals = %g\n', r8vec_norm_rms ( R ) );
%
%  Helicoid solution.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Helicoid solution residual at random points:\n' );

  R = minimal_surface_helicoid_residual ( X, Y );

  fprintf ( 1, '  RMS norm of residuals = %g\n', r8vec_norm_rms ( R ) );
%
%  Catenoid solution.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Catenoid solution residual at random points:\n' );

  R = minimal_surface_catenoid_residual ( X, Y, a );

  fprintf ( 1, '  RMS norm of residuals = %g\n', r8vec_norm_rms ( R ) );
%
%  Scherk solution.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Scherk solution residual at random points:\n' );

  R = minimal_surface_scherk_residual ( X, Y, a );

  fprintf ( 1, '  RMS norm of residuals = %g\n', r8vec_norm_rms ( R ) );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'minimal_surface_exact_test()\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../minimal_surface_exact' );

  return
end
function value = r8vec_norm_rms ( a )

%*****************************************************************************80
%
%% r8vec_norm_rms() returns the RMS norm of an R8VEC.
%
%  Discussion:
%
%    The vector RMS norm is defined as:
%
%      value = sqrt ( sum ( 1 <= I <= N ) A(I)^2 / N ).
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    26 October 2011
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real A(N), the vector.
%
%  Output:
%
%    real VALUE, the RMS norm.
%
  n = length ( a );

  value = sqrt ( sum ( a(1:n).^2 ) / n );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the 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

