mdo_scenario module¶
A Scenario which driver is an optimization algorithm¶
-
class
gemseo.core.mdo_scenario.
MDOObjScenarioAdapter
(scenario, inputs_list, outputs_list, reset_x0_before_opt=False, set_x0_before_opt=False, set_bounds_before_opt=False)[source]¶ Bases:
gemseo.core.mdo_scenario.MDOScenarioAdapter
A scenario adapter that overwrites the local data with the optimal objective function value.
Constructor
- Parameters
scenario (MDOScenario) – the scenario to adapt
inputs_list (list(str)) – list of inputs to overload at sub scenario execution
outputs_list (list(str)) – list of outputs to get from scenario execution
reset_x0_before_opt (bool) – before running the sub optimization, reset the initial guess
set_x0_before_opt (bool) – if True, sets the initial point of the sub scenario, useful for multi-start
set_bounds_before_opt (bool) – if True, sets the bounds of the design space, useful for trust regions
-
class
gemseo.core.mdo_scenario.
MDOScenario
(disciplines, formulation, objective_name, design_space, name=None, **formulation_options)[source]¶ Bases:
gemseo.core.scenario.Scenario
Multidisciplinary Design Optimization Scenario, main user interface Creates an optimization problem and solves it with an optimizer
The main differences between Scenario and MDOScenario are the allowed inputs in the MDOScenario.json, which differs from DOEScenario.json, at least on the driver names
MDO Problem description: links the disciplines and the formulation to create an optimization problem. Use the class by instantiation.
Create your disciplines beforehand.
Specify the formulation by giving the class name such as the string “MDF”
The reference_input_data is the typical input data dict that is provided to the run method of the disciplines
Specify the objective function name, which must be an output of a discipline of the scenario, with the “objective_name” attribute
If you want to add additional design constraints, use the add_user_defined_constraint method
To view the results, use the “post_process” method after execution. You can view:
the design variables history, the objective value, the constraints, by using: scenario.post_process(“OptHistoryView”, show=False, save=True)
Quadratic approximations of the functions close to the optimum, when using gradient based algorithms, by using: scenario.post_process(“QuadApprox”, method=”SR1”, show=False, save=True, function=”my_objective_name”, file_path=”appl_dir”)
Self Organizing Maps of the design space, by using: scenario.post_process(“SOM”, save=True, file_path=”appl_dir”)
To list post-processing on your setup, use the method scenario.posts For more detains on their options, go to the “gemseo.post” package
Constructor, initializes the MDO scenario Objects instantiation and checks are made before run intentionally
- Parameters
disciplines – the disciplines of the scenario
formulation – the formulation name, the class name of the formulation in gemseo.formulations
objective_name – the objective function name
design_space – the design space
name – scenario name
formulation_options – options for creation of the formulation
-
MAX_ITER
= 'max_iter'¶
-
X_OPT
= 'x_opt'¶
-
class
gemseo.core.mdo_scenario.
MDOScenarioAdapter
(scenario, inputs_list, outputs_list, reset_x0_before_opt=False, set_x0_before_opt=False, set_bounds_before_opt=False)[source]¶ Bases:
gemseo.core.discipline.MDODiscipline
An adapter class for MDO Scenario: input variables are specified they update default_data in the top level discipline they output data from the top level discipline outputs.
Constructor
- Parameters
scenario (MDOScenario) – the scenario to adapt
inputs_list (list(str)) – list of inputs to overload at sub scenario execution
outputs_list (list(str)) – list of outputs to get from scenario execution
reset_x0_before_opt (bool) – before running the sub optimization, reset the initial guess
set_x0_before_opt (bool) – if True, sets the initial point of the sub scenario, useful for multi-start
set_bounds_before_opt (bool) – if True, sets the bounds of the design space, useful for trust regions
-
LOWER_BND_SUFFIX
= '_lower_bnd'¶
-
UPPER_BND_SUFFIX
= '_upper_bnd'¶