.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/scalable/plot_problem.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_scalable_plot_problem.py: Scalable problem ================ We want to solve the Aerostructure MDO problem by means of the :class:`.MDF` formulation with a higher dimension for the sweep parameter. For that, we use the :class:`.ScalableProblem` class. .. GENERATED FROM PYTHON SOURCE LINES 30-44 .. code-block:: default from __future__ import annotations from gemseo.api import configure_logger from gemseo.api import create_discipline from gemseo.api import create_scenario from gemseo.problems.aerostructure.aerostructure_design_space import ( AerostructureDesignSpace, ) from gemseo.problems.scalable.data_driven.problem import ScalableProblem from matplotlib import pyplot as plt configure_logger() .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 45-51 Define the design problem ------------------------- In a first step, we define the design problem in terms of objective function (to maximize or minimize), design variables (local and global) and constraints (equality and inequality). .. GENERATED FROM PYTHON SOURCE LINES 51-57 .. code-block:: default design_variables = ["thick_airfoils", "thick_panels", "sweep"] objective_function = "range" eq_constraints = ["c_rf"] ineq_constraints = ["c_lift"] maximize_objective = True .. GENERATED FROM PYTHON SOURCE LINES 58-62 Create the disciplinary datasets -------------------------------- Then, we create the disciplinary :class:`.AbstractFullCache` datasets based on a :class:`.DiagonalDOE`. .. GENERATED FROM PYTHON SOURCE LINES 62-80 .. code-block:: default disciplines = create_discipline(["Aerodynamics", "Structure", "Mission"]) datasets = [] for discipline in disciplines: design_space = AerostructureDesignSpace() design_space.filter(discipline.get_input_data_names()) output_names = iter(discipline.get_output_data_names()) scenario = create_scenario( discipline, "DisciplinaryOpt", next(output_names), design_space, scenario_type="DOE", ) for output_name in output_names: scenario.add_observable(output_name) scenario.execute({"algo": "DiagonalDOE", "n_samples": 10}) datasets.append(scenario.export_to_dataset(name=discipline.name, opt_naming=False)) .. rst-class:: sphx-glr-script-out .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.1.0/lib/python3.9/site-packages/gemseo/algos/design_space.py:459: ComplexWarning: Casting complex values to real discards the imaginary part self.__current_value[name] = array_value.astype( INFO - 14:44:49: INFO - 14:44:49: *** Start DOEScenario execution *** INFO - 14:44:49: DOEScenario INFO - 14:44:49: Disciplines: Aerodynamics INFO - 14:44:49: MDO formulation: DisciplinaryOpt INFO - 14:44:49: Optimization problem: INFO - 14:44:49: minimize drag(thick_airfoils, sweep, displ) INFO - 14:44:49: with respect to displ, sweep, thick_airfoils INFO - 14:44:49: over the design space: INFO - 14:44:49: +----------------+-------------+-------+-------------+-------+ INFO - 14:44:49: | name | lower_bound | value | upper_bound | type | INFO - 14:44:49: +----------------+-------------+-------+-------------+-------+ INFO - 14:44:49: | thick_airfoils | 5 | 15 | 25 | float | INFO - 14:44:49: | sweep | 10 | 25 | 35 | float | INFO - 14:44:49: | displ | -1000 | -700 | 1000 | float | INFO - 14:44:49: +----------------+-------------+-------+-------------+-------+ INFO - 14:44:49: Solving optimization problem with algorithm DiagonalDOE: INFO - 14:44:49: ... 0%| | 0/10 [00:00` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_problem.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_