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)

Methods

getClassName()

Accessor to the object's name.

getDescription()

Description accessor.

getDistribution()

Distribution accessor.

getDistributionParametersType()

Distribution parameters type accessor.

getFiniteDifferenceStep()

Finite difference step accessor.

getName()

Accessor to the object's name.

getPythonScript()

Python script accessor.

getUnit()

Unit accessor.

getValue()

Default value accessor.

hasName()

Test if the object is named.

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.

setStochastic(stoch)

Whether the variable is stochastic.

setUnit(unit)

Unit accessor.

setValue(value)

Default value accessor.

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)
__init__(*args)
getClassName()

Accessor to the object’s name.

Returns:
class_namestr

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

getDescription()

Description accessor.

Returns:
descriptionopenturns.Description

Text describing the variable

getDistribution()

Distribution accessor.

Returns:
distributionopenturns.Distribution

Distribution associated with the variable

getDistributionParametersType()

Distribution parameters type accessor.

Returns:
parametersTypeint

Distribution parameters index

getFiniteDifferenceStep()

Finite difference step accessor.

Returns:
stepfloat

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

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getPythonScript()

Python script accessor.

Returns:
scriptstr

Python script to replay the analysis

getUnit()

Unit accessor.

Returns:
unitstr

Physical quantity unit, if applicable

getValue()

Default value accessor.

Returns:
valuefloat

Default value

hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

isStochastic()

Whether the variable is stochastic.

Returns:
isStochasticbool

Whether the variable is stochastic

setDescription(description)

Description accessor.

Parameters:
descriptionstr

Text describing the variable

setDistribution(distribution)

Distribution accessor.

Parameters:
distributionopenturns.Distribution

Distribution associated with the variable

setDistributionParametersType(distributionParametersType)

Distribution parameters type accessor.

Parameters:
parametersTypeint

Distribution parameters index

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

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

setStochastic(stoch)

Whether the variable is stochastic.

Parameters:
isStochasticbool

Whether the variable is stochastic

setUnit(unit)

Unit accessor.

Parameters:
unitstr

Physical quantity unit, if applicable

setValue(value)

Default value accessor.

Parameters:
valuefloat

Default value