Constraints history#

In this example, we illustrate the use of the ConstraintsHistory post-processing on the Sobieski's SSBJ problem.

The 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 OptHistoryView but scales less with the number of constraints.

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)
<gemseo.post.constraints_history.ConstraintsHistory object at 0x7a98684a2570>

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,
    ),
)

Total running time of the script: (0 minutes 1.252 seconds)

Gallery generated by Sphinx-Gallery