problem module¶
Scalable MDO problem.
This module implements the concept of scalable problem by means of the
ScalableProblem
class.
Given
an MDO scenario based on a set of sampled disciplines with a particular problem dimension,
a new problem dimension (= number of inputs and outputs),
a scalable problem:
makes each discipline scalable based on the new problem dimension,
creates the corresponding MDO scenario.
Then, this MDO scenario can be executed and post-processed.
We can repeat this tasks for different sizes of variables and compare the scalability, which is the dependence of the scenario results on the problem dimension.
See also
- class gemseo.problems.scalable.data_driven.problem.ScalableProblem(datasets, design_variables, objective_function, eq_constraints=None, ineq_constraints=None, maximize_objective=False, sizes=None, **parameters)[source]¶
Bases:
object
Scalable problem.
- Parameters:
datasets (Iterable[IODataset]) – One input-output dataset per discipline.
design_variables (Iterable[str]) – The names of the design variables.
objective_function (str) – The name of the objective.
eq_constraints (Iterable[str] | None) – The names of the equality constraints, if any.
ineq_constraints (Iterable[str] | None) – The names of the inequality constraints, if any.
maximize_objective (bool) –
Whether to maximize the objective.
By default it is set to False.
sizes (Mapping[str, int] | None) – The sizes of the inputs and outputs. If
None
, use the original sizes.**parameters (Any) – The optional parameters of the scalable model.
- create_scenario(formulation='DisciplinaryOpt', scenario_type='MDO', start_at_equilibrium=False, active_probability=0.1, feasibility_level=0.5, **options)[source]¶
Create a
Scenario
from the scalable disciplines.- Parameters:
formulation (str) –
The MDO formulation to use for the scenario.
By default it is set to “DisciplinaryOpt”.
scenario_type (str) –
The type of scenario, either
MDO
orDOE
.By default it is set to “MDO”.
start_at_equilibrium (bool) –
Whether to start at equilibrium using a preliminary MDA.
By default it is set to False.
active_probability (float) –
The probability to set the inequality constraints as active at the initial step of the optimization.
By default it is set to 0.1.
feasibility_level (float) –
The offset of satisfaction for inequality constraints.
By default it is set to 0.5.
**options – The formulation options.
- Returns:
The
Scenario
from the scalable disciplines.- Return type:
- plot_1d_interpolations(save=True, show=False, step=0.01, varnames=None, directory='.', png=False)[source]¶
Plot 1d interpolations.
- Parameters:
save (bool) –
Whether to save the figure.
By default it is set to True.
show (bool) –
Whether to display the figure.
By default it is set to False.
step (float) –
The step to evaluate the 1d interpolation function.
By default it is set to 0.01.
varnames (Sequence[str] | None) – The names of the variable to plot. If
None
, all the variables are plotted.directory (Path | str) –
The directory path.
By default it is set to “.”.
png (bool) –
Whether to use PNG file format instead of PDF.
By default it is set to False.
- property n_calls_linearize: dict[str, int]¶
The number of disciplinary linearizations per discipline.
- property n_calls_linearize_top_level: dict[str, int]¶
The number of top-level disciplinary linearizations per discipline.