cosapp.drivers.montecarlo

Classes

MonteCarlo(name[, owner])

This driver execute a MonteCarlo simulation on its system.

RandomVariable(variable, distribution, connector)

class cosapp.drivers.montecarlo.MonteCarlo(name: str, owner: cosapp.systems.System | None = None, **kwargs)[source]

Bases: AbstractSetOfCases

This driver execute a MonteCarlo simulation on its system.

A: numpy.ndarray | None
X0: numpy.ndarray | None
Y0: numpy.ndarray | None
add_random_variable(names: str | Iterable[str]) None[source]

Add variable to be perturbated.

The perturbation distribution is defined by the variable distribution details.

Parameters:

names (Union[str, Iterable[str]]) – List of variables to be perturbated

add_response(name: str | Iterable[str]) None[source]

Add a variable for which the statistical response will be calculated.

Parameters:

name (Union[str, Iterable[str]]) – List of variable names to add

compute() None[source]

Contains the customized Module calculation, to execute after children.

draws: int
linear: bool
perturbations: numpy.ndarray | None
random_variables: Dict[str, RandomVariable]
reference_case_solution: Dict[str, float]
responses: List[str]
solver: AbstractSolver | None
class cosapp.drivers.montecarlo.RandomVariable(variable, distribution, connector)[source]

Bases: NamedTuple

add_noise(quantile=None) float[source]
connector: SystemConnector | None

Alias for field number 2

distribution: Distribution

Alias for field number 1

draw(quantile=None) float[source]
set_perturbation(value) None[source]
variable: VariableReference

Alias for field number 0