quad_rule


quad_rule, a Python code which sets up a variety of quadrature rules, used to approximate the integral of a function over various domains in 1D.

quad_rule returns the abscissas and weights for a variety of one dimensional quadrature rules for approximating the integral of a function. The best rule is generally Gauss-Legendre quadrature, but other rules offer special features, including the ability to handle certain weight functions, to approximate an integral on an infinite integration region, or to estimate the approximation error.

Licensing:

The files described and made available on this web page are distributed under the MIT license

Languages:

quad_rule is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.

Related Programs:

alpert_rule, a Python code which can set up an alpert quadrature rule for functions which are regular, log(x) singular, or 1/sqrt(x) singular.

annulus_rule, a Python code which computes a quadrature rule for estimating integrals of a function over the interior of a circular annulus in 2d.

disk_rule, a Python code which computes quadrature rules over the interior of the general disk in 2d, with radius rc and center (xc,yc).

disk01_rule, a Python code which computes quadrature rules over the interior of the unit disk in 2d, with center (0,0) and radius 1.

exactness, a Python code 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).

kronrod, a Python code which can compute a gauss and gauss-kronrod pair of quadrature rules of arbitrary order, by robert piessens, maria branders.

line_ncc_rule, a Python code which computes a Newton Cotes Closed (NCC) quadrature rule, using equally spaced points, over the interior of a line segment in 1D.

square_minimal_rule, a Python code which returns almost minimal quadrature rules, with exactness up to total degree 55, over the interior of the symmetric square in 2D, by Mattia Festa and Alvise Sommariva.

truncated_normal, a Python code which works with the truncated normal distribution over [a,b], or [a,+oo) or (-oo,b], returning the probability density function (pdf), the cumulative density function (cdf), the inverse cdf, the mean, the variance, and sample values.

truncated_normal_rule, a Python code which computes a quadrature rule for a normal distribution that has been truncated to [A,+oo), (-oo,B] or [A,B].

Source Code:


Last revised on 19 November 2015.