.. 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 26-37 .. code-block:: default from __future__ import absolute_import, division, print_function, unicode_literals from future import standard_library from gemseo.api import configure_logger, create_discipline, create_scenario from gemseo.problems.sobieski.core import SobieskiProblem configure_logger() standard_library.install_aliases() .. GENERATED FROM PYTHON SOURCE LINES 38-40 Instantiate the discipline -------------------------- .. GENERATED FROM PYTHON SOURCE LINES 40-42 .. code-block:: default discipline = create_discipline("SobieskiMission") .. GENERATED FROM PYTHON SOURCE LINES 43-45 Create the design space ----------------------- .. GENERATED FROM PYTHON SOURCE LINES 45-48 .. code-block:: default design_space = SobieskiProblem().read_design_space() design_space.filter(["y_24", "y_34"]) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 49-53 Create the scenario ----------------------- Build scenario which links the disciplines with the formulation and The DOE algorithm. .. GENERATED FROM PYTHON SOURCE LINES 53-62 .. 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 63-66 Execute the scenario ----------------------- Here we use a latin hypercube sampling algorithm with 30 samples. .. GENERATED FROM PYTHON SOURCE LINES 66-68 .. code-block:: default scenario.execute({"n_samples": 30, "algo": "lhs"}) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none {'eval_jac': False, 'algo': 'lhs', 'n_samples': 30} .. GENERATED FROM PYTHON SOURCE LINES 69-71 Plot optimization history view ------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 71-73 .. code-block:: default scenario.post_process("OptHistoryView", save=False, show=True) .. rst-class:: sphx-glr-horizontal * .. image:: /examples/doe/images/sphx_glr_plot_sobieski_doe_disc_example_001.png :alt: Evolution of the optimization variables :class: sphx-glr-multi-img * .. image:: /examples/doe/images/sphx_glr_plot_sobieski_doe_disc_example_002.png :alt: Evolution of the objective value :class: sphx-glr-multi-img * .. image:: /examples/doe/images/sphx_glr_plot_sobieski_doe_disc_example_003.png :alt: Distance to the optimum :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/gemseo/conda/3.0.3/lib/python3.8/site-packages/gemseo/post/opt_history_view.py:312: UserWarning: FixedFormatter should only be used together with FixedLocator ax1.set_yticklabels(y_labels) .. GENERATED FROM PYTHON SOURCE LINES 74-76 Plot parallel coordinates ------------------------- .. GENERATED FROM PYTHON SOURCE LINES 76-79 .. code-block:: default scenario.post_process( "ScatterPlotMatrix", save=False, show=True, variables_list=["y_4", "y_24", "y_34"] ) .. image:: /examples/doe/images/sphx_glr_plot_sobieski_doe_disc_example_004.png :alt: plot sobieski doe disc example :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 1.207 seconds) .. _sphx_glr_download_examples_doe_plot_sobieski_doe_disc_example.py: .. only :: html .. container:: sphx-glr-footer :class: 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 `_