function resid_taylor_test ( )

%*****************************************************************************80
%
%% resid_taylor_test samples the Taylor residual.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 January 2015
%
%  Author:
%
%    John Burkardt
%
  nu = 1.0;
  rho = 1.0;
  t = 0.0;

  xmin = 0.5;
  xmax = 2.5;
  ymin = 0.5;
  ymax = 2.5;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'resid_taylor_test\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Taylor flow:\n' );
  fprintf ( 1, '  Sample the Navier-Stokes residuals\n' );
  fprintf ( 1, '  %g <= X <= %g, %g <= Y <= %g\n', xmin, xmax, ymin, ymax );
  fprintf ( 1, '  T = %g\n', t );
  fprintf ( 1, '  Kinematic viscosity NU = %g\n', nu );
  fprintf ( 1, '  Fluid density RHO = %g\n', rho );

  n = 1000;
  x = xmin + ( xmax - xmin ) * rand ( n, 1 );
  y = ymin + ( ymax - ymin ) * rand ( n, 1 );

  [ ur, vr, pr ] = resid_taylor ( nu, rho, n, x, y, t );

  fprintf ( 1, '\n' );
  fprintf ( 1, '           Minimum       Maximum\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Ur:  %14.6g  %14.6g\n', min ( abs ( ur ) ), max ( abs ( ur ) ) );
  fprintf ( 1, '  Vr:  %14.6g  %14.6g\n', min ( abs ( vr ) ), max ( abs ( vr ) ) );
  fprintf ( 1, '  Pr:  %14.6g  %14.6g\n', min ( abs ( pr ) ), max ( abs ( pr ) ) );

  return
end
