function resid_poiseuille_test ( )

%*****************************************************************************80
%
%% resid_poiseuille_test samples the Poiseuille residual.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 July 2015
%
%  Author:
%
%    John Burkardt
%
  nu = 1.0;
  rho = 1.0;
  t = 0.0;

  xmin = 0.0;
  xmax = 6.0;
  ymin = -1.0;
  ymax = 1.0;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'resid_poiseuille_test\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Poiseuille 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;
  seed = 123456789;
  [ x, seed ] = r8vec_uniform_ab ( n, xmin, xmax, seed );
  [ y, seed ] = r8vec_uniform_ab ( n, ymin, ymax, seed );

  [ ur, vr, pr ] = resid_poiseuille ( 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
