SPHERE_VOLUME_QUAD
Multidimensional Sphere Volume by Quadrature


SPHERE_VOLUME_QUAD is a FORTRAN90 program which investigates the behavior of a quadrature rule when it is applied to a discontinuous function. In particular, our integration region is the 6D hypercube [-1,+1]^6, and our function f(x) is 1 if the point x is inside the hypersphere of radius 1, and 0 otherwise.

The volume of the hypercube is 64; the volume of the hypersphere is pi^3/6, or about 5.16771.

Because the integrand is discontinuous, any quadrature rule based on the idea of interpolation will probably be unable to do a good job. A family of quadrature rules, which rely on increasing the order of interpolation to improve accuracy, will probably get increasingly bad answers.

By contrast, a basic Monte Carlo rule, which assumes nothing about the function, integrates this function just as well as it integrates most any other square-integrable function. (That's both the strength and weakness of the blunt instrument we call Monte Carlo integration.)

The program assumes that the quadrature rule is defined by three text files.

Note that the three files that define the quadrature rule are assumed to have related names, of the form

When running the program, the user only enters the common prefix part of the file names, which is enough information for the program to find all three files.

For information on the form of these files, see the QUADRATURE_RULES directory listed below.

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Related Data and Programs:

INT_EXACTNESS is a FORTRAN90 program which tests the polynomial exactness of one dimensional quadrature rules.

INTEGRAL_TEST is a FORTRAN90 program which uses test integrals to measure the effectiveness of certain sets of quadrature rules.

NINT_EXACTNESS is a FORTRAN90 program which measures the polynomial exactness of a multidimensional quadrature rule.

NINT_EXACTNESS_MIXED is a FORTRAN90 program which measures the polynomial exactness of a multidimensional quadrature rule based on a mixture of 1D quadrature rule factors.

NINT_EXACTNESS_TET is a FORTRAN90 program which tests the polynomial exactness of integration rules for the tetrahedron.

NINT_EXACTBESS_TRI is a FORTRAN90 program which tests the polynomial exactness of a quadrature rule for the triangle.

NINTLIB is a FORTRAN90 library which numerically estimates integrals in multiple dimensions.

PRODUCT_FACTOR is a FORTRAN90 program which constructs a product rule from distinct 1D factor rules.

PRODUCT_RULE is a FORTRAN90 program which can create a multidimensional quadrature rule as a product of 1D quadrature rules.

QUADRATURE_RULES is a dataset directory which contains sets of files that define quadrature rules over various 1D intervals or multidimensional hypercubes.

QUADRULE is a FORTRAN90 library which defines quadrature rules on a variety of intervals with different weight functions.

SPHERE_DESIGN_RULE is a FORTRAN90 library which returns point sets on the surface of the unit sphere, known as "designs", which can be useful for estimating integrals on the surface, among other uses.

STROUD is a FORTRAN90 library which defines quadrature rules for a variety of unusual areas, surfaces and volumes in 2D, 3D and multiple dimensions.

TEST_NINT is a FORTRAN90 library which defines integrand functions for testing multidimensional quadrature routines.

TESTPACK is a FORTRAN90 library which defines a set of integrands used to test multidimensional quadrature.

Reference:

  1. Philip Davis, Philip Rabinowitz,
    Methods of Numerical Integration,
    Second Edition,
    Dover, 2007,
    ISBN: 0486453391,
    LC: QA299.3.D28.

Source Code:

SPHERE_VOLUME_MC is a related program which uses Monte Carlo rules of order 2^0 through 2^25 to estimate the volume of the 6D sphere.

Examples and Tests:

You can go up one level to the FORTRAN90 source codes.


Last revised on 18 October 2008.