EXACTNESS
Exactness of Quadrature Rules
EXACTNESS
is a Python library which
investigates the exactness of quadrature rules that estimate the
integral of a function with a density, such as 1, exp(-x) or
exp(-x^2), over an interval such as [-1,+1], [0,+oo) or (-oo,+oo).
A 1D quadrature rule estimates I(f), the integral of a function f(x)
over an interval [a,b] with density rho(x):
I(f) = integral ( a < x < b ) f(x) rho(x) dx
by a n-point quadrature rule of weights w and points x:
Q(f) = sum ( 1 <= i <= n ) w(i) f(x(i))
Most quadrature rules come in a family of various sizes. A quadrature
rule of size n is said to have exactness p if it is true that the
quadrature estimate is exactly equal to the exact integral for every
monomial (and hence, polynomial) whose degree is p or less.
This program allows the user to specify a quadrature rule, a size n,
and a degree p_max. It then computes and compares the exact integral
and quadrature estimate for monomials of degree 0 through p_max, so
that the user can analyze the results.
Common densities include:
-
Chebyshev Type 1 density 1/sqrt(1-x^2), over [-1,+1],
-
Chebyshev Type 2 density sqrt(1-x^2), over [-1,+1].
-
Gegenbauer density (1-x^2)^(lambda-1/2), over [-1,+1].
-
Hermite (physicist) density 1/sqrt(pi) exp(-x^2), over (-oo,+oo).
-
Hermite (probabilist) density 1/sqrt(2*pi) exp(-x^2/2), over (-oo,+oo).
-
Hermite (unit) density 1, over (-oo,+oo).
-
Jacobi density (1-x)^alpha*(1+x)^beta, over [-1,+1].
-
Laguerre (standard) density exp(-1), over [0,+oo).
-
Laguerre (unit) density 1, over [0,+oo).
-
Legendre density 1, over [-1,+1].
Common quadrature rules include:
-
Clenshaw-Curtis quadrature for Legendre density,
exactness = n - 1;
-
Fejer Type 1 quadrature for Legendre density,
exactness = n - 1;
-
Fejer Type 2 quadrature for Legendre density,
exactness = n - 1;
-
Gauss-Chebyshev Type 1 quadrature, exactness = 2 * n - 1;
-
Gauss-Chebyshev Type 2 quadrature, exactness = 2 * n - 1;
-
Gauss-Gegenbauer quadrature, exactness = 2 * n - 1;
-
Gauss-Hermite quadrature, exactness = 2 * n - 1;
-
Gauss-Laguerre quadrature, exactness = 2 * n - 1;
-
Gauss-Legendre quadrature, exactness = 2 * n - 1;
Licensing:
The computer code and data files made available on this
web page are distributed under
the GNU LGPL license.
Languages:
EXACTNESS is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version and
a Python version.
Related Data and Programs:
QUADRULE,
a Python library which
defines quadrature rules for approximating an integral over a 1D domain.
Reference:
-
Philip Davis, Philip Rabinowitz,
Methods of Numerical Integration,
Second Edition,
Dover, 2007,
ISBN: 0486453391,
LC: QA299.3.D28.
Source Code:
-
chebyshev1_exactness.py,
monomial exactness for the Chebyshev1 integral.
-
chebyshev1_integral.py,
evaluates a monomial Chebyshev1 integral.
-
chebyshev1_set.py,
sets a Chebyshev Type 1 rule.
-
chebyshev2_exactness.py,
monomial exactness for the Chebyshev2 integral.
-
chebyshev2_integral.py,
evaluates a monomial Chebyshev2 integral.
-
chebyshev2_set.py,
sets a Chebyshev Type 2 rule.
-
chebyshev3_exactness.py,
monomial exactness for the Chebyshev1 integral with Chebyshev3 quadrature.
-
chebyshev3_set.py,
sets a Chebyshev Type 3 rule.
-
clenshaw_curtis_exactness.py,
monomial exactness for the Legendre integral with Clenshaw-Curtis quadrature.
-
clenshaw_curtis_set.py,
sets a Clenshaw-Curtis rule.
-
fejer1_exactness.py,
monomial exactness for the Legendre integral with Fejer Type 1 quadrature.
-
fejer1_set.py,
sets a Fejer type 1 rule.
-
fejer2_exactness.py,
monomial exactness for the Legendre integral with Fejer Type 2 quadrature.
-
fejer2_set.py,
sets a Fejer type 2 rule.
-
gamma_values.py,
returns selected values of the gamma function.
-
gegenbauer_exactness.py,
monomial exactness for the Gegenbauer integral.
-
gegenbauer_integral.py,
evaluates a monomial Gegenbauer integral.
-
hermite_1_exactness.py,
monomial exactness for the Hermite 1 integral.
-
hermite_1_set.py,
sets a Gauss-Hermite rule for density 1.
-
hermite_exactness.py,
monomial exactness for the Hermite integral.
-
hermite_integral.py,
evaluates a monomial Hermite integral.
-
hermite_set.py,
sets a Gauss-Hermite rule for density exp(-x^2).
-
laguerre_1_exactness.py,
monomial exactness for the Laguerre 1 integral.
-
laguerre_1_set.py,
sets a Gauss-Laguerre rule for density 1.
-
laguerre_exactness.py,
monomial exactness for the Laguerre integral.
-
laguerre_integral.py,
evaluates a monomial Laguerre integral.
-
laguerre_set.py,
sets a Gauss-Laguerre rule for density exp(-x).
-
legendre_exactness.py,
monomial exactness for the Legendre integral.
-
legendre_integral.py,
evaluates a monomial Legendre integral.
-
legendre_set.py,
sets a Gauss-Legendre rule for density 1.
-
r8_factorial.py,
evaluates the factorial function.
-
r8_factorial_values.py,
returns selected values of the factorial function.
-
r8_factorial2.py,
evaluates the double factorial function.
-
r8_factorial2_values.py,
returns selected values of the double factorial function.
-
r8_gamma.py,
evaluates the gamma function.
-
timestamp.py,
prints the YMDHMS date as a timestamp
Examples and Tests:
You can go up one level to
the Python source codes.
Last revised on 14 January 2016.