Input

class persalys.Input(*args)

Create an input variable.

Represents an input variable.

Parameters:

name : str

Name

value : float

Default value

distribution : Distribution

Associated distribution

description : str

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() Accessor to the object’s name.
getDescription() Description accessor.
getDistribution() Distribution accessor.
getDistributionParametersType() Distribution parameters type accessor.
getFiniteDifferenceStep() Finite difference step accessor.
getId() Accessor to the object’s id.
getName() Accessor to the object’s name.
getPythonScript() Python script accessor.
getShadowedId() Accessor to the object’s shadowed id.
getValue() Default value accessor.
getVisibility() Accessor to the object’s visibility state.
hasName() Test if the object is named.
hasVisibleName() Test if the object has a distinguishable name.
isStochastic() Whether the variable is stochastic.
setDescription(description) Description accessor.
setDistribution(distribution) Distribution accessor.
setDistributionParametersType(…) Distribution parameters type accessor.
setFiniteDifferenceStep(step) Finite difference step accessor.
setName(name) Accessor to the object’s name.
setShadowedId(id) Accessor to the object’s shadowed id.
setStochastic(stoch) Whether the variable is stochastic.
setValue(value) Default value accessor.
setVisibility(visible) Accessor to the object’s visibility state.
__init__(*args)
getClassName()

Accessor to the object’s name.

Returns:

class_name : str

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

getDescription()

Description accessor.

Returns:

description : openturns.Description

Text describing the variable

getDistribution()

Distribution accessor.

Returns:

distribution : openturns.Distribution

Distribution associated with the variable

getDistributionParametersType()

Distribution parameters type accessor.

Returns:

parametersType : int

Distribution parameters index

getFiniteDifferenceStep()

Finite difference step accessor.

Returns:

step : float

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

getId()

Accessor to the object’s id.

Returns:

id : int

Internal unique identifier.

getName()

Accessor to the object’s name.

Returns:

name : str

The name of the object.

getPythonScript()

Python script accessor.

Returns:

script : str

Python script to replay the analysis

getShadowedId()

Accessor to the object’s shadowed id.

Returns:

id : int

Internal unique identifier.

getValue()

Default value accessor.

Returns:

value : float

Default value

getVisibility()

Accessor to the object’s visibility state.

Returns:

visible : bool

Visibility flag.

hasName()

Test if the object is named.

Returns:

hasName : bool

True if the name is not empty.

hasVisibleName()

Test if the object has a distinguishable name.

Returns:

hasVisibleName : bool

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

isStochastic()

Whether the variable is stochastic.

Returns:

isStochastic : bool

Whether the variable is stochastic

setDescription(description)

Description accessor.

Parameters:

description : str

Text describing the variable

setDistribution(distribution)

Distribution accessor.

Parameters:

distribution : openturns.Distribution

Distribution associated with the variable

setDistributionParametersType(distributionParametersType)

Distribution parameters type accessor.

Parameters:

parametersType : int

Distribution parameters index

setFiniteDifferenceStep(step)

Finite difference step accessor.

Parameters:

step : float

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(name)

Accessor to the object’s name.

Parameters:

name : str

The name of the object.

setShadowedId(id)

Accessor to the object’s shadowed id.

Parameters:

id : int

Internal unique identifier.

setStochastic(stoch)

Whether the variable is stochastic.

Parameters:

isStochastic : bool

Whether the variable is stochastic

setValue(value)

Default value accessor.

Parameters:

value : float

Default value

setVisibility(visible)

Accessor to the object’s visibility state.

Parameters:

visible : bool

Visibility flag.