.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/post_process/algorithms/plot_opt_hist_view.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_post_process_algorithms_plot_opt_hist_view.py: Optimization History View ========================= In this example, we illustrate the use of the :class:`.OptHistoryView` post-processing on the Sobieski's SSBJ problem. The :class:`.OptHistoryView` post-processing creates a series of plots: - **The design variables history**: shows the normalized values of the design variables. On the :math:`y` axis are the components of the design variables vector and on the :math:`x` axis the iterations. The values are **normalized** between 0 and 1 and represented by colors. - **The objective function history**: shows the evolution of the objective function value during the optimization. - **The distance to the best design variables**: shows the Euclidean distance :math:`||x-x^*||_2` between the different design variable vectors considered by the optimizer and the best one (in log scale). - **The inequality constraint history**: shows the evolution of the constraints values. On the :math:`y` axis are the components of the constraints and on the :math:`x` axis the iterations.The color indicates whether the constraint component is satisfied: red means violated, white means active and green means satisfied. For an :ref:`IDF formulation `, an additional plot is created to track the equality constraint history. .. GENERATED FROM PYTHON SOURCE LINES 46-60 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/post_process/algorithms/images/sphx_glr_plot_opt_hist_view_001.png :alt: Evolution of the optimization variables :srcset: /examples/post_process/algorithms/images/sphx_glr_plot_opt_hist_view_001.png :class: sphx-glr-multi-img * .. image-sg:: /examples/post_process/algorithms/images/sphx_glr_plot_opt_hist_view_002.png :alt: Evolution of the objective value :srcset: /examples/post_process/algorithms/images/sphx_glr_plot_opt_hist_view_002.png :class: sphx-glr-multi-img * .. image-sg:: /examples/post_process/algorithms/images/sphx_glr_plot_opt_hist_view_003.png :alt: Evolution of the distance to the optimum :srcset: /examples/post_process/algorithms/images/sphx_glr_plot_opt_hist_view_003.png :class: sphx-glr-multi-img * .. image-sg:: /examples/post_process/algorithms/images/sphx_glr_plot_opt_hist_view_004.png :alt: Evolution of the inequality constraints :srcset: /examples/post_process/algorithms/images/sphx_glr_plot_opt_hist_view_004.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none | .. code-block:: Python from __future__ import annotations from gemseo import execute_post from gemseo.settings.post import OptHistoryView_Settings execute_post( "sobieski_mdf_scenario.h5", settings_model=OptHistoryView_Settings( variable_names=["x_1", "x_2"], save=False, show=True, ), ) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.814 seconds) .. _sphx_glr_download_examples_post_process_algorithms_plot_opt_hist_view.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_opt_hist_view.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_opt_hist_view.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_opt_hist_view.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_