Parametric scalable MDO problem - MDF

We define a scalable problem based on two strongly coupled disciplines and a weakly one, with the following properties:

  • 3 shared design parameters,

  • 2 local design parameters for the first strongly coupled discipline,

  • 2 coupling variables for the first strongly coupled discipline,

  • 4 local design parameters for the second strongly coupled discipline,

  • 3 coupling variables for the second strongly coupled discipline.

We would like to solve this MDO problem by means of an MDF formulation.

from __future__ import annotations

from gemseo.api import configure_logger
from gemseo.api import create_scenario
from gemseo.api import generate_n2_plot
from gemseo.problems.scalable.parametric.problem import TMScalableProblem

configure_logger()
<RootLogger root (INFO)>

Instantiation of the scalable problem

n_shared = 3
n_local = [2, 4]
n_coupling = [2, 3]
problem = TMScalableProblem(n_shared, n_local, n_coupling)

Display the coupling structure

generate_n2_plot(problem.disciplines, save=False, show=True)
plot scalable param mdf

Solve the MDO using an MDF formulation

scenario = create_scenario(problem.disciplines, "MDF", "obj", problem.design_space)
scenario.add_constraint("cstr_0", "ineq")
scenario.add_constraint("cstr_1", "ineq")
scenario.execute({"algo": "NLOPT_SLSQP", "max_iter": 100})
    INFO - 16:56:33:
    INFO - 16:56:33: *** Start MDOScenario execution ***
    INFO - 16:56:33: MDOScenario
    INFO - 16:56:33:    Disciplines: MainModel SubModel_0 SubModel_1
    INFO - 16:56:33:    MDO formulation: MDF
    INFO - 16:56:33: Optimization problem:
    INFO - 16:56:33:    minimize obj(x_local_0, x_local_1, x_shared)
    INFO - 16:56:33:    with respect to x_local_0, x_local_1, x_shared
    INFO - 16:56:33:    subject to constraints:
    INFO - 16:56:33:       cstr_0(x_local_0, x_local_1, x_shared) <= 0.0
    INFO - 16:56:33:       cstr_1(x_local_0, x_local_1, x_shared) <= 0.0
    INFO - 16:56:33:    over the design space:
    INFO - 16:56:33:    |                               Parameter space                                |
    INFO - 16:56:33:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 16:56:33:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
    INFO - 16:56:33:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 16:56:33:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
    INFO - 16:56:33:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
    INFO - 16:56:33:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
    INFO - 16:56:33:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
    INFO - 16:56:33:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
    INFO - 16:56:33:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
    INFO - 16:56:33:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 16:56:33:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 16:56:33:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 16:56:33:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 16:56:33: Solving optimization problem with algorithm NLOPT_SLSQP:
    INFO - 16:56:33: ...   0%|          | 0/100 [00:00<?, ?it]
    INFO - 16:56:33: ...   1%|          | 1/100 [00:00<00:02, 36.71 it/sec, obj=0.5]
 WARNING - 16:56:34: MDAJacobi has reached its maximum number of iterations but the normed residual 628.5348041278223 is still above the tolerance 1e-06.
 WARNING - 16:56:34: MDAJacobi has reached its maximum number of iterations but the normed residual 855.939250180759 is still above the tolerance 1e-06.
    INFO - 16:56:34: ...   2%|▏         | 2/100 [00:00<00:10,  9.04 it/sec, obj=0.761]
 WARNING - 16:56:34: MDAJacobi has reached its maximum number of iterations but the normed residual 1222.112924405924 is still above the tolerance 1e-06.
    INFO - 16:56:34: ...   3%|▎         | 3/100 [00:00<00:09, 10.06 it/sec, obj=0.735]
 WARNING - 16:56:34: MDAJacobi has reached its maximum number of iterations but the normed residual 1385.5049620986567 is still above the tolerance 1e-06.
    INFO - 16:56:34: ...   4%|▍         | 4/100 [00:00<00:09, 10.66 it/sec, obj=0.691]
 WARNING - 16:56:34: MDAJacobi has reached its maximum number of iterations but the normed residual 1733.2178166635606 is still above the tolerance 1e-06.
    INFO - 16:56:34: ...   5%|▌         | 5/100 [00:00<00:08, 11.07 it/sec, obj=0.682]
 WARNING - 16:56:34: MDAJacobi has reached its maximum number of iterations but the normed residual 1809.1058564937541 is still above the tolerance 1e-06.
    INFO - 16:56:34: ...   6%|▌         | 6/100 [00:00<00:08, 11.35 it/sec, obj=0.672]
 WARNING - 16:56:34: MDAJacobi has reached its maximum number of iterations but the normed residual 1810.0817661089236 is still above the tolerance 1e-06.
    INFO - 16:56:34: ...   7%|▋         | 7/100 [00:00<00:08, 11.57 it/sec, obj=0.671]
 WARNING - 16:56:34: MDAJacobi has reached its maximum number of iterations but the normed residual 1804.117512802312 is still above the tolerance 1e-06.
    INFO - 16:56:34: ...   8%|▊         | 8/100 [00:00<00:07, 11.73 it/sec, obj=0.671]
 WARNING - 16:56:34: MDAJacobi has reached its maximum number of iterations but the normed residual 1781.4230266840048 is still above the tolerance 1e-06.
    INFO - 16:56:34: ...   9%|▉         | 9/100 [00:00<00:07, 11.86 it/sec, obj=0.671]
 WARNING - 16:56:34: MDAJacobi has reached its maximum number of iterations but the normed residual 1646.1968290578134 is still above the tolerance 1e-06.
    INFO - 16:56:34: ...  10%|█         | 10/100 [00:00<00:07, 11.97 it/sec, obj=0.671]
 WARNING - 16:56:34: MDAJacobi has reached its maximum number of iterations but the normed residual 909.2480409657202 is still above the tolerance 1e-06.
    INFO - 16:56:34: ...  11%|█         | 11/100 [00:00<00:07, 12.06 it/sec, obj=0.671]
 WARNING - 16:56:34: MDAJacobi has reached its maximum number of iterations but the normed residual 725.9807159973328 is still above the tolerance 1e-06.
    INFO - 16:56:34: ...  12%|█▏        | 12/100 [00:00<00:07, 12.14 it/sec, obj=0.67]
 WARNING - 16:56:34: MDAJacobi has reached its maximum number of iterations but the normed residual 724.9413769402323 is still above the tolerance 1e-06.
    INFO - 16:56:34: ...  13%|█▎        | 13/100 [00:01<00:07, 12.21 it/sec, obj=0.67]
 WARNING - 16:56:35: MDAJacobi has reached its maximum number of iterations but the normed residual 726.784699893992 is still above the tolerance 1e-06.
    INFO - 16:56:35: ...  14%|█▍        | 14/100 [00:01<00:07, 12.26 it/sec, obj=0.67]
    INFO - 16:56:35: ...  15%|█▌        | 15/100 [00:01<00:06, 13.13 it/sec, obj=Not evaluated]
    INFO - 16:56:35: Optimization result:
    INFO - 16:56:35:    Optimizer info:
    INFO - 16:56:35:       Status: None
    INFO - 16:56:35:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
    INFO - 16:56:35:       Number of calls to the objective function by the optimizer: 15
    INFO - 16:56:35:    Solution:
    INFO - 16:56:35:       The solution is feasible.
    INFO - 16:56:35:       Objective: 0.670463878639397
    INFO - 16:56:35:       Standardized constraints:
    INFO - 16:56:35:          cstr_0 = [-0.01693211 -5.62972098]
    INFO - 16:56:35:          cstr_1 = [-1.05472950e+00  2.22044605e-16 -1.81142650e+00]
    INFO - 16:56:35:       +----------------------------------------------------------------------------------------------+
    INFO - 16:56:35:       |                                       Parameter space                                        |
    INFO - 16:56:35:       +-----------+-------------+-----------------------+-------------+-------+----------------------+
    INFO - 16:56:35:       | name      | lower_bound |         value         | upper_bound | type  | Initial distribution |
    INFO - 16:56:35:       +-----------+-------------+-----------------------+-------------+-------+----------------------+
    INFO - 16:56:35:       | x_local_0 |      0      |   0.5931064439648591  |      1      | float |                      |
    INFO - 16:56:35:       | x_local_0 |      0      |           1           |      1      | float |                      |
    INFO - 16:56:35:       | x_local_1 |      0      |           0           |      1      | float |                      |
    INFO - 16:56:35:       | x_local_1 |      0      |   0.9546530639347032  |      1      | float |                      |
    INFO - 16:56:35:       | x_local_1 |      0      |           0           |      1      | float |                      |
    INFO - 16:56:35:       | x_local_1 |      0      | 4.985109760672119e-16 |      1      | float |                      |
    INFO - 16:56:35:       | x_shared  |      0      | 5.297941653541373e-17 |      1      | float |                      |
    INFO - 16:56:35:       | x_shared  |      0      |           0           |      1      | float |                      |
    INFO - 16:56:35:       | x_shared  |      0      | 2.001779104424825e-16 |      1      | float |                      |
    INFO - 16:56:35:       +-----------+-------------+-----------------------+-------------+-------+----------------------+
    INFO - 16:56:35: *** End MDOScenario execution (time: 0:00:01.159959) ***

{'max_iter': 100, 'algo': 'NLOPT_SLSQP'}

Post-process the results

scenario.post_process("OptHistoryView", save=False, show=True)
  • Evolution of the optimization variables
  • Evolution of the objective value
  • Distance to the optimum
  • Hessian diagonal approximation
  • Evolution of the inequality constraints
<gemseo.post.opt_history_view.OptHistoryView object at 0x7fbc555cc430>

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

Gallery generated by Sphinx-Gallery