Module jacobi

Source
Expand description

Numerical integration using the Gauss-Jacobi quadrature rule.

This rule can integrate expressions of the form (1 - x)^alpha * (1 + x)^beta * f(x), where f(x) is a smooth function on a finite domain, alpha > -1 and beta > -1, and where f(x) is transformed from the domain [a, b] to the domain [-1, 1]. This enables the approximation of integrals with singularities at the end points of the domain.

§Example

use gauss_quad::jacobi::GaussJacobi;
use approx::assert_abs_diff_eq;

let quad = GaussJacobi::new(10, 0.0, -1.0 / 3.0)?;

// numerically integrate sin(x) / (1 + x)^(1/3), a function with a singularity at x = -1.
let integral = quad.integrate(-1.0, 1.0, |x| x.sin());

assert_abs_diff_eq!(integral, -0.4207987746500829, epsilon = 1e-14);

Structs§

GaussJacobi
A Gauss-Jacobi quadrature scheme.
GaussJacobiError
The error returned by GaussJacobi::new if given a degree, deg, less than 2 and/or an alpha and/or beta less than or equal to -1.
GaussJacobiIntoIter
An owning iterator over the node-weight pairs of the quadrature rule.
GaussJacobiIter
An iterator over the node-weight pairs of the quadrature rule.
GaussJacobiNodes
An iterator over the nodes of the quadrature rule.
GaussJacobiWeights
An iterator over the weights of the quadrature rule.

Enums§

GaussJacobiErrorReason
The reason for the GaussJacobiError, returned by the GaussJacobiError::reason function.