.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/doe/plot_sobieski_doe_disc_example.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_doe_plot_sobieski_doe_disc_example.py: Simple disciplinary DOE example on the Sobieski SSBJ test case ============================================================== .. GENERATED FROM PYTHON SOURCE LINES 24-35 .. 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.sobieski.core.problem import SobieskiProblem from matplotlib import pyplot as plt configure_logger() .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 36-38 Instantiate the discipline -------------------------- .. GENERATED FROM PYTHON SOURCE LINES 38-40 .. code-block:: default discipline = create_discipline("SobieskiMission") .. GENERATED FROM PYTHON SOURCE LINES 41-43 Create the design space ----------------------- .. GENERATED FROM PYTHON SOURCE LINES 43-46 .. code-block:: default design_space = SobieskiProblem().design_space design_space.filter(["y_24", "y_34"]) .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 47-51 Create the scenario ----------------------- Build scenario which links the disciplines with the formulation and The DOE algorithm. .. GENERATED FROM PYTHON SOURCE LINES 51-60 .. code-block:: default scenario = create_scenario( [discipline], formulation="DisciplinaryOpt", objective_name="y_4", design_space=design_space, maximize_objective=True, scenario_type="DOE", ) .. GENERATED FROM PYTHON SOURCE LINES 61-64 Execute the scenario ----------------------- Here we use a latin hypercube sampling algorithm with 30 samples. .. GENERATED FROM PYTHON SOURCE LINES 64-66 .. code-block:: default scenario.execute({"n_samples": 30, "algo": "lhs"}) .. rst-class:: sphx-glr-script-out .. code-block:: none INFO - 14:48:03: INFO - 14:48:03: *** Start DOEScenario execution *** INFO - 14:48:03: DOEScenario INFO - 14:48:03: Disciplines: SobieskiMission INFO - 14:48:03: MDO formulation: DisciplinaryOpt INFO - 14:48:03: Optimization problem: INFO - 14:48:03: minimize -y_4(y_24, y_34) INFO - 14:48:03: with respect to y_24, y_34 INFO - 14:48:03: over the design space: INFO - 14:48:03: +------+-------------+------------+-------------+-------+ INFO - 14:48:03: | name | lower_bound | value | upper_bound | type | INFO - 14:48:03: +------+-------------+------------+-------------+-------+ INFO - 14:48:03: | y_24 | 0.44 | 4.15006276 | 11.13 | float | INFO - 14:48:03: | y_34 | 0.44 | 1.10754577 | 1.98 | float | INFO - 14:48:03: +------+-------------+------------+-------------+-------+ INFO - 14:48:03: Solving optimization problem with algorithm lhs: INFO - 14:48:03: ... 0%| | 0/30 [00:00 .. GENERATED FROM PYTHON SOURCE LINES 72-74 Plot parallel coordinates ------------------------- .. GENERATED FROM PYTHON SOURCE LINES 74-79 .. code-block:: default scenario.post_process( "ScatterPlotMatrix", save=False, show=False, variable_names=["y_4", "y_24", "y_34"] ) # Workaround for HTML rendering, instead of ``show=True`` plt.show() .. image-sg:: /examples/doe/images/sphx_glr_plot_sobieski_doe_disc_example_004.png :alt: plot sobieski doe disc example :srcset: /examples/doe/images/sphx_glr_plot_sobieski_doe_disc_example_004.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 1.320 seconds) .. _sphx_glr_download_examples_doe_plot_sobieski_doe_disc_example.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_sobieski_doe_disc_example.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_sobieski_doe_disc_example.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_