.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/scalable/plot_scalable_param_mdf.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_scalable_param_mdf.py: Parametric scalable MDO problem - MDF ===================================== We define a scalable problem based on two strongly coupled disciplines and a weakly one, with the following properties: - 3 shared design parameters, - 2 local design parameters for the first strongly coupled discipline, - 2 coupling variables for the first strongly coupled discipline, - 4 local design parameters for the second strongly coupled discipline, - 3 coupling variables for the second strongly coupled discipline. We would like to solve this MDO problem by means of an MDF formulation. .. GENERATED FROM PYTHON SOURCE LINES 38-47 .. code-block:: default from __future__ import division, unicode_literals from matplotlib import pyplot as plt from gemseo.api import configure_logger, create_scenario, generate_n2_plot from gemseo.problems.scalable.parametric.problem import TMScalableProblem configure_logger() .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 48-50 Instantiation of the scalable problem ------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 50-55 .. code-block:: default n_shared = 3 n_local = [2, 4] n_coupling = [2, 3] problem = TMScalableProblem(n_shared, n_local, n_coupling) .. GENERATED FROM PYTHON SOURCE LINES 56-58 Display the coupling structure ------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 58-60 .. code-block:: default generate_n2_plot(problem.disciplines, save=False, show=True) .. image:: /examples/scalable/images/sphx_glr_plot_scalable_param_mdf_001.png :alt: plot scalable param mdf :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 61-63 Solve the MDO using an MDF formulation -------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 63-68 .. code-block:: default scenario = create_scenario(problem.disciplines, "MDF", "obj", problem.design_space) scenario.add_constraint("cstr_0", "ineq") scenario.add_constraint("cstr_1", "ineq") scenario.execute({"algo": "NLOPT_SLSQP", "max_iter": 100}) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none INFO - 14:42:49: INFO - 14:42:49: *** Start MDO Scenario execution *** INFO - 14:42:49: MDOScenario INFO - 14:42:49: Disciplines: MainModel SubModel_0 SubModel_1 INFO - 14:42:49: MDOFormulation: MDF INFO - 14:42:49: Algorithm: NLOPT_SLSQP INFO - 14:42:49: Optimization problem: INFO - 14:42:49: Minimize: obj(x_local_0, x_local_1, x_shared) INFO - 14:42:49: With respect to: x_local_0, x_local_1, x_shared INFO - 14:42:49: Subject to constraints: INFO - 14:42:49: cstr_0(x_local_0, x_local_1, x_shared) <= 0.0 INFO - 14:42:49: cstr_1(x_local_0, x_local_1, x_shared) <= 0.0 INFO - 14:42:49: +------------------------------------------------------------------------------+ INFO - 14:42:49: | Parameter space | INFO - 14:42:49: +-----------+-------------+-------+-------------+-------+----------------------+ INFO - 14:42:49: | name | lower_bound | value | upper_bound | type | Initial distribution | INFO - 14:42:49: +-----------+-------------+-------+-------------+-------+----------------------+ INFO - 14:42:49: | x_local_0 | 0 | 0.5 | 1 | float | | INFO - 14:42:49: | x_local_0 | 0 | 0.5 | 1 | float | | INFO - 14:42:49: | x_local_1 | 0 | 0.5 | 1 | float | | INFO - 14:42:49: | x_local_1 | 0 | 0.5 | 1 | float | | INFO - 14:42:49: | x_local_1 | 0 | 0.5 | 1 | float | | INFO - 14:42:49: | x_local_1 | 0 | 0.5 | 1 | float | | INFO - 14:42:49: | x_shared | 0 | 0.5 | 1 | float | | INFO - 14:42:49: | x_shared | 0 | 0.5 | 1 | float | | INFO - 14:42:49: | x_shared | 0 | 0.5 | 1 | float | | INFO - 14:42:49: +-----------+-------------+-------+-------------+-------+----------------------+ INFO - 14:42:49: Optimization: 0%| | 0/100 [00:00` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_scalable_param_mdf.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_