.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/post_process/algorithms/plot_constraints_history.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_constraints_history.py: Constraints history =================== In this example, we illustrate the use of the :class:`.ConstraintsHistory` post-processing on the Sobieski's SSBJ problem. The :class:`.ConstraintsHistory` post-processing plots the history of the constraints functions specified by the user with respect to the iteration. Each constraint history is represented in a subplot where the background color gives qualitative indications on the constraint violation: areas where the constraint is active are white, the ones where it is violated ones are red and the ones where it is satisfied are green. This post-processing provides more precise information on the constraints than :class:`.OptHistoryView` but scales less with the number of constraints. .. GENERATED FROM PYTHON SOURCE LINES 37-51 .. image-sg:: /examples/post_process/algorithms/images/sphx_glr_plot_constraints_history_001.png :alt: Evolution of the constraints w.r.t. iterations, g_1[0] (inequality), g_1[1] (inequality), g_1[2] (inequality), g_1[3] (inequality), g_1[4] (inequality), g_1[5] (inequality), g_1[6] (inequality), g_2 (inequality), g_3[0] (inequality), g_3[1] (inequality), g_3[2] (inequality), g_3[3] (inequality) :srcset: /examples/post_process/algorithms/images/sphx_glr_plot_constraints_history_001.png :class: sphx-glr-single-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 ConstraintsHistory_Settings execute_post( "sobieski_mdf_scenario.h5", settings_model=ConstraintsHistory_Settings( constraint_names=["g_1", "g_2", "g_3"], save=False, show=True, ), ) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.898 seconds) .. _sphx_glr_download_examples_post_process_algorithms_plot_constraints_history.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_constraints_history.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_constraints_history.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_constraints_history.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_