Input

class persalys.Input(*args)

Create an input variable.

Represents an input variable.

Parameters
namestr

Name

valuefloat

Default value

distributionDistribution

Associated distribution

descriptionstr

Description text (optional)

Examples

>>> import openturns as ot
>>> import persalys
>>> F = persalys.Input('F', 0., ot.Normal(75000., 5000.), 'Traction load')
>>> R = persalys.Input('R', ot.Normal(75000., 5000.))
>>> S = persalys.Input('S', 10.5)

Methods

getClassName(self)

Accessor to the object’s name.

getDescription(self)

Description accessor.

getDistribution(self)

Distribution accessor.

getDistributionParametersType(self)

Distribution parameters type accessor.

getFiniteDifferenceStep(self)

Finite difference step accessor.

getId(self)

Accessor to the object’s id.

getName(self)

Accessor to the object’s name.

getPythonScript(self)

Python script accessor.

getShadowedId(self)

Accessor to the object’s shadowed id.

getValue(self)

Default value accessor.

getVisibility(self)

Accessor to the object’s visibility state.

hasName(self)

Test if the object is named.

hasVisibleName(self)

Test if the object has a distinguishable name.

isStochastic(self)

Whether the variable is stochastic.

setDescription(self, description)

Description accessor.

setDistribution(self, distribution)

Distribution accessor.

setDistributionParametersType(self, …)

Distribution parameters type accessor.

setFiniteDifferenceStep(self, step)

Finite difference step accessor.

setName(self, name)

Accessor to the object’s name.

setShadowedId(self, id)

Accessor to the object’s shadowed id.

setStochastic(self, stoch)

Whether the variable is stochastic.

setValue(self, value)

Default value accessor.

setVisibility(self, visible)

Accessor to the object’s visibility state.

__init__(self, *args)

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

getClassName(self)

Accessor to the object’s name.

Returns
class_namestr

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

getDescription(self)

Description accessor.

Returns
descriptionopenturns.Description

Text describing the variable

getDistribution(self)

Distribution accessor.

Returns
distributionopenturns.Distribution

Distribution associated with the variable

getDistributionParametersType(self)

Distribution parameters type accessor.

Returns
parametersTypeint

Distribution parameters index

getFiniteDifferenceStep(self)

Finite difference step accessor.

Returns
stepfloat

Finite difference step used to define the gradient of the model’s function

getId(self)

Accessor to the object’s id.

Returns
idint

Internal unique identifier.

getName(self)

Accessor to the object’s name.

Returns
namestr

The name of the object.

getPythonScript(self)

Python script accessor.

Returns
scriptstr

Python script to replay the analysis

getShadowedId(self)

Accessor to the object’s shadowed id.

Returns
idint

Internal unique identifier.

getValue(self)

Default value accessor.

Returns
valuefloat

Default value

getVisibility(self)

Accessor to the object’s visibility state.

Returns
visiblebool

Visibility flag.

hasName(self)

Test if the object is named.

Returns
hasNamebool

True if the name is not empty.

hasVisibleName(self)

Test if the object has a distinguishable name.

Returns
hasVisibleNamebool

True if the name is not empty and not the default one.

isStochastic(self)

Whether the variable is stochastic.

Returns
isStochasticbool

Whether the variable is stochastic

setDescription(self, description)

Description accessor.

Parameters
descriptionstr

Text describing the variable

setDistribution(self, distribution)

Distribution accessor.

Parameters
distributionopenturns.Distribution

Distribution associated with the variable

setDistributionParametersType(self, distributionParametersType)

Distribution parameters type accessor.

Parameters
parametersTypeint

Distribution parameters index

setFiniteDifferenceStep(self, step)

Finite difference step accessor.

Parameters
stepfloat

Finite difference step used to define the gradient and the hessian of the model’s function. By default the step is equal to 1e-7. The gradient function is defined with the first order non-centered finite difference scheme and the hessian function with the second order centered finite difference scheme.

Notes

First order non-centered finite difference scheme:

\frac{\partial f_j}{\partial x_i} \approx \frac{f_j(x + \epsilon_i) - f_j(x)}
                                               {\epsilon_i}

Second order centered finite difference scheme:

\frac{\partial^2 f_k}{\partial x_i \partial x_j} \approx
                                   \frac{
                                      f_k(x + \epsilon_i + \epsilon_j) -
                                      f_k(x + \epsilon_i - \epsilon_j) +
                                      f_k(x - \epsilon_i - \epsilon_j) -
                                      f_k(x - \epsilon_i + \epsilon_j)}
                                   {4 \epsilon_i \epsilon_j}

setName(self, name)

Accessor to the object’s name.

Parameters
namestr

The name of the object.

setShadowedId(self, id)

Accessor to the object’s shadowed id.

Parameters
idint

Internal unique identifier.

setStochastic(self, stoch)

Whether the variable is stochastic.

Parameters
isStochasticbool

Whether the variable is stochastic

setValue(self, value)

Default value accessor.

Parameters
valuefloat

Default value

setVisibility(self, visible)

Accessor to the object’s visibility state.

Parameters
visiblebool

Visibility flag.