chaospy.quadrature.clenshaw_curtis¶
- chaospy.quadrature.clenshaw_curtis(order, domain=(0.0, 1.0), growth=False, segments=1)[source]¶
Generate the quadrature nodes and weights in Clenshaw-Curtis quadrature.
Clenshaw-Curtis quadrature method is a good all-around quadrature method comparable to Gaussian quadrature, but typically limited to finite intervals without a specific weight function. In addition to be quite accurate, the weights and abscissas can be calculated quite fast.
Another thing to note is that Clenshaw-Curtis, with an appropriate growth rule is fully nested. This means, if one applies a method that combines different order of quadrature rules, the number of evaluations can often be reduced as the abscissas can be used across levels.
- Args:
- order (int, numpy.ndarray):
Quadrature order.
- domain (
chaospy.Distribution
, numpy.ndarray): Either distribution or bounding of interval to integrate over.
- growth (bool):
If True sets the growth rule for the quadrature rule to only include orders that enhances nested samples.
- segments (int):
Split intervals into steps subintervals and create a patched quadrature based on the segmented quadrature. Can not be lower than order. If 0 is provided, default to square root of order. Nested samples only appear when the number of segments are fixed.
- Returns:
- abscissas (numpy.ndarray):
The quadrature points for where to evaluate the model function with
abscissas.shape == (len(dist), steps)
wheresteps
is the number of samples.- weights (numpy.ndarray):
The quadrature weights with
weights.shape == (steps,)
.
- Notes:
Implemented as proposed by Waldvogel [2].
- Example:
>>> abscissas, weights = chaospy.quadrature.clenshaw_curtis(4, (0, 1)) >>> abscissas.round(4) array([[0. , 0.1464, 0.5 , 0.8536, 1. ]]) >>> weights.round(4) array([0.0333, 0.2667, 0.4 , 0.2667, 0.0333])
- See also:
chaospy.quadrature.gaussian()
chaospy.quadrature.fejer_1()
chaospy.quadrature.fejer_2()