utilities.quadratures#

This module contains some routines to generate quadrature points in 1D it has also a routine uniform, which generates uniform points with weights equal to 1

Functions#

gauss_legendre(m[, tol])

Compute Gauss-Legendre quadrature points and weights on [-1, 1].

gauss_lobatto(k)

Returns nodal abscissas {x} and weights {A} of Gauss-Legendre m-point quadrature.

quadrature(a, k[, method])

this routine generates a quad pts on the grid linspace(a,b,N)

Details#

This module contains some routines to generate quadrature points in 1D it has also a routine uniform, which generates uniform points with weights equal to 1

gauss_legendre(m, tol=1e-13)[source]#

Compute Gauss-Legendre quadrature points and weights on [-1, 1].

Returns nodal abscissas {x} and weights {A} of a Gauss-Legendre m-point quadrature over the canonical interval [-1, 1].

Parameters:
mint

Number of quadrature points in the quadrature rule.

tolfloat

Tolerance for the Newton-Raphson root-searching method.

Returns:
xnumpy.ndarray[float]

Abscissas of the quadrature points, in ascending order.

Anumpy.ndarray[float]

Weights of the quadrature points corresponding to the abscissas above.

gauss_lobatto(k)[source]#

Returns nodal abscissas {x} and weights {A} of Gauss-Legendre m-point quadrature.

quadrature(a, k, method='legendre')[source]#

this routine generates a quad pts on the grid linspace(a,b,N)