GaussKronrodRule

class GaussKronrodRule(*args)

Gauss-Kronrod rule used in the integration algorithm.

Parameters:
myGaussKronrodPairint

It encodes the selected rule.

Available rules:

  • GaussKronrodRule.G1K3,

  • GaussKronrodRule.G3K7,

  • GaussKronrodRule.G7K15,

  • GaussKronrodRule.G11K23,

  • GaussKronrodRule.G15K31,

  • GaussKronrodRule.G25K51.

Methods

getClassName()

Accessor to the object's name.

getName()

Accessor to the object's name.

getOrder()

Accessor to m parameter.

getOtherGaussWeights()

Accessor to the weights used in the Gauss approximation.

getOtherKronrodNodes()

Accessor to the positive nodes used in the Gauss-Kronrod approximation.

getOtherKronrodWeights()

Accessor to the weights used in the Gauss-Kronrod approximation.

getPair()

Accessor to pair definig the rule.

getZeroGaussWeight()

Accessor to the first Gauss weight.

getZeroKronrodWeight()

Accessor to the first Kronrod weight.

hasName()

Test if the object is named.

setName(name)

Accessor to the object's name.

Notes

We consider a function f: \Rset \mapsto \Rset^p. The Gauss-Kronrod rule G_mK_{2m+1} with m=2n+1 enables to build two approximations of the definite integral \int_{-1}^1 f(t)\di{t} respectively defined by:

\int_{-1}^1 f(t)\di{t} \simeq  \omega_0f(0) + \sum_{k=1}^n \omega_k (f(\xi_k)+f(-\xi_k))

and:

\int_{-1}^1 f(t)\di{t}\simeq  \alpha_0f(0) + \sum_{k=1}^{m} \alpha_k (f(\zeta_k)+f(-\zeta_k))

We have \xi_k>0, \zeta_k>0, \zeta_{2j}=\xi_j, \omega_k>0 and \alpha_k>0.

The rule G_mK_{2m+1} combines a m-point Gauss rule and a (2m+1)-point Kronrod rule (re-using the m nodes of the Gauss method). The nodes are defined on [-1, 1] and always contain the node 0 as m is odd.

Examples

Create an Gauss-Kronrod rule:

>>> import openturns as ot
>>> myRule = ot.GaussKronrodRule(ot.GaussKronrodRule.G15K31)
__init__(*args)
getClassName()

Accessor to the object’s name.

Returns:
class_namestr

The object class name (object.__class__.__name__).

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getOrder()

Accessor to m parameter.

Returns:
mint

The number of points used for the Gauss approximation.

getOtherGaussWeights()

Accessor to the weights used in the Gauss approximation.

Returns:
otherGaussWeightsPoint

The weights (\omega_k)_{1 \leq k \leq n}

getOtherKronrodNodes()

Accessor to the positive nodes used in the Gauss-Kronrod approximation.

Returns:
otherKronrodNodesPoint

The positive nodes (\zeta_k)_{1 \leq k \leq m}.

It contains the positive Gauss nodes as we have \zeta_{2j}=\xi_j.

getOtherKronrodWeights()

Accessor to the weights used in the Gauss-Kronrod approximation.

Returns:
otherKronrodWeightsPoint

The weights (\alpha_k)_{1 \leq k \leq m}.

getPair()

Accessor to pair definig the rule.

Returns:
gkPairint

Id of the Gauss-Kronrod rule.

getZeroGaussWeight()

Accessor to the first Gauss weight.

Returns:
zeroKronrodWeightfloat

The first weight \omega_0.

getZeroKronrodWeight()

Accessor to the first Kronrod weight.

Returns:
zeroKronrodWeightfloat

The first weight \alpha_0.

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

Examples using the class

Integrate a function with Gauss-Kronrod algorithm

Integrate a function with Gauss-Kronrod algorithm

Estimate a multivariate integral with IteratedQuadrature

Estimate a multivariate integral with IteratedQuadrature