# 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 division, unicode_literals

from matplotlib import pyplot as plt

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

configure_logger()


Out:

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


## Solve the MDO using an MDF formulation¶

scenario = create_scenario(problem.disciplines, "MDF", "obj", problem.design_space)
scenario.execute({"algo": "NLOPT_SLSQP", "max_iter": 100})


Out:

    INFO - 14:42:49:
INFO - 14:42:49: *** Start MDO Scenario execution ***
INFO - 14:42:49: MDOScenario
INFO - 14:42:49:    Disciplines: MainModel SubModel_0 SubModel_1
INFO - 14:42:49:    MDOFormulation: MDF
INFO - 14:42:49:    Algorithm: NLOPT_SLSQP
INFO - 14:42:49: Optimization problem:
INFO - 14:42:49:    Minimize: obj(x_local_0, x_local_1, x_shared)
INFO - 14:42:49:    With respect to: x_local_0, x_local_1, x_shared
INFO - 14:42:49:    Subject to constraints:
INFO - 14:42:49:       cstr_0(x_local_0, x_local_1, x_shared) <= 0.0
INFO - 14:42:49:       cstr_1(x_local_0, x_local_1, x_shared) <= 0.0
INFO - 14:42:49: +------------------------------------------------------------------------------+
INFO - 14:42:49: |                               Parameter space                                |
INFO - 14:42:49: +-----------+-------------+-------+-------------+-------+----------------------+
INFO - 14:42:49: | name      | lower_bound | value | upper_bound | type  | Initial distribution |
INFO - 14:42:49: +-----------+-------------+-------+-------------+-------+----------------------+
INFO - 14:42:49: | x_local_0 |      0      |  0.5  |      1      | float |                      |
INFO - 14:42:49: | x_local_0 |      0      |  0.5  |      1      | float |                      |
INFO - 14:42:49: | x_local_1 |      0      |  0.5  |      1      | float |                      |
INFO - 14:42:49: | x_local_1 |      0      |  0.5  |      1      | float |                      |
INFO - 14:42:49: | x_local_1 |      0      |  0.5  |      1      | float |                      |
INFO - 14:42:49: | x_local_1 |      0      |  0.5  |      1      | float |                      |
INFO - 14:42:49: | x_shared  |      0      |  0.5  |      1      | float |                      |
INFO - 14:42:49: | x_shared  |      0      |  0.5  |      1      | float |                      |
INFO - 14:42:49: | x_shared  |      0      |  0.5  |      1      | float |                      |
INFO - 14:42:49: +-----------+-------------+-------+-------------+-------+----------------------+
INFO - 14:42:49: Optimization:   0%|          | 0/100 [00:00<?, ?it]
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Lower bounds violated: [-0.06535831 -0.1012953  -0.15365405 -0.04796975 -0.03817772 -0.09325931].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Lower bounds violated: [-0.06535831 -0.1012953  -0.15365405 -0.04796975 -0.03817772 -0.09325931].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: MDAJacobi has reached its maximum number of iterations but the normed residual 624.0608944646348 is still above the tolerance 1e-06.
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Lower bounds violated: [-0.11021098 -0.17164181 -0.27147077 -0.0834051  -0.06725633 -0.16440469
WARNING - 14:42:49:  -0.2374275  -0.41605455 -0.19216792].
INFO - 14:42:49: Optimization:   2%|▏         | 2/100 [00:00<00:00, 981.52 it/sec]
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: MDAJacobi has reached its maximum number of iterations but the normed residual 857.0227534902443 is still above the tolerance 1e-06.
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Lower bounds violated: [-0.10676616 -0.16636559 -0.26721994 -0.08208378 -0.06636862 -0.16217295
WARNING - 14:42:49:  -0.18820449 -0.38824109 -0.1892308 ].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: MDAJacobi has reached its maximum number of iterations but the normed residual 1222.5268913197779 is still above the tolerance 1e-06.
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Lower bounds violated: [-0.09997637 -0.1561866  -0.25926184 -0.07957677 -0.06476275 -0.1581117
WARNING - 14:42:49:  -0.12069412 -0.38099617 -0.18369013].
INFO - 14:42:49: Optimization:   4%|▍         | 4/100 [00:00<00:00, 468.61 it/sec]
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: MDAJacobi has reached its maximum number of iterations but the normed residual 1384.6328033092384 is still above the tolerance 1e-06.
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Lower bounds violated: [-0.09887809 -0.15463781 -0.2588136  -0.07924044 -0.06457881 -0.15769541
WARNING - 14:42:49:  -0.14366232 -0.39044485 -0.18296192].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: MDAJacobi has reached its maximum number of iterations but the normed residual 1732.8716051687154 is still above the tolerance 1e-06.
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Lower bounds violated: [-0.09765871 -0.15296585 -0.25910732 -0.07894811 -0.06443323 -0.15743311
WARNING - 14:42:49:  -0.22542896 -0.38987695 -0.18230891].
INFO - 14:42:49: Optimization:   6%|▌         | 6/100 [00:00<00:00, 306.00 it/sec]
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: MDAJacobi has reached its maximum number of iterations but the normed residual 1806.9144971470012 is still above the tolerance 1e-06.
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Lower bounds violated: [-0.09736863 -0.15256742 -0.25917601 -0.07887843 -0.06439823 -0.15736984
WARNING - 14:42:49:  -0.24490951 -0.38973614 -0.18215301].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: MDAJacobi has reached its maximum number of iterations but the normed residual 1808.313025999647 is still above the tolerance 1e-06.
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Lower bounds violated: [-0.09736908 -0.15256735 -0.25917469 -0.07887842 -0.06439792 -0.15736906
WARNING - 14:42:49:  -0.24490739 -0.38973054 -0.18215271].
INFO - 14:42:49: Optimization:   8%|▊         | 8/100 [00:00<00:00, 226.91 it/sec]
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: MDAJacobi has reached its maximum number of iterations but the normed residual 1803.8470001638166 is still above the tolerance 1e-06.
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Lower bounds violated: [-0.09737789 -0.15258012 -0.25917314 -0.07887164 -0.06439523 -0.15736355
WARNING - 14:42:49:  -0.2449149  -0.38973511 -0.18214681].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: MDAJacobi has reached its maximum number of iterations but the normed residual 1780.6369646842672 is still above the tolerance 1e-06.
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Lower bounds violated: [-0.09742174 -0.15264383 -0.25916558 -0.07883787 -0.0643819  -0.1573362
WARNING - 14:42:49:  -0.24495263 -0.38975866 -0.18211746].
INFO - 14:42:49: Optimization:  10%|█         | 10/100 [00:00<00:00, 181.41 it/sec]
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: MDAJacobi has reached its maximum number of iterations but the normed residual 1646.953551257594 is still above the tolerance 1e-06.
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Lower bounds violated: [-0.09763371 -0.15295179 -0.25912905 -0.07867458 -0.06431742 -0.15720398
WARNING - 14:42:49:  -0.24513503 -0.3898725  -0.18197561].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: MDAJacobi has reached its maximum number of iterations but the normed residual 910.1384510062192 is still above the tolerance 1e-06.
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Lower bounds violated: [-0.09851788 -0.15423633 -0.25897667 -0.07799349 -0.06404848 -0.15665247
WARNING - 14:42:49:  -0.24589585 -0.39034734 -0.1813839 ].
INFO - 14:42:49: Optimization:  12%|█▏        | 12/100 [00:00<00:00, 150.69 it/sec]
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:49: MDAJacobi has reached its maximum number of iterations but the normed residual 726.622322806009 is still above the tolerance 1e-06.
WARNING - 14:42:50: All components of the normalized vector should be between 0 and 1. Lower bounds violated: [-0.0987004  -0.1545015  -0.25894521 -0.07785289 -0.06399296 -0.15653862
WARNING - 14:42:50:  -0.24605291 -0.39044536 -0.18126175].
WARNING - 14:42:50: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:50: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:50: MDAJacobi has reached its maximum number of iterations but the normed residual 725.8264255316143 is still above the tolerance 1e-06.
WARNING - 14:42:50: All components of the normalized vector should be between 0 and 1. Lower bounds violated: [-0.0987004  -0.1545015  -0.25894521 -0.07785289 -0.06399296 -0.15653862
WARNING - 14:42:50:  -0.24605291 -0.39044536 -0.18126175].
INFO - 14:42:50: Optimization:  14%|█▍        | 14/100 [00:00<00:00, 128.70 it/sec]
WARNING - 14:42:50: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:50: All components of the normalized vector should be between 0 and 1. Upper bounds violated: [1.35778211 1.8801818  1.13744624 1.68888531 1.6401472 ].
WARNING - 14:42:50: MDAJacobi has reached its maximum number of iterations but the normed residual 726.0716218115125 is still above the tolerance 1e-06.
WARNING - 14:42:50: All components of the normalized vector should be between 0 and 1. Lower bounds violated: [-0.0987004  -0.1545015  -0.25894521 -0.07785289 -0.06399296 -0.15653862
WARNING - 14:42:50:  -0.24605291 -0.39044536 -0.18126175].
INFO - 14:42:50: Optimization:  15%|█▌        | 15/100 [00:00<00:00, 119.86 it/sec]
INFO - 14:42:50: Optimization result:
INFO - 14:42:50: Objective value = 0.6704638786393982
INFO - 14:42:50: The result is feasible.
INFO - 14:42:50: Status: None
INFO - 14:42:50: Optimizer message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
INFO - 14:42:50: Number of calls to the objective function by the optimizer: 15
INFO - 14:42:50: Constraints values:
INFO - 14:42:50:    cstr_0 = [-0.01693211 -5.62972098]
INFO - 14:42:50:    cstr_1 = [-1.05472950e+00 -2.22044605e-16 -1.81142650e+00]
INFO - 14:42:50: +----------------------------------------------------------------------------------------------+
INFO - 14:42:50: |                                       Parameter space                                        |
INFO - 14:42:50: +-----------+-------------+-----------------------+-------------+-------+----------------------+
INFO - 14:42:50: | name      | lower_bound |         value         | upper_bound | type  | Initial distribution |
INFO - 14:42:50: +-----------+-------------+-----------------------+-------------+-------+----------------------+
INFO - 14:42:50: | x_local_0 |      0      |   0.5931064439648573  |      1      | float |                      |
INFO - 14:42:50: | x_local_0 |      0      |   0.9999999999999986  |      1      | float |                      |
INFO - 14:42:50: | x_local_1 |      0      |           0           |      1      | float |                      |
INFO - 14:42:50: | x_local_1 |      0      |   0.9546530639346952  |      1      | float |                      |
INFO - 14:42:50: | x_local_1 |      0      | 2.595010559315549e-16 |      1      | float |                      |
INFO - 14:42:50: | x_local_1 |      0      |           0           |      1      | float |                      |
INFO - 14:42:50: | x_shared  |      0      | 1.867903458855938e-16 |      1      | float |                      |
INFO - 14:42:50: | x_shared  |      0      |           0           |      1      | float |                      |
INFO - 14:42:50: | x_shared  |      0      |           0           |      1      | float |                      |
INFO - 14:42:50: +-----------+-------------+-----------------------+-------------+-------+----------------------+
INFO - 14:42:50: *** MDO Scenario run terminated in 0:00:00.845251 ***

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


## Post-process the results¶

scenario.post_process("OptHistoryView", save=False, show=False)
# Workaround for HTML rendering, instead of show=True
plt.show()


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

Gallery generated by Sphinx-Gallery