# KarhunenLoeveP1Algorithm¶

class KarhunenLoeveP1Algorithm(*args)

Computation of Karhunen-Loeve decomposition using P1 approximation.

Parameters: meshMeshThe mesh that discretizes the domain . covarianceCovarianceModelThe covariance function to decompose. sfloat, The threshold used to select the most significant eigenmodes, defined in KarhunenLoeveAlgorithm.

Notes

The Karhunen-Loeve algorithm solves the Fredholm problem associated to the covariance function : see KarhunenLoeveAlgorithm to get the notations.

The Karhunen-Loeve approximation uses the functional basis where are the basis functions of the finite element space associated to , which vertices are .

The covariance function is approximated by its approximation on :

The Galerkin approach and the collocation one are equivalent in the approach and both lead to the following formulation:

where with , .

Examples

Create a Karhunen-Loeve P1 algorithm:

>>> import openturns as ot
>>> mesh = ot.IntervalMesher([10]*2).build(ot.Interval([-1.0]*2, [1.0]*2))
>>> s = 0.01
>>> model = ot.AbsoluteExponential([1.0]*2)
>>> algorithm = ot.KarhunenLoeveP1Algorithm(mesh, model, s)


Run it!

>>> algorithm.run()
>>> result = algorithm.getResult()

Attributes: thisownThe membership flag

Methods

 getClassName() Accessor to the object’s name. getCovarianceModel() Accessor to the covariance model. getId() Accessor to the object’s id. getMesh() Accessor to the mesh. getName() Accessor to the object’s name. getResult() Get the result structure. getShadowedId() Accessor to the object’s shadowed id. getThreshold() Accessor to the threshold used to select the most significant eigenmodes. getVisibility() Accessor to the object’s visibility state. hasName() Test if the object is named. hasVisibleName() Test if the object has a distinguishable name. run() Computation of the eigenvalues and eigenfunctions values at nodes. setCovarianceModel(covariance) Accessor to the covariance model. setName(name) Accessor to the object’s name. setShadowedId(id) Accessor to the object’s shadowed id. setThreshold(threshold) Accessor to the limit ratio on eigenvalues. setVisibility(visible) Accessor to the object’s visibility state.
__init__(*args)

Initialize self. See help(type(self)) for accurate signature.

getClassName()

Accessor to the object’s name.

Returns: class_namestrThe object class name (object.__class__.__name__).
getCovarianceModel()

Accessor to the covariance model.

Returns: covModelCovarianceModelThe covariance model.
getId()

Accessor to the object’s id.

Returns: idintInternal unique identifier.
getMesh()

Accessor to the mesh.

Returns: meshMeshThe mesh that discretizes the domain .
getName()

Accessor to the object’s name.

Returns: namestrThe name of the object.
getResult()

Get the result structure.

Returns: resKLKarhunenLoeveResultThe structure containing all the results of the Fredholm problem.

Notes

The structure contains all the results of the Fredholm problem.

getShadowedId()

Accessor to the object’s shadowed id.

Returns: idintInternal unique identifier.
getThreshold()

Accessor to the threshold used to select the most significant eigenmodes.

Returns: sfloat, positiveThe threshold .

Notes

OpenTURNS truncates the sequence at the index defined in (3).

getVisibility()

Accessor to the object’s visibility state.

Returns: visibleboolVisibility flag.
hasName()

Test if the object is named.

Returns: hasNameboolTrue if the name is not empty.
hasVisibleName()

Test if the object has a distinguishable name.

Returns: hasVisibleNameboolTrue if the name is not empty and not the default one.
run()

Computation of the eigenvalues and eigenfunctions values at nodes.

Notes

Runs the algorithm and creates the result structure KarhunenLoeveResult.

setCovarianceModel(covariance)

Accessor to the covariance model.

Parameters: covModelCovarianceModelThe covariance model.
setName(name)

Accessor to the object’s name.

Parameters: namestrThe name of the object.
setShadowedId(id)

Accessor to the object’s shadowed id.

Parameters: idintInternal unique identifier.
setThreshold(threshold)

Accessor to the limit ratio on eigenvalues.

Parameters: sfloat, The threshold defined in (3).
setVisibility(visible)

Accessor to the object’s visibility state.

Parameters: visibleboolVisibility flag.
thisown

The membership flag