gemseo / core

Show inherited members

doe_scenario module

A scenario whose driver is a design of experiments.

class gemseo.core.doe_scenario.DOEScenario(disciplines, formulation, objective_name, design_space, name=None, grammar_type=GrammarType.JSON, maximize_objective=False, **formulation_options)[source]

Bases: Scenario

A multidisciplinary scenario to be executed by a design of experiments (DOE).

A DOEScenario is a particular Scenario whose driver is a DOE. This DOE must be implemented in a DOELibrary.

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

Parameters:
  • disciplines (Sequence[MDODiscipline]) – The disciplines used to compute the objective, constraints and observables from the design variables.

  • formulation (str) – The class name of the MDOFormulation, e.g. "MDF", "IDF" or "BiLevel".

  • objective_name (str | Sequence[str]) – The name(s) of the discipline output(s) used as objective. If multiple names are passed, the objective will be a vector.

  • design_space (DesignSpace) – The search space including at least the design variables (some formulations requires additional variables, e.g. IDF with the coupling variables).

  • name (str | None) – The name to be given to this scenario. If None, use the name of the class.

  • grammar_type (MDODiscipline.GrammarType) –

    The grammar for the scenario and the MDO formulation.

    By default it is set to “JSONGrammar”.

  • maximize_objective (bool) –

    Whether to maximize the objective.

    By default it is set to False.

  • **formulation_options (Any) – The options of the MDOFormulation.

to_dataset(name=None, categorize=True, opt_naming=True, export_gradients=False)[source]

Export the database of the optimization problem to a Dataset.

The variables can be classified into groups: Dataset.DESIGN_GROUP or Dataset.INPUT_GROUP for the design variables and Dataset.FUNCTION_GROUP or Dataset.OUTPUT_GROUP for the functions (objective, constraints and observables).

Parameters:
  • name (str | None) – The name to be given to the dataset. If empty, use the name of the OptimizationProblem.database.

  • categorize (bool) –

    Whether to distinguish between the different groups of variables. Otherwise, group all the variables in Dataset.PARAMETER_GROUP`.

    By default it is set to True.

  • opt_naming (bool) –

    Whether to use Dataset.DESIGN_GROUP and Dataset.FUNCTION_GROUP as groups. Otherwise, use Dataset.INPUT_GROUP and Dataset.OUTPUT_GROUP.

    By default it is set to True.

  • export_gradients (bool) –

    Whether to export the gradients of the functions (objective function, constraints and observables) if the latter are available in the database of the optimization problem.

    By default it is set to False.

Returns:

A dataset built from the database of the optimization problem.

Return type:

Dataset

EVAL_JAC = 'eval_jac'
N_SAMPLES = 'n_samples'
cache: AbstractCache | None

The cache containing one or several executions of the discipline according to the cache policy.

data_processor: DataProcessor

A tool to pre- and post-process discipline data.

exec_for_lin: bool

Whether the last execution was due to a linearization.

formulation: MDOFormulation

The MDO formulation.

formulation_name: str

The name of the MDO formulation.

input_grammar: BaseGrammar

The input grammar.

jac: MutableMapping[str, MutableMapping[str, ndarray | csr_array | JacobianOperator]]

The Jacobians of the outputs wrt inputs.

The structure is {output: {input: matrix}}.

name: str

The name of the discipline.

optimization_result: OptimizationResult | None

The optimization result if the scenario has been executed; otherwise None.

output_grammar: BaseGrammar

The output grammar.

re_exec_policy: ReExecutionPolicy

The policy to re-execute the same discipline.

residual_variables: dict[str, str]

The output variables mapping to their inputs, to be considered as residuals; they shall be equal to zero.

run_solves_residuals: bool

Whether the run method shall solve the residuals.

Examples using DOEScenario

Parameter space

Parameter space

Empirical estimation of statistics

Empirical estimation of statistics

Pareto front on the Binh and Korn problem using a BiLevel formulation

Pareto front on the Binh and Korn problem using a BiLevel formulation

Create a DOE Scenario

Create a DOE Scenario

Scenario

Scenario

Multistart optimization

Multistart optimization

Diagonal design of experiments

Diagonal design of experiments

Scalable diagonal discipline

Scalable diagonal discipline

BiLevel-based DOE on the Sobieski SSBJ test case

BiLevel-based DOE on the Sobieski SSBJ test case

MDF-based DOE on the Sobieski SSBJ test case

MDF-based DOE on the Sobieski SSBJ test case

Change the seed of a DOE

Change the seed of a DOE

Simple disciplinary DOE example on the Sobieski SSBJ test case

Simple disciplinary DOE example on the Sobieski SSBJ test case

Use a design of experiments from a file

Use a design of experiments from a file

Use a design of experiments from an array

Use a design of experiments from an array

Create a surrogate discipline

Create a surrogate discipline

API

API

GP regression

GP regression

Linear regression

Linear regression

PCE regression

PCE regression

Polynomial regression

Polynomial regression

RBF regression

RBF regression

Random forest regression

Random forest regression

Save and Load

Save and Load

Parameter space

Parameter space

Scatter plot matrix

Scatter plot matrix

Self-Organizing Map

Self-Organizing Map