function value = integral_pp ( u, dx )

%*****************************************************************************80
%
%% integral_pp: integral of a quantity; both boundaries are periodic.
%
%  Discussion:
%
%    The array U has NX entries.
%
%    The values in U correspond to X locations with spacing DX.
%
%    The first and last values of U should be equal, since the periodic
%    condition applies.
%
%    We estimate the integral using the trapezoid rule.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 December 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real u(nu,nx), the value at each point.
%
%    real dx, the spacing between points.
%
%  Output:
%
%    real value, the integral estimate.
%
  [ nu, nx ] = size ( u );

  value = sum ( u(:,1:nx-1), 2 ) * dx;

  return
end

