quadrature_weights_vandermonde, a MATLAB code which illustrates a method for computing the weights of a quadrature rule, assuming that the points 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] is known, and that the integrals of polynomials of degree 0 through N-1 can be computed. The examples here use a finite interval and a unit weight function, but the method can easily be extended to non-finite intervals and non-unit weight functions.
We assume that the quadrature formula approximates integrals of the form:
I(F) = Integral ( A <= X <= B ) F(X) dXby specifying N points X and weights W such that
Q(F) = Sum ( 1 <= I <= N ) W(I) * F(X(I))
Now let us assume that the points X 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 monomials exactly, then we have N conditions on the weights W.
The I-th condition, for the monomial X^(I-1), has the form:
W(1)*X(1)^(I-1) + W(2)*X(2)^(I-1)+...+W(N)*X(N)^(I-1) = (B^I-A^I)/I.
The corresponding matrix is known as the Vandermonde matrix. It is theoretically guaranteed to be nonsingular as long as the X's are distinct, but its condition number grows quickly with N. Therefore, this simple, direct approach is often abandoned when more accuracy or high order rules are needed.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
quadrature_weights_vandermonde is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version.
clenshaw_curtis_rule, a MATLAB code which defines a clenshaw curtis quadrature rule.
quadrature_least_squares, a MATLAB code 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 MATLAB code 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_2d, a MATLAB code which computes the weights of a 2d quadrature rule using the vandermonde matrix, assuming that the points have been specified.
quadrule, a MATLAB code which defines quadrature rules for 1-dimensional domains.
a MATLAB code which
computes the weights for interpolatory quadrature rule;
this library is commonly called iqpack;
this is a MATLAB version of acm toms algorithm 655.
vandermonde, a MATLAB code which carries out certain operations associated with the vandermonde matrix.