QUADRATURE_WEIGHTS_VANDERMONDE_2D is a C++ library which illustrates a method for computing the weights W of a 2D interpolatory quadrature rule, assuming that the points (X,Y) have been specified, by setting up a linear system involving the Vandermonde matrix.

We assume that the abscissas (quadrature points) have been chosen, that the interval [A,B]x[C,D] is known, and that the integrals of polynomials of total degree 0 through T can be computed.

### The Vandermonde Matrix

We assume that the quadrature formula approximates integrals of the form:

```        I(F) = Integral ( C <= Y <= D ) Integral ( A <= X <= B ) F(X,Y) dX dY
```
by specifying N=(T+1)*(T+2)/2 points (X,Y) and weights W such that
```        Q(F) = Sum ( 1 <= I <= N ) W(I) * F(X(I),Y(I))
```

Now let us assume that the points (X,Y) have been specified, but that the corresponding values W remain to be determined.

If we require that the quadrature rule with N points integrates the first N=(T+1)*(T+2)/2 monomials exactly, then we have N conditions on the weights W. (This means that we are assuming that N only takes on appropriate values, namely 1, 3, 6, 10, 15, 21, 28, ...)

The K-th condition, for the monomial X^I*Y^J, J = 0 to T, I = 0 to T - J, has the form:

```        W(1)*X(1)^I*Y(1)^J + W(2)*X(2)^I*Y(2)^j+...+W(N)*X(N)^I*Y(N)^J = (B^(I+1)-A^(I+1))*(D^(J+1)-C(J+1))/(I+1)/(J+1)
```

The corresponding matrix is known as a two-dimensional Vandermonde matrix. It is theoretically guaranteed to be nonsingular as long as the points (X,Y) are distinct and in "general position". The condition number of the matrix grows quickly with increasing T.

### Languages:

QUADRATURE_WEIGHTS_VANDERMONDE_2D is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version.

### Related Data and Programs:

EXACTNESS_2D, a C++ library which investigates the exactness of 2D quadrature rules that estimate the integral of a function f(x,y) over a 2D domain.

QUADRATURE_LEAST_SQUARES, a C++ library which computes weights for "sub-interpolatory" quadrature rules, that is, it estimates integrals by integrating a polynomial that approximates the function data in a least squares sense.

QUADRATURE_GOLUB_WELSCH, a C++ library which computes the points and weights of a Gaussian quadrature rule using the Golub-Welsch procedure, assuming that the points have been specified.

QUADRATURE_WEIGHTS_VANDERMONDE, a C++ library which computes the weights of a 1D quadrature rule using the Vandermonde matrix, assuming that the points have been specified.

TOMS655, a C++ library which computes the weights for interpolatory quadrature rule;
this library is commonly called IQPACK;
this is a FORTRAN90 version of ACM TOMS algorithm 655.

VANDERMONDE, a C++ library which carries out certain operations associated with the Vandermonde matrix.

### Reference:

1. Philip Davis, Philip Rabinowitz,
Methods of Numerical Integration,
Second Edition,
Dover, 2007,
ISBN: 0486453391,
LC: QA299.3.D28.
2. Sylvan Elhay, Jaroslav Kautsky,
Algorithm 655: IQPACK, FORTRAN Subroutines for the Weights of Interpolatory Quadrature,
ACM Transactions on Mathematical Software,
Volume 13, Number 4, December 1987, pages 399-415.
3. Jaroslav Kautsky, Sylvan Elhay,
Calculation of the Weights of Interpolatory Quadratures,
Numerische Mathematik,
Volume 40, 1982, pages 407-422.

### List of Routines:

• I4VEC_ZERO_NEW creates and zeroes an I4VEC.
• QWV_2D computes 2D quadrature weights using the Vandermonde matrix.
• R8_ABS returns the absolute value of an R8.
• R8MAT_PRINT prints an R8MAT.
• R8MAT_PRINT_SOME prints some of an R8MAT.
• R8MAT_SOLVE2 computes the solution of an N by N linear system.
• R8VEC_EVEN_NEW returns an R8VEC of values evenly spaced between ALO and AHI.
• R8VEC_PRINT prints an R8VEC.
• R8VEC_PRINT_16 prints an R8VEC to 16 decimal places.
• R8VEC_ZERO_NEW creates and zeroes an R8VEC.
• TIMESTAMP prints the current YMDHMS date as a time stamp.

You can go up one level to the C++ source codes.

Last revised on 28 May 2014.