.. 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-42 .. code-block:: default 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 Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 43-49 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 49-55 .. 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 56-60 Create the disciplinary datasets -------------------------------- Then, we create the disciplinary :class:`.AbstractFullCache` datasets based on a :class:`.DiagonalDOE`. .. GENERATED FROM PYTHON SOURCE LINES 60-78 .. 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 Out: .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/4.0.1/lib/python3.9/site-packages/gemseo/algos/design_space.py:448: ComplexWarning: Casting complex values to real discards the imaginary part self.__current_value[name] = array_value.astype( INFO - 10:03:58: INFO - 10:03:58: *** Start DOEScenario execution *** INFO - 10:03:58: DOEScenario INFO - 10:03:58: Disciplines: Aerodynamics INFO - 10:03:58: MDO formulation: DisciplinaryOpt INFO - 10:03:58: Optimization problem: INFO - 10:03:58: minimize drag(thick_airfoils, sweep, displ) INFO - 10:03:58: with respect to displ, sweep, thick_airfoils INFO - 10:03:58: over the design space: INFO - 10:03:58: +----------------+-------------+-------+-------------+-------+ INFO - 10:03:58: | name | lower_bound | value | upper_bound | type | INFO - 10:03:58: +----------------+-------------+-------+-------------+-------+ INFO - 10:03:58: | thick_airfoils | 5 | 15 | 25 | float | INFO - 10:03:58: | sweep | 10 | 25 | 35 | float | INFO - 10:03:58: | displ | -1000 | -700 | 1000 | float | INFO - 10:03:58: +----------------+-------------+-------+-------------+-------+ INFO - 10:03:58: Solving optimization problem with algorithm DiagonalDOE: INFO - 10:03:58: ... 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 `_