archimedes.quadrature.QuadratureRuleΒΆ
- class archimedes.quadrature.QuadratureRule( )ΒΆ
Fixed-node Gauss quadrature rule on a reference domain.
Approximates the weighted integral
\[\int_\mathcal{D} f(x) \, w(x) \, dx \approx \sum_{i=1}^n w_i f(x_i)\]where \(w\) and \(\mathcal{D}\) are the weight function and reference domain of
measure, andnodes/weightsare the \(x_i\)/\(w_i\) above.Nodes and weights are always static (NumPy) arrays. Mapping onto a target domain/measure is an affine transform of the reference nodes, whose parameters are specific to
measureβ seescaled_points.- Parameters:
nodes (array_like) β Quadrature nodes \(x_i\), shape
(n,), onmeasure.support.weights (array_like) β Quadrature weights \(w_i\), shape
(n,).name (str) β Name identifying the rule.
measure (Measure) β Weight function and reference domain the rule is defined on.
- Raises:
ValueError β If
nodesandweightsdo not have the same shape.
Methods
__init__(nodes, weights, name, measure)integrate(f, *params[, axis, args, density])Approximate the weighted integral of
f.scaled_points(*params, **kwparams)Nodes mapped by
measure's affine parameters.scaled_weights(*params[, density])Weights including the Jacobian factor for the target domain/measure.
sum(values, *params[, axis, density])Quadrature applied to values already sampled at the nodes.
Attributes
nodesweightsnamemeasure