.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/multi_objective/plot_pareto_front_binhkorn_bilevel.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_multi_objective_plot_pareto_front_binhkorn_bilevel.py: Pareto front on the Binh and Korn problem using a BiLevel formulation ===================================================================== In this example, we illustrate the computation of a Pareto front plot for the Binh and Korn problem. We use a BiLevel formulation in order to only compute the Pareto-optimal points. .. GENERATED FROM PYTHON SOURCE LINES 31-35 Import ------ The first step is to import some high-level functions and to configure the logger. .. GENERATED FROM PYTHON SOURCE LINES 35-47 .. code-block:: Python from __future__ import annotations from copy import deepcopy from logging import WARNING from numpy import array from gemseo import create_design_space from gemseo import create_discipline from gemseo import create_scenario from gemseo import execute_post .. GENERATED FROM PYTHON SOURCE LINES 48-54 Definition of the disciplines ----------------------------- In this example, we create the Binh and Korn disciplines from scratch by declaring their expressions and using the :class:`.AnalyticDiscipline`. .. GENERATED FROM PYTHON SOURCE LINES 54-62 .. code-block:: Python expr_binh_korn = { "obj1": "4*x1**2 + 4*x2**2", "obj2": "(x1-5.)**2 + (x2-5.)**2", "cstr1": "(x1-5.)**2 + x2**2 - 25.", "cstr2": "-(x1-8.)**2 - (x2+3)**2 + 7.7", } .. GENERATED FROM PYTHON SOURCE LINES 63-65 This constraint will be used to set `obj1` to a target value for the lower-level scenario. .. GENERATED FROM PYTHON SOURCE LINES 65-68 .. code-block:: Python expr_cstr_obj1_target = {"cstr3": "obj1 - obj1_target"} .. GENERATED FROM PYTHON SOURCE LINES 69-73 Instantiation of the disciplines -------------------------------- Here, we create the disciplines from their expressions. .. GENERATED FROM PYTHON SOURCE LINES 73-81 .. code-block:: Python discipline_binh_korn = create_discipline( "AnalyticDiscipline", expressions=expr_binh_korn ) discipline_cstr_obj1 = create_discipline( "AnalyticDiscipline", expressions=expr_cstr_obj1_target ) .. GENERATED FROM PYTHON SOURCE LINES 82-84 Definition of the lower-level design space ------------------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 84-98 .. code-block:: Python design_space = create_design_space() design_space.add_variable( "x1", lower_bound=array([0.0]), upper_bound=array([5.0]), value=array([2.0]) ) design_space.add_variable( "x2", lower_bound=array([-5.0]), upper_bound=array([3.0]), value=array([2.0]) ) disciplines = [ discipline_binh_korn, discipline_cstr_obj1, ] .. GENERATED FROM PYTHON SOURCE LINES 99-102 Creation of the lower-level scenario ------------------------------------ This scenario aims at finding the `obj2` optimal value for a specific value of `obj1`. .. GENERATED FROM PYTHON SOURCE LINES 102-112 .. code-block:: Python sub_scenario = create_scenario( disciplines, "obj2", design_space, formulation_name="DisciplinaryOpt", ) sub_scenario.set_algorithm(algo_name="NLOPT_SLSQP", max_iter=100) .. GENERATED FROM PYTHON SOURCE LINES 113-114 We add the Binh and Korn problem constraints. .. GENERATED FROM PYTHON SOURCE LINES 114-117 .. code-block:: Python sub_scenario.add_constraint("cstr1", constraint_type="ineq") sub_scenario.add_constraint("cstr2", constraint_type="ineq") .. GENERATED FROM PYTHON SOURCE LINES 118-122 Creation of the design space for the system-level scenario ---------------------------------------------------------- At the system level, we will fix a target for the `obj1` value of the lower-level scenario. .. GENERATED FROM PYTHON SOURCE LINES 122-130 .. code-block:: Python system_design_space = create_design_space() system_design_space.add_variable( "obj1_target", lower_bound=array([0.1]), upper_bound=array([100.0]), value=array([1.0]), ) .. GENERATED FROM PYTHON SOURCE LINES 131-138 Creation of the system-level DOE Scenario ----------------------------------------- The system-level scenario will perform a DOE over the `obj1_target` variable. We will use the `BiLevel` formulation to nest the lower-level scenario into the DOE. The log level for the sub scenarios is set to `WARNING` to avoid getting the complete log of each sub scenario, which would be too verbose. Set it to `INFO` if you wish to keep the logs of each sub scenario as well. .. GENERATED FROM PYTHON SOURCE LINES 138-148 .. code-block:: Python system_scenario = create_scenario( sub_scenario, "obj1", system_design_space, scenario_type="DOE", formulation_name="BiLevel", sub_scenarios_log_level=WARNING, ) .. rst-class:: sphx-glr-script-out .. code-block:: none WARNING - 16:21:44: No strongly coupled disciplines detected, MDA1 is disabled in the BiLevel formulation .. GENERATED FROM PYTHON SOURCE LINES 149-164 .. tip:: When running BiLevel scenarios, it is interesting to access the optimization history of the sub-scenarios for each system iteration. By default, the setting ``keep_opt_history`` is set to ``True``. This allows you to store in memory the databases of the sub-scenarios (see the last section of this example for more details). In some cases, storing the databases in memory can take up too much space and cause performance issues. In these cases, set ``keep_opt_history=False`` and save the databases to the disk using ``save_opt_history=True``. If your sub-scenarios are running in parallel, and you are saving the optimization histories to the disk, set the ``naming`` setting to ``"UUID"``, which is multiprocessing-safe. The setting ``keep_opt_history`` will not work if the sub-scenarios are running in parallel because the databases are not copied from the sub-processes to the main process. In this case you shall always save the optimization history to the disk. .. GENERATED FROM PYTHON SOURCE LINES 166-175 Add the system-level constraint and observables ----------------------------------------------- Here, we add the constraint on the `obj1_target`, this way we make sure that the lower-level scenario will respect the target imposed by the system. The BiLevel formulation will automatically add the constraints from the system-level to the lower-level, if you wish to handle the constraints manually, pass `apply_cstr_tosub_scenarios=False` as an argument to `create_scenario`. Note that `obj2` shall be added as an observable of `scenario_doe`, otherwise it cannot be used by the ParetoFront post-processing. .. GENERATED FROM PYTHON SOURCE LINES 175-178 .. code-block:: Python system_scenario.add_constraint("cstr3") system_scenario.add_observable("obj2") system_scenario.xdsmize(save_html=False) .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 179-182 Run the scenario ---------------- Finally, we run a full-factorial DOE using 100 samples and run the post-processing. .. GENERATED FROM PYTHON SOURCE LINES 182-187 .. code-block:: Python system_scenario.execute(algo_name="PYDOE_FULLFACT", n_samples=50) system_scenario.post_process( post_name="ParetoFront", objectives=["obj1", "obj2"], save=False, show=True ) .. image-sg:: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_001.png :alt: Pareto front :srcset: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none INFO - 16:21:44: *** Start DOEScenario execution *** INFO - 16:21:44: DOEScenario INFO - 16:21:44: Disciplines: MDOScenario INFO - 16:21:44: MDO formulation: BiLevel INFO - 16:21:44: Optimization problem: INFO - 16:21:44: minimize obj1(obj1_target) INFO - 16:21:44: with respect to obj1_target INFO - 16:21:44: under the equality constraints INFO - 16:21:44: cstr3(obj1_target) = 0 INFO - 16:21:44: over the design space: INFO - 16:21:44: +-------------+-------------+-------+-------------+-------+ INFO - 16:21:44: | Name | Lower bound | Value | Upper bound | Type | INFO - 16:21:44: +-------------+-------------+-------+-------------+-------+ INFO - 16:21:44: | obj1_target | 0.1 | 1 | 100 | float | INFO - 16:21:44: +-------------+-------------+-------+-------------+-------+ INFO - 16:21:44: Solving optimization problem with algorithm PYDOE_FULLFACT: INFO - 16:21:44: 2%|▏ | 1/50 [00:00<00:01, 26.42 it/sec, feas=True, obj=0.108] INFO - 16:21:44: 4%|▍ | 2/50 [00:00<00:01, 34.21 it/sec, feas=True, obj=2.14] INFO - 16:21:44: 6%|▌ | 3/50 [00:00<00:01, 40.71 it/sec, feas=True, obj=4.18] INFO - 16:21:44: 8%|▊ | 4/50 [00:00<00:01, 44.32 it/sec, feas=True, obj=6.22] INFO - 16:21:44: 10%|█ | 5/50 [00:00<00:00, 47.85 it/sec, feas=True, obj=8.26] INFO - 16:21:44: 12%|█▏ | 6/50 [00:00<00:00, 48.23 it/sec, feas=True, obj=10.3] ERROR - 16:21:44: NLopt run failed: NLopt roundoff-limited, RoundoffLimited Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/gemseo/algos/opt/nlopt/nlopt.py", line 399, in _run nlopt_problem.optimize(x_0.real) File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/nlopt/nlopt.py", line 454, in optimize return _nlopt.opt_optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nlopt.RoundoffLimited: NLopt roundoff-limited INFO - 16:21:44: 14%|█▍ | 7/50 [00:00<00:00, 49.05 it/sec, feas=True, obj=12.3] INFO - 16:21:44: 16%|█▌ | 8/50 [00:00<00:00, 50.17 it/sec, feas=True, obj=14.4] INFO - 16:21:44: 18%|█▊ | 9/50 [00:00<00:00, 50.88 it/sec, feas=True, obj=16.4] INFO - 16:21:44: 20%|██ | 10/50 [00:00<00:00, 51.44 it/sec, feas=True, obj=18.5] INFO - 16:21:44: 22%|██▏ | 11/50 [00:00<00:00, 52.66 it/sec, feas=True, obj=20.5] INFO - 16:21:44: 24%|██▍ | 12/50 [00:00<00:00, 53.70 it/sec, feas=True, obj=22.5] INFO - 16:21:44: 26%|██▌ | 13/50 [00:00<00:00, 54.92 it/sec, feas=True, obj=24.6] INFO - 16:21:44: 28%|██▊ | 14/50 [00:00<00:00, 55.97 it/sec, feas=True, obj=26.6] INFO - 16:21:44: 30%|███ | 15/50 [00:00<00:00, 56.89 it/sec, feas=True, obj=28.6] INFO - 16:21:44: 32%|███▏ | 16/50 [00:00<00:00, 57.72 it/sec, feas=True, obj=30.7] INFO - 16:21:44: 34%|███▍ | 17/50 [00:00<00:00, 58.22 it/sec, feas=True, obj=32.7] INFO - 16:21:44: 36%|███▌ | 18/50 [00:00<00:00, 58.80 it/sec, feas=True, obj=34.8] INFO - 16:21:44: 38%|███▊ | 19/50 [00:00<00:00, 58.74 it/sec, feas=True, obj=36.8] ERROR - 16:21:45: NLopt run failed: NLopt roundoff-limited, RoundoffLimited Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/gemseo/algos/opt/nlopt/nlopt.py", line 399, in _run nlopt_problem.optimize(x_0.real) File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/nlopt/nlopt.py", line 454, in optimize return _nlopt.opt_optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nlopt.RoundoffLimited: NLopt roundoff-limited INFO - 16:21:45: 40%|████ | 20/50 [00:00<00:00, 59.20 it/sec, feas=True, obj=38.8] ERROR - 16:21:45: NLopt run failed: NLopt roundoff-limited, RoundoffLimited Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/gemseo/algos/opt/nlopt/nlopt.py", line 399, in _run nlopt_problem.optimize(x_0.real) File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/nlopt/nlopt.py", line 454, in optimize return _nlopt.opt_optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nlopt.RoundoffLimited: NLopt roundoff-limited INFO - 16:21:45: 42%|████▏ | 21/50 [00:00<00:00, 59.61 it/sec, feas=True, obj=40.9] INFO - 16:21:45: 44%|████▍ | 22/50 [00:00<00:00, 60.03 it/sec, feas=True, obj=42.9] INFO - 16:21:45: 46%|████▌ | 23/50 [00:00<00:00, 60.45 it/sec, feas=True, obj=45] INFO - 16:21:45: 48%|████▊ | 24/50 [00:00<00:00, 60.68 it/sec, feas=True, obj=47] INFO - 16:21:45: 50%|█████ | 25/50 [00:00<00:00, 61.05 it/sec, feas=True, obj=49] INFO - 16:21:45: 52%|█████▏ | 26/50 [00:00<00:00, 61.23 it/sec, feas=True, obj=51.1] INFO - 16:21:45: 54%|█████▍ | 27/50 [00:00<00:00, 61.23 it/sec, feas=True, obj=53.1] INFO - 16:21:45: 56%|█████▌ | 28/50 [00:00<00:00, 61.53 it/sec, feas=True, obj=55.1] INFO - 16:21:45: 58%|█████▊ | 29/50 [00:00<00:00, 61.67 it/sec, feas=True, obj=57.2] INFO - 16:21:45: 60%|██████ | 30/50 [00:00<00:00, 61.93 it/sec, feas=True, obj=59.2] INFO - 16:21:45: 62%|██████▏ | 31/50 [00:00<00:00, 60.80 it/sec, feas=True, obj=61.3] INFO - 16:21:45: 64%|██████▍ | 32/50 [00:00<00:00, 61.02 it/sec, feas=True, obj=63.3] INFO - 16:21:45: 66%|██████▌ | 33/50 [00:00<00:00, 61.26 it/sec, feas=True, obj=65.3] INFO - 16:21:45: 68%|██████▊ | 34/50 [00:00<00:00, 61.35 it/sec, feas=True, obj=67.4] INFO - 16:21:45: 70%|███████ | 35/50 [00:00<00:00, 61.56 it/sec, feas=True, obj=69.4] INFO - 16:21:45: 72%|███████▏ | 36/50 [00:00<00:00, 61.75 it/sec, feas=True, obj=71.5] ERROR - 16:21:45: NLopt run failed: NLopt roundoff-limited, RoundoffLimited Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/gemseo/algos/opt/nlopt/nlopt.py", line 399, in _run nlopt_problem.optimize(x_0.real) File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/nlopt/nlopt.py", line 454, in optimize return _nlopt.opt_optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nlopt.RoundoffLimited: NLopt roundoff-limited INFO - 16:21:45: 74%|███████▍ | 37/50 [00:00<00:00, 62.14 it/sec, feas=True, obj=73.5] ERROR - 16:21:45: NLopt run failed: NLopt roundoff-limited, RoundoffLimited Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/gemseo/algos/opt/nlopt/nlopt.py", line 399, in _run nlopt_problem.optimize(x_0.real) File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/nlopt/nlopt.py", line 454, in optimize return _nlopt.opt_optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nlopt.RoundoffLimited: NLopt roundoff-limited INFO - 16:21:45: 76%|███████▌ | 38/50 [00:00<00:00, 62.53 it/sec, feas=True, obj=75.5] ERROR - 16:21:45: NLopt run failed: NLopt roundoff-limited, RoundoffLimited Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/gemseo/algos/opt/nlopt/nlopt.py", line 399, in _run nlopt_problem.optimize(x_0.real) File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/nlopt/nlopt.py", line 454, in optimize return _nlopt.opt_optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nlopt.RoundoffLimited: NLopt roundoff-limited INFO - 16:21:45: 78%|███████▊ | 39/50 [00:00<00:00, 62.89 it/sec, feas=True, obj=77.6] ERROR - 16:21:45: NLopt run failed: NLopt roundoff-limited, RoundoffLimited Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/gemseo/algos/opt/nlopt/nlopt.py", line 399, in _run nlopt_problem.optimize(x_0.real) File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/nlopt/nlopt.py", line 454, in optimize return _nlopt.opt_optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nlopt.RoundoffLimited: NLopt roundoff-limited INFO - 16:21:45: 80%|████████ | 40/50 [00:00<00:00, 63.53 it/sec, feas=True, obj=79.6] ERROR - 16:21:45: NLopt run failed: NLopt roundoff-limited, RoundoffLimited Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/gemseo/algos/opt/nlopt/nlopt.py", line 399, in _run nlopt_problem.optimize(x_0.real) File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/nlopt/nlopt.py", line 454, in optimize return _nlopt.opt_optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nlopt.RoundoffLimited: NLopt roundoff-limited INFO - 16:21:45: 82%|████████▏ | 41/50 [00:00<00:00, 64.16 it/sec, feas=True, obj=81.7] ERROR - 16:21:45: NLopt run failed: NLopt roundoff-limited, RoundoffLimited Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/gemseo/algos/opt/nlopt/nlopt.py", line 399, in _run nlopt_problem.optimize(x_0.real) File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/nlopt/nlopt.py", line 454, in optimize return _nlopt.opt_optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nlopt.RoundoffLimited: NLopt roundoff-limited INFO - 16:21:45: 84%|████████▍ | 42/50 [00:00<00:00, 64.77 it/sec, feas=True, obj=83.7] ERROR - 16:21:45: NLopt run failed: NLopt roundoff-limited, RoundoffLimited Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/gemseo/algos/opt/nlopt/nlopt.py", line 399, in _run nlopt_problem.optimize(x_0.real) File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/nlopt/nlopt.py", line 454, in optimize return _nlopt.opt_optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nlopt.RoundoffLimited: NLopt roundoff-limited INFO - 16:21:45: 86%|████████▌ | 43/50 [00:00<00:00, 65.00 it/sec, feas=True, obj=85.7] ERROR - 16:21:45: NLopt run failed: NLopt roundoff-limited, RoundoffLimited Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/gemseo/algos/opt/nlopt/nlopt.py", line 399, in _run nlopt_problem.optimize(x_0.real) File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/nlopt/nlopt.py", line 454, in optimize return _nlopt.opt_optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nlopt.RoundoffLimited: NLopt roundoff-limited INFO - 16:21:45: 88%|████████▊ | 44/50 [00:00<00:00, 65.54 it/sec, feas=True, obj=87.8] ERROR - 16:21:45: NLopt run failed: NLopt roundoff-limited, RoundoffLimited Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/gemseo/algos/opt/nlopt/nlopt.py", line 399, in _run nlopt_problem.optimize(x_0.real) File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/nlopt/nlopt.py", line 454, in optimize return _nlopt.opt_optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nlopt.RoundoffLimited: NLopt roundoff-limited INFO - 16:21:45: 90%|█████████ | 45/50 [00:00<00:00, 66.06 it/sec, feas=True, obj=89.8] ERROR - 16:21:45: NLopt run failed: NLopt roundoff-limited, RoundoffLimited Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/gemseo/algos/opt/nlopt/nlopt.py", line 399, in _run nlopt_problem.optimize(x_0.real) File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/nlopt/nlopt.py", line 454, in optimize return _nlopt.opt_optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nlopt.RoundoffLimited: NLopt roundoff-limited INFO - 16:21:45: 92%|█████████▏| 46/50 [00:00<00:00, 66.58 it/sec, feas=True, obj=91.8] INFO - 16:21:45: 94%|█████████▍| 47/50 [00:00<00:00, 66.96 it/sec, feas=True, obj=93.9] ERROR - 16:21:45: NLopt run failed: NLopt roundoff-limited, RoundoffLimited Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/gemseo/algos/opt/nlopt/nlopt.py", line 399, in _run nlopt_problem.optimize(x_0.real) File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/nlopt/nlopt.py", line 454, in optimize return _nlopt.opt_optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nlopt.RoundoffLimited: NLopt roundoff-limited INFO - 16:21:45: 96%|█████████▌| 48/50 [00:00<00:00, 67.46 it/sec, feas=True, obj=95.9] ERROR - 16:21:45: NLopt run failed: NLopt roundoff-limited, RoundoffLimited Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/gemseo/algos/opt/nlopt/nlopt.py", line 399, in _run nlopt_problem.optimize(x_0.real) File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/nlopt/nlopt.py", line 454, in optimize return _nlopt.opt_optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nlopt.RoundoffLimited: NLopt roundoff-limited INFO - 16:21:45: 98%|█████████▊| 49/50 [00:00<00:00, 67.96 it/sec, feas=True, obj=98] ERROR - 16:21:45: NLopt run failed: NLopt roundoff-limited, RoundoffLimited Traceback (most recent call last): File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/gemseo/algos/opt/nlopt/nlopt.py", line 399, in _run nlopt_problem.optimize(x_0.real) File "/home/docs/checkouts/readthedocs.org/user_builds/gemseo/envs/6.3.0/lib/python3.12/site-packages/nlopt/nlopt.py", line 454, in optimize return _nlopt.opt_optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ nlopt.RoundoffLimited: NLopt roundoff-limited INFO - 16:21:45: 100%|██████████| 50/50 [00:00<00:00, 68.40 it/sec, feas=True, obj=100] INFO - 16:21:45: Optimization result: INFO - 16:21:45: Optimizer info: INFO - 16:21:45: Status: None INFO - 16:21:45: Message: None INFO - 16:21:45: Solution: INFO - 16:21:45: The solution is feasible. INFO - 16:21:45: Objective: 0.1083277770644081 INFO - 16:21:45: Standardized constraints: INFO - 16:21:45: cstr3 = 0.008327777064408098 INFO - 16:21:45: Design space: INFO - 16:21:45: +-------------+-------------+-------+-------------+-------+ INFO - 16:21:45: | Name | Lower bound | Value | Upper bound | Type | INFO - 16:21:45: +-------------+-------------+-------+-------------+-------+ INFO - 16:21:45: | obj1_target | 0.1 | 0.1 | 100 | float | INFO - 16:21:45: +-------------+-------------+-------+-------------+-------+ INFO - 16:21:45: *** End DOEScenario execution *** .. GENERATED FROM PYTHON SOURCE LINES 188-196 Plot the sub-scenario histories of the 2 first system iterations ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The code below will not work if you ran the system scenario with ``n_processes`` > 1. Indeed, parallel execution of sub-scenarios prevents us to save the databases from each sub-process to the main process. If you ran the system scenario with many processes, you can still save the databases to the disk with ``save_opt_history=True`` and ``naming="UUID"``. Refer to the formulation settings for more information. .. GENERATED FROM PYTHON SOURCE LINES 196-201 .. code-block:: Python sub_scenario_databases = system_scenario.formulation.scenario_adapters[0].databases for database in sub_scenario_databases[:2]: opt_problem = deepcopy(sub_scenario.formulation.optimization_problem) opt_problem.database = database execute_post(opt_problem, post_name="OptHistoryView", save=False, show=True) .. rst-class:: sphx-glr-horizontal * .. image-sg:: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_002.png :alt: Evolution of the optimization variables :srcset: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_002.png :class: sphx-glr-multi-img * .. image-sg:: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_003.png :alt: Evolution of the objective value :srcset: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_003.png :class: sphx-glr-multi-img * .. image-sg:: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_004.png :alt: Evolution of the distance to the optimum :srcset: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_004.png :class: sphx-glr-multi-img * .. image-sg:: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_005.png :alt: Evolution of the inequality constraints :srcset: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_005.png :class: sphx-glr-multi-img * .. image-sg:: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_006.png :alt: Evolution of the equality constraints :srcset: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_006.png :class: sphx-glr-multi-img * .. image-sg:: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_007.png :alt: Evolution of the optimization variables :srcset: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_007.png :class: sphx-glr-multi-img * .. image-sg:: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_008.png :alt: Evolution of the objective value :srcset: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_008.png :class: sphx-glr-multi-img * .. image-sg:: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_009.png :alt: Evolution of the distance to the optimum :srcset: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_009.png :class: sphx-glr-multi-img * .. image-sg:: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_010.png :alt: Evolution of the inequality constraints :srcset: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_010.png :class: sphx-glr-multi-img * .. image-sg:: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_011.png :alt: Evolution of the equality constraints :srcset: /examples/multi_objective/images/sphx_glr_plot_pareto_front_binhkorn_bilevel_011.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.912 seconds) .. _sphx_glr_download_examples_multi_objective_plot_pareto_front_binhkorn_bilevel.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_pareto_front_binhkorn_bilevel.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_pareto_front_binhkorn_bilevel.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_pareto_front_binhkorn_bilevel.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_