quad#

This module contains utility functions related to quadrature.

minterpy.utils.quad.gauss_leg(fun, num_points, bounds)[source]#

Integrate a one-dimensional function using Gauss-Legendre quadrature.

Parameters:
  • fun (Callable) – The function to integrate, the output may be a vector.

  • num_points (int) – The number of points used in the quadrature scheme.

  • bounds (numpy.ndarray) – The bounds of integration, an 1-by-2 array (lower and upper bounds).

Returns:

The integral of the function over the given bounds.

Return type:

numpy.ndarray