archimedes.quadrature.QuadratureRuleΒΆ

class archimedes.quadrature.QuadratureRule(
nodes: ndarray,
weights: ndarray,
name: str,
measure: Measure,
)ΒΆ

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, and nodes/weights are 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 – see scaled_points.

Parameters:
  • nodes (array_like) – Quadrature nodes \(x_i\), shape (n,), on measure.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 nodes and weights do not have the same shape.

__init__(
nodes: ndarray,
weights: ndarray,
name: str,
measure: Measure,
) NoneΒΆ

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

nodes

weights

name

measure