Scalable problem of Tedford and Martins, 2010

from __future__ import annotations

from gemseo.api import configure_logger
from gemseo.api import generate_n2_plot
from gemseo.problems.scalable.parametric.core.design_space import TMDesignSpace
from gemseo.problems.scalable.parametric.disciplines import TMMainDiscipline
from gemseo.problems.scalable.parametric.disciplines import TMSubDiscipline
from gemseo.problems.scalable.parametric.problem import TMScalableProblem
from gemseo.problems.scalable.parametric.study import TMParamSS
from gemseo.problems.scalable.parametric.study import TMParamSSPost
from gemseo.problems.scalable.parametric.study import TMScalableStudy
from numpy import array
from numpy.random import rand

configure_logger()
<RootLogger root (INFO)>

Disciplines

We define two strongly coupled disciplines and a weakly coupled discipline, with:

  • 2 shared design parameters,

  • 2 local design parameters for the first discipline,

  • 3 local design parameters for the second discipline,

  • 3 coupling variables for the first discipline,

  • 2 coupling variables for the second discipline.

sizes = {"x_shared": 2, "x_local_0": 2, "x_local_1": 3, "y_0": 3, "y_1": 2}

We use any values for the coefficients and the default values of the design parameters and coupling variables.

Strongly coupled disciplines

Here is the first strongly coupled discipline.

default_inputs = {
    "x_shared": rand(sizes["x_shared"]),
    "x_local_0": rand(sizes["x_local_0"]),
    "y_1": rand(sizes["y_1"]),
}
index = 0
c_shared = rand(sizes["y_0"], sizes["x_shared"])
c_local = rand(sizes["y_0"], sizes["x_local_0"])
c_coupling = {"y_1": rand(sizes["y_0"], sizes["y_1"])}
disc0 = TMSubDiscipline(index, c_shared, c_local, c_coupling, default_inputs)

print(disc0.name)
print(disc0.get_input_data_names())
print(disc0.get_output_data_names())
SubModel_0
['x_local_0', 'x_shared', 'y_1']
['y_0']
TM_Discipline_0
dict_keys(['x_shared', 'x_local_0', 'y_1'])
dict_keys(['y_0'])

Here is the second one, strongly coupled with the first one.

default_inputs = {
    "x_shared": rand(sizes["x_shared"]),
    "x_local_1": rand(sizes["x_local_1"]),
    "y_0": rand(sizes["y_0"]),
}
index = 1
c_shared = rand(sizes["y_1"], sizes["x_shared"])
c_local = rand(sizes["y_1"], sizes["x_local_1"])
c_coupling = {"y_0": rand(sizes["y_1"], sizes["y_0"])}
disc1 = TMSubDiscipline(index, c_shared, c_local, c_coupling, default_inputs)

print(disc1.name)
print(disc1.get_input_data_names())
print(disc1.get_output_data_names())
SubModel_1
['x_local_1', 'x_shared', 'y_0']
['y_1']
TM_Discipline_1
dict_keys(['x_shared', 'x_local_1', 'y_0'])
dict_keys(['y_1'])

Weakly coupled discipline

Here is the discipline weakly coupled to the previous ones.

c_constraint = [array([1.0, 2.0]), array([3.0, 4.0, 5.0])]
default_inputs = {
    "x_shared": array([0.5]),
    "y_0": array([2.0, 3.0]),
    "y_1": array([4.0, 5.0, 6.0]),
}
system = TMMainDiscipline(c_constraint, default_inputs)

print(system.name)
print(system.get_input_data_names())
print(system.get_output_data_names())
MainModel
['x_shared', 'y_0', 'y_1']
['cstr_0', 'cstr_1', 'obj']
TM_System
dict_keys(['x_shared', 'y_0', 'y_1'])
dict_keys(['obj', 'cstr_0', 'cstr_1'])

Coupling chart

We can represent these three disciplines by means of an N2 chart.

generate_n2_plot([disc0, disc1, system], save=False, show=True)
scalable tm../../_images/N2chart.png

Design space

We define the design space from the sizes of the shared design parameters, local parameters and coupling variables.

n_shared = sizes["x_shared"]
n_local = [sizes["x_local_0"], sizes["x_local_1"]]
n_coupling = [sizes["y_0"], sizes["y_1"]]
design_space = TMDesignSpace(n_shared, n_local, n_coupling)

print(design_space)
<gemseo.problems.scalable.parametric.core.design_space.TMDesignSpace object at 0x7fccd2c754f0>
Design Space:
+-----------+-------------+-------+-------------+-------+
| name      | lower_bound | value | upper_bound | type  |
+-----------+-------------+-------+-------------+-------+
| x_local_0 |      0      |  0.5  |      1      | float |
| x_local_0 |      0      |  0.5  |      1      | float |
| x_local_1 |      0      |  0.5  |      1      | float |
| x_local_1 |      0      |  0.5  |      1      | float |
| x_local_1 |      0      |  0.5  |      1      | float |
| x_shared  |      0      |  0.5  |      1      | float |
| x_shared  |      0      |  0.5  |      1      | float |
| y_0       |      0      |  0.5  |      1      | float |
| y_0       |      0      |  0.5  |      1      | float |
| y_0       |      0      |  0.5  |      1      | float |
| y_1       |      0      |  0.5  |      1      | float |
| y_1       |      0      |  0.5  |      1      | float |
+-----------+-------------+-------+-------------+-------+

Scalable problem

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.

problem = TMScalableProblem(3, [2, 4], [2, 3])

print(problem)

print(problem.get_design_space())

print(problem.get_default_inputs())
Scalable problem
.... MainModel
........ Inputs:
............ x_shared (3)
............ y_0 (2)
............ y_1 (3)
........ Outputs:
............ cstr_0 (2)
............ cstr_1 (3)
............ obj (1)
.... SubModel_0
........ Inputs:
............ x_local_0 (2)
............ x_shared (3)
............ y_1 (3)
........ Outputs:
............ y_0 (2)
.... SubModel_1
........ Inputs:
............ x_local_1 (4)
............ x_shared (3)
............ y_0 (2)
........ Outputs:
............ y_1 (3)
+------------------------------------------------------------------------------+
|                               Parameter space                                |
+-----------+-------------+-------+-------------+-------+----------------------+
| name      | lower_bound | value | upper_bound | type  | Initial distribution |
+-----------+-------------+-------+-------------+-------+----------------------+
| x_local_0 |      0      |  0.5  |      1      | float |                      |
| x_local_0 |      0      |  0.5  |      1      | float |                      |
| x_local_1 |      0      |  0.5  |      1      | float |                      |
| x_local_1 |      0      |  0.5  |      1      | float |                      |
| x_local_1 |      0      |  0.5  |      1      | float |                      |
| x_local_1 |      0      |  0.5  |      1      | float |                      |
| x_shared  |      0      |  0.5  |      1      | float |                      |
| x_shared  |      0      |  0.5  |      1      | float |                      |
| x_shared  |      0      |  0.5  |      1      | float |                      |
| y_0       |      0      |  0.5  |      1      | float |                      |
| y_0       |      0      |  0.5  |      1      | float |                      |
| y_1       |      0      |  0.5  |      1      | float |                      |
| y_1       |      0      |  0.5  |      1      | float |                      |
| y_1       |      0      |  0.5  |      1      | float |                      |
+-----------+-------------+-------+-------------+-------+----------------------+
{'x_shared': array([0.5, 0.5, 0.5]), 'x_local_0': array([0.5, 0.5]), 'y_0': array([0.5, 0.5]), 'cstr_0': array([0.5, 0.5]), 'u_local_0': array([0., 0.]), 'x_local_1': array([0.5, 0.5, 0.5, 0.5]), 'y_1': array([0.5, 0.5, 0.5]), 'cstr_1': array([0.5, 0.5, 0.5]), 'u_local_1': array([0., 0., 0.])}
Scalable problem
> TM_System
   >> Inputs:
      | x_shared (3)
      | y_0 (2)
      | y_1 (3)
   >> Outputs:
      | cstr_0 (2)
      | cstr_1 (3)
      | obj (1)
> TM_Discipline_0
   >> Inputs:
      | x_local_0 (2)
      | x_shared (3)
      | y_1 (3)
   >> Outputs:
      | y_0 (2)
> TM_Discipline_1
   >> Inputs:
      | x_local_1 (4)
      | x_shared (3)
      | y_0 (2)
   >> Outputs:
      | y_1 (3)

Design Space:
+-----------+-------------+-------+-------------+-------+
| name      | lower_bound | value | upper_bound | type  |
+-----------+-------------+-------+-------------+-------+
| x_local_0 |      0      |  0.5  |      1      | float |
| x_local_0 |      0      |  0.5  |      1      | float |
| x_local_1 |      0      |  0.5  |      1      | float |
| x_local_1 |      0      |  0.5  |      1      | float |
| x_local_1 |      0      |  0.5  |      1      | float |
| x_local_1 |      0      |  0.5  |      1      | float |
| x_shared  |      0      |  0.5  |      1      | float |
| x_shared  |      0      |  0.5  |      1      | float |
| x_shared  |      0      |  0.5  |      1      | float |
| y_0       |      0      |  0.5  |      1      | float |
| y_0       |      0      |  0.5  |      1      | float |
| y_1       |      0      |  0.5  |      1      | float |
| y_1       |      0      |  0.5  |      1      | float |
| y_1       |      0      |  0.5  |      1      | float |
+-----------+-------------+-------+-------------+-------+
{'x_shared': array([0.5, 0.5, 0.5]), 'x_local_0': array([0.5, 0.5]),
'y_0': array([0.5, 0.5]), 'cstr_0': array([0.5]), 'x_local_1':
array([0.5, 0.5, 0.5, 0.5]), 'y_1': array([0.5, 0.5, 0.5]), 'cstr_1':
array([0.5])}

Scalable study

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

  • 3 shared design parameters,

  • 2 local design parameters for each strongly coupled discipline,

  • 3 coupling variables for each strongly coupled discipline.

study = TMScalableStudy(n_disciplines=2, n_shared=3, n_local=2, n_coupling=3)
print(study)
Scalable study
.... 2 disciplines
.... 3 shared design parameters
.... 2 local design parameters per discipline
.... 3 coupling variables per discipline
Scalable study
> 2 disciplines
> 3 shared design parameters
> 2 local design parameters per discipline
> 3 coupling variables per discipline

Then, we run MDF and IDF formulations:

study.run_formulation("MDF")
study.run_formulation("IDF")
  • scalable tm
  • scalable tm
    INFO - 17:20:57: Make the starting point feasible.
    INFO - 17:20:57:
    INFO - 17:20:57: *** Start MDOScenario execution ***
    INFO - 17:20:57: MDOScenario
    INFO - 17:20:57:    Disciplines: MainModel SubModel_0 SubModel_1
    INFO - 17:20:57:    MDO formulation: MDF
    INFO - 17:20:57: Optimization problem:
    INFO - 17:20:57:    minimize obj(x_local_0, x_local_1, x_shared)
    INFO - 17:20:57:    with respect to x_local_0, x_local_1, x_shared
    INFO - 17:20:57:    subject to constraints:
    INFO - 17:20:57:       cstr_0(x_local_0, x_local_1, x_shared) <= [ 0.65250671 -2.8453087  -4.16343355]
    INFO - 17:20:57:       cstr_1(x_local_0, x_local_1, x_shared) <= [0.85268891 0.52747299 0.62341835]
    INFO - 17:20:57:    over the design space:
    INFO - 17:20:57:    |                               Parameter space                                |
    INFO - 17:20:57:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 17:20:57:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
    INFO - 17:20:57:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 17:20:57:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
    INFO - 17:20:57:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
    INFO - 17:20:57:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
    INFO - 17:20:57:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
    INFO - 17:20:57:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 17:20:57:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 17:20:57:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 17:20:57:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 17:20:57: Solving optimization problem with algorithm NLOPT_SLSQP:
    INFO - 17:20:57: ...   0%|          | 0/100 [00:00<?, ?it]
    INFO - 17:20:57: ...   1%|          | 1/100 [00:00<00:02, 36.87 it/sec, obj=0.5]
    INFO - 17:20:57: ...   2%|▏         | 2/100 [00:00<00:17,  5.65 it/sec, obj=0.389]
    INFO - 17:20:58: ...   3%|▎         | 3/100 [00:00<00:15,  6.30 it/sec, obj=0.314]
    INFO - 17:20:58: ...   4%|▍         | 4/100 [00:00<00:14,  6.69 it/sec, obj=0.3]
    INFO - 17:20:58: ...   5%|▌         | 5/100 [00:00<00:13,  6.93 it/sec, obj=0.29]
    INFO - 17:20:58: ...   6%|▌         | 6/100 [00:00<00:13,  7.11 it/sec, obj=0.289]
    INFO - 17:20:58: ...   7%|▋         | 7/100 [00:00<00:12,  7.25 it/sec, obj=0.289]
    INFO - 17:20:58: ...   8%|▊         | 8/100 [00:00<00:11,  8.27 it/sec, obj=Not evaluated]
    INFO - 17:20:58: Optimization result:
    INFO - 17:20:58:    Optimizer info:
    INFO - 17:20:58:       Status: None
    INFO - 17:20:58:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
    INFO - 17:20:58:       Number of calls to the objective function by the optimizer: 8
    INFO - 17:20:58:    Solution:
    INFO - 17:20:58:       The solution is feasible.
    INFO - 17:20:58:       Objective: 0.28903317159094793
    INFO - 17:20:58:       Standardized constraints:
    INFO - 17:20:58:          cstr_0 + offset = [-1.59418542e+00 -1.77635684e-15 -2.20075451e+01]
    INFO - 17:20:58:          cstr_1 + offset = [-0.62818923 -1.7413806  -1.62123925]
    INFO - 17:20:58:       +--------------------------------------------------------------------------------------------+
    INFO - 17:20:58:       |                                      Parameter space                                       |
    INFO - 17:20:58:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 17:20:58:       | name      | lower_bound |        value        | upper_bound | type  | Initial distribution |
    INFO - 17:20:58:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 17:20:58:       | x_local_0 |      0      |  0.801127355733839  |      1      | float |                      |
    INFO - 17:20:58:       | x_local_0 |      0      |  0.6239177332508217 |      1      | float |                      |
    INFO - 17:20:58:       | x_local_1 |      0      |          1          |      1      | float |                      |
    INFO - 17:20:58:       | x_local_1 |      0      |          1          |      1      | float |                      |
    INFO - 17:20:58:       | x_shared  |      0      | 0.07024612283000739 |      1      | float |                      |
    INFO - 17:20:58:       | x_shared  |      0      |  0.1762493157624942 |      1      | float |                      |
    INFO - 17:20:58:       | x_shared  |      0      |  0.1499619831353362 |      1      | float |                      |
    INFO - 17:20:58:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 17:20:58: *** End MDOScenario execution (time: 0:00:00.996454) ***
    INFO - 17:21:01: Generating HTML XDSM file in : results/coupling/MDF_xdsm.html
    INFO - 17:21:04: Make the starting point feasible.
    INFO - 17:21:04:
    INFO - 17:21:04: *** Start MDOScenario execution ***
    INFO - 17:21:04: MDOScenario
    INFO - 17:21:04:    Disciplines: MainModel SubModel_0 SubModel_1
    INFO - 17:21:04:    MDO formulation: IDF
    INFO - 17:21:04: Optimization problem:
    INFO - 17:21:04:    minimize obj(x_shared, y_0, y_1)
    INFO - 17:21:04:    with respect to x_local_0, x_local_1, x_shared, y_0, y_1
    INFO - 17:21:04:    subject to constraints:
    INFO - 17:21:04:       cstr_0(x_shared, y_0, y_1) <= [ 0.65250671  0.23093826 -4.16343355]
    INFO - 17:21:04:       cstr_1(x_shared, y_0, y_1) <= [ 0.85268891 -1.36263503  0.62341835]
    INFO - 17:21:04:       y_0: y_0(x_local_0, x_shared, y_1): y_0(x_local_0, x_shared, y_1) - y_0 == 0.0
    INFO - 17:21:04:       y_1: y_1(x_local_1, x_shared, y_0): y_1(x_local_1, x_shared, y_0) - y_1 == 0.0
    INFO - 17:21:04:    over the design space:
    INFO - 17:21:04:    |                               Parameter space                                |
    INFO - 17:21:04:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 17:21:04:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
    INFO - 17:21:04:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 17:21:04:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
    INFO - 17:21:04:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
    INFO - 17:21:04:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
    INFO - 17:21:04:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
    INFO - 17:21:04:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 17:21:04:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 17:21:04:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 17:21:04:    | y_0       |      0      |  0.5  |      1      | float |                      |
    INFO - 17:21:04:    | y_0       |      0      |  0.5  |      1      | float |                      |
    INFO - 17:21:04:    | y_0       |      0      |  0.5  |      1      | float |                      |
    INFO - 17:21:04:    | y_1       |      0      |  0.5  |      1      | float |                      |
    INFO - 17:21:04:    | y_1       |      0      |  0.5  |      1      | float |                      |
    INFO - 17:21:04:    | y_1       |      0      |  0.5  |      1      | float |                      |
    INFO - 17:21:04:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 17:21:04: Solving optimization problem with algorithm NLOPT_SLSQP:
    INFO - 17:21:04: ...   0%|          | 0/100 [00:00<?, ?it]
    INFO - 17:21:04: ...   1%|          | 1/100 [00:00<00:00, 525.21 it/sec, obj=0.5]
    INFO - 17:21:05: ...   2%|▏         | 2/100 [00:00<00:01, 71.93 it/sec, obj=0.385]
    INFO - 17:21:05: ...   3%|▎         | 3/100 [00:00<00:01, 73.50 it/sec, obj=0.27]
    INFO - 17:21:05: ...   4%|▍         | 4/100 [00:00<00:01, 74.48 it/sec, obj=0.262]
    INFO - 17:21:05: ...   5%|▌         | 5/100 [00:00<00:01, 75.01 it/sec, obj=0.257]
    INFO - 17:21:05: ...   6%|▌         | 6/100 [00:00<00:01, 75.56 it/sec, obj=0.252]
    INFO - 17:21:05: ...   7%|▋         | 7/100 [00:00<00:01, 76.03 it/sec, obj=0.251]
    INFO - 17:21:05: ...   8%|▊         | 8/100 [00:00<00:01, 76.22 it/sec, obj=0.251]
    INFO - 17:21:05: ...   9%|▉         | 9/100 [00:00<00:01, 76.52 it/sec, obj=0.251]
    INFO - 17:21:05: ...  10%|█         | 10/100 [00:00<00:01, 83.71 it/sec, obj=Not evaluated]
    INFO - 17:21:05: Optimization result:
    INFO - 17:21:05:    Optimizer info:
    INFO - 17:21:05:       Status: None
    INFO - 17:21:05:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
    INFO - 17:21:05:       Number of calls to the objective function by the optimizer: 10
    INFO - 17:21:05:    Solution:
    INFO - 17:21:05:       The solution is feasible.
    INFO - 17:21:05:       Objective: 0.2505909523154283
    INFO - 17:21:05:       Standardized constraints:
    INFO - 17:21:05:          cstr_0 + offset = [ -1.27965363  -2.31226949 -19.05735903]
    INFO - 17:21:05:          cstr_1 + offset = [-0.59186125  0.         -1.52367146]
    INFO - 17:21:05:          y_0 = [ 5.55111512e-17  0.00000000e+00 -5.55111512e-17]
    INFO - 17:21:05:          y_1 = [ 1.11022302e-16 -5.55111512e-17 -1.11022302e-16]
    INFO - 17:21:05:       +--------------------------------------------------------------------------------------------+
    INFO - 17:21:05:       |                                      Parameter space                                       |
    INFO - 17:21:05:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 17:21:05:       | name      | lower_bound |        value        | upper_bound | type  | Initial distribution |
    INFO - 17:21:05:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 17:21:05:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
    INFO - 17:21:05:       | x_local_0 |      0      |          1          |      1      | float |                      |
    INFO - 17:21:05:       | x_local_1 |      0      |  0.9999999999999999 |      1      | float |                      |
    INFO - 17:21:05:       | x_local_1 |      0      |  0.7594082578802717 |      1      | float |                      |
    INFO - 17:21:05:       | x_shared  |      0      |  0.1558252960698979 |      1      | float |                      |
    INFO - 17:21:05:       | x_shared  |      0      |  0.2044810243675251 |      1      | float |                      |
    INFO - 17:21:05:       | x_shared  |      0      | 0.08695435101337673 |      1      | float |                      |
    INFO - 17:21:05:       | y_0       |      0      |  0.4682527561624886 |      1      | float |                      |
    INFO - 17:21:05:       | y_0       |      0      |   0.40066110028851  |      1      | float |                      |
    INFO - 17:21:05:       | y_0       |      0      |  0.4690830695053916 |      1      | float |                      |
    INFO - 17:21:05:       | y_1       |      0      |  0.5017764477639917 |      1      | float |                      |
    INFO - 17:21:05:       | y_1       |      0      |         0.5         |      1      | float |                      |
    INFO - 17:21:05:       | y_1       |      0      |  0.5046058665567719 |      1      | float |                      |
    INFO - 17:21:05:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 17:21:05: *** End MDOScenario execution (time: 0:00:00.158641) ***
    INFO - 17:21:08: Generating HTML XDSM file in : results/coupling/IDF_xdsm.html

{'x_opt': array([1.        , 1.        , 1.        , 0.75940826, 0.1558253 ,
       0.20448102, 0.08695435, 0.46825276, 0.4006611 , 0.46908307,
       0.50177645, 0.5       , 0.50460587]), 'f_opt': 0.2505909523154283, 'status': None, 'n_iter': 62, 'is_feas': True, 'exec_time': 0.15877475799970853}

We can look at the result in the console:

print(study)
Scalable study
.... 2 disciplines
.... 3 shared design parameters
.... 2 local design parameters per discipline
.... 3 coupling variables per discipline
MDO formulations
.... MDF
........ MainModel = 10 calls / 8 linearizations / 0.003566796999621147 seconds
........ SubModel_0 = 147 calls / 8 linearizations / 0.02599858900794061 seconds
........ SubModel_1 = 139 calls / 8 linearizations / 0.024969797994344844 seconds
........ mda = 8 calls / 8 linearizations / 0.8987272630010921 seconds
........ mdo_chain = 8 calls / 0 linearizations / 0.21947992499917746 seconds
........ sub_mda = 8 calls / 0 linearizations / 0.20372409599804087 seconds
........ scenario = 1 calls / 0 linearizations / 0.9965697320003528 seconds
.... IDF
........ MainModel = 12 calls / 10 linearizations / 0.004261740998117602 seconds
........ SubModel_0 = 11 calls / 9 linearizations / 0.0034539939997557667 seconds
........ SubModel_1 = 11 calls / 9 linearizations / 0.003367822001564491 seconds
........ mda = 0 calls / 0 linearizations / 0.0 seconds
........ mdo_chain = 0 calls / 0 linearizations / 0.0 seconds
........ sub_mda = 0 calls / 0 linearizations / 0.0 seconds
........ scenario = 1 calls / 0 linearizations / 0.15877475799970853 seconds
Scalable study
> 2 disciplines
> 3 shared design parameters
> 2 local design parameters per discipline
> 3 coupling variables per discipline

MDO formulations
> MDF
   >> TM_System = 9 calls / 7 linearizations / 3.29e-03 seconds
   >> TM_Discipline_0 = 132 calls / 7 linearizations / 2.19e-02 seconds
   >> TM_Discipline_1 = 124 calls / 7 linearizations / 2.04e-02 seconds
   >> mda = 7 calls / 7 linearizations / 2.68e-01 seconds
   >> mdo_chain = 7 calls / 0 linearizations / 1.20e-01 seconds
   >> sub_mda = 7 calls / 0 linearizations / 1.16e-01 seconds
   >> scenario = 1 calls / 0 linearizations / 3.35e-01 seconds
> IDF
   >> TM_System = 12 calls / 9 linearizations / 2.98e-03 seconds
   >> TM_Discipline_0 = 12 calls / 9 linearizations / 2.19e-03 seconds
   >> TM_Discipline_1 = 11 calls / 9 linearizations / 2.01e-03 seconds
   >> mda = 0 calls / 0 linearizations / 0.00e+00 seconds
   >> mdo_chain = 0 calls / 0 linearizations / 0.00e+00 seconds
   >> sub_mda = 0 calls / 0 linearizations / 0.00e+00 seconds
   >> scenario = 1 calls / 0 linearizations / 7.60e-02 seconds

or plot the execution time:

study.plot_exec_time()
scalable tm../../_images/exec_time.png

Parametric scalability study

We define a parametric scalability study based on two strongly coupled disciplines and a weakly one, with the following properties:

  • 3 shared design parameters,

  • 2 coupling variables for each strongly coupled discipline,

  • 1, 5 or 25 local design parameters for each strongly coupled discipline,

study = TMParamSS(n_disciplines=2, n_shared=3, n_local=[1, 5, 25], n_coupling=2)
print(study)
Parametric scalable study
> 2 disciplines
> 3 shared design parameters
> 1, 5 or 25 local design parameters per discipline
> 2 coupling variables per discipline
Parametric scalable study
> 2 disciplines
> 3 shared design parameters
> 1, 5 or 25 local design parameters per discipline
> 2 coupling variables per discipline

Then, we run MDF and IDF formulations:

study.run_formulation("MDF")
study.run_formulation("IDF")
  • scalable tm
  • scalable tm
  • scalable tm
  • scalable tm
  • scalable tm
  • scalable tm
   INFO - 17:21:12: Make the starting point feasible.
   INFO - 17:21:12:
   INFO - 17:21:12: *** Start MDOScenario execution ***
   INFO - 17:21:12: MDOScenario
   INFO - 17:21:12:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 17:21:12:    MDO formulation: MDF
   INFO - 17:21:12: Optimization problem:
   INFO - 17:21:12:    minimize obj(x_local_0, x_local_1, x_shared)
   INFO - 17:21:12:    with respect to x_local_0, x_local_1, x_shared
   INFO - 17:21:12:    subject to constraints:
   INFO - 17:21:12:       cstr_0(x_local_0, x_local_1, x_shared) <= [0.88589544 0.88821903]
   INFO - 17:21:12:       cstr_1(x_local_0, x_local_1, x_shared) <= [-0.17585898 -1.56050583]
   INFO - 17:21:12:    over the design space:
   INFO - 17:21:12:    |                               Parameter space                                |
   INFO - 17:21:12:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 17:21:12:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
   INFO - 17:21:12:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 17:21:12:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:12:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:12:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:12:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:12:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:12:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 17:21:12: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 17:21:12: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 17:21:12: ...   1%|          | 1/100 [00:00<00:02, 38.61 it/sec, obj=0.5]
WARNING - 17:21:13: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.3486125443736518e-14 is still above the tolerance 1e-14.
   INFO - 17:21:13: ...   2%|▏         | 2/100 [00:00<00:14,  6.75 it/sec, obj=0.453]
   INFO - 17:21:13: ...   3%|▎         | 3/100 [00:00<00:12,  7.54 it/sec, obj=0.41]
WARNING - 17:21:13: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.0303264460093434e-14 is still above the tolerance 1e-14.
   INFO - 17:21:13: ...   4%|▍         | 4/100 [00:00<00:12,  8.00 it/sec, obj=0.396]
WARNING - 17:21:13: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.221308406312274e-14 is still above the tolerance 1e-14.
   INFO - 17:21:13: ...   5%|▌         | 5/100 [00:00<00:11,  8.30 it/sec, obj=0.384]
WARNING - 17:21:13: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.0624260076854628e-14 is still above the tolerance 1e-14.
   INFO - 17:21:13: ...   6%|▌         | 6/100 [00:00<00:11,  8.50 it/sec, obj=0.381]
WARNING - 17:21:13: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.1319239632249289e-14 is still above the tolerance 1e-14.
   INFO - 17:21:13: ...   7%|▋         | 7/100 [00:00<00:10,  8.64 it/sec, obj=0.381]
   INFO - 17:21:13: ...   8%|▊         | 8/100 [00:00<00:09,  9.86 it/sec, obj=Not evaluated]
   INFO - 17:21:13: Optimization result:
   INFO - 17:21:13:    Optimizer info:
   INFO - 17:21:13:       Status: None
   INFO - 17:21:13:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 17:21:13:       Number of calls to the objective function by the optimizer: 8
   INFO - 17:21:13:    Solution:
   INFO - 17:21:13:       The solution is feasible.
   INFO - 17:21:13:       Objective: 0.3805071026441499
   INFO - 17:21:13:       Standardized constraints:
   INFO - 17:21:13:          cstr_0 + offset = [-0.41404086 -0.37054477]
   INFO - 17:21:13:          cstr_1 + offset = [ -4.10330374 -10.67148731]
   INFO - 17:21:13:       +-------------------------------------------------------------------------------------------+
   INFO - 17:21:13:       |                                      Parameter space                                      |
   INFO - 17:21:13:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 17:21:13:       | name      | lower_bound |       value        | upper_bound | type  | Initial distribution |
   INFO - 17:21:13:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 17:21:13:       | x_local_0 |      0      |         1          |      1      | float |                      |
   INFO - 17:21:13:       | x_local_1 |      0      |         1          |      1      | float |                      |
   INFO - 17:21:13:       | x_shared  |      0      | 0.4316204495066337 |      1      | float |                      |
   INFO - 17:21:13:       | x_shared  |      0      | 0.5112660072459285 |      1      | float |                      |
   INFO - 17:21:13:       | x_shared  |      0      | 0.2050544622846011 |      1      | float |                      |
   INFO - 17:21:13:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 17:21:13: *** End MDOScenario execution (time: 0:00:00.838788) ***
   INFO - 17:21:16: Generating HTML XDSM file in : results/coupling/MDF_xdsm.html
   INFO - 17:21:20: Make the starting point feasible.
   INFO - 17:21:20:
   INFO - 17:21:20: *** Start MDOScenario execution ***
   INFO - 17:21:20: MDOScenario
   INFO - 17:21:20:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 17:21:20:    MDO formulation: MDF
   INFO - 17:21:20: Optimization problem:
   INFO - 17:21:20:    minimize obj(x_local_0, x_local_1, x_shared)
   INFO - 17:21:20:    with respect to x_local_0, x_local_1, x_shared
   INFO - 17:21:20:    subject to constraints:
   INFO - 17:21:20:       cstr_0(x_local_0, x_local_1, x_shared) <= [0.89887356 0.86633976]
   INFO - 17:21:20:       cstr_1(x_local_0, x_local_1, x_shared) <= [0.64342256 0.87330214]
   INFO - 17:21:20:    over the design space:
   INFO - 17:21:20:    |                               Parameter space                                |
   INFO - 17:21:20:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 17:21:20:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
   INFO - 17:21:20:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 17:21:20:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:20:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:20:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:20:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:20:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:20:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:20:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:20:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:20:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:20:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:20:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:20:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:20:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:20:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 17:21:20: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 17:21:20: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 17:21:20: ...   1%|          | 1/100 [00:00<00:02, 40.65 it/sec, obj=0.5]
   INFO - 17:21:20: ...   2%|▏         | 2/100 [00:00<00:13,  7.53 it/sec, obj=0.368]
   INFO - 17:21:20: ...   3%|▎         | 3/100 [00:00<00:11,  8.52 it/sec, obj=0.26]
   INFO - 17:21:20: ...   4%|▍         | 4/100 [00:00<00:10,  9.09 it/sec, obj=0.196]
   INFO - 17:21:20: ...   5%|▌         | 5/100 [00:00<00:10,  9.45 it/sec, obj=0.175]
   INFO - 17:21:20: ...   6%|▌         | 6/100 [00:00<00:09,  9.71 it/sec, obj=0.159]
   INFO - 17:21:20: ...   7%|▋         | 7/100 [00:00<00:09,  9.89 it/sec, obj=0.151]
   INFO - 17:21:20: ...   8%|▊         | 8/100 [00:00<00:09, 10.04 it/sec, obj=0.145]
   INFO - 17:21:21: ...   9%|▉         | 9/100 [00:00<00:08, 10.14 it/sec, obj=0.143]
   INFO - 17:21:21: ...  10%|█         | 10/100 [00:00<00:08, 10.23 it/sec, obj=0.14]
   INFO - 17:21:21: ...  11%|█         | 11/100 [00:01<00:08, 10.31 it/sec, obj=0.139]
   INFO - 17:21:21: ...  12%|█▏        | 12/100 [00:01<00:08, 10.38 it/sec, obj=0.139]
   INFO - 17:21:21: ...  13%|█▎        | 13/100 [00:01<00:08, 10.45 it/sec, obj=0.139]
   INFO - 17:21:21: ...  14%|█▍        | 14/100 [00:01<00:07, 11.23 it/sec, obj=Not evaluated]
   INFO - 17:21:21: Optimization result:
   INFO - 17:21:21:    Optimizer info:
   INFO - 17:21:21:       Status: None
   INFO - 17:21:21:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 17:21:21:       Number of calls to the objective function by the optimizer: 14
   INFO - 17:21:21:    Solution:
   INFO - 17:21:21:       The solution is feasible.
   INFO - 17:21:21:       Objective: 0.1385357381285276
   INFO - 17:21:21:       Standardized constraints:
   INFO - 17:21:21:          cstr_0 + offset = [-0.23668859 -0.10569247]
   INFO - 17:21:21:          cstr_1 + offset = [-1.21308758 -0.34258749]
   INFO - 17:21:21:       +--------------------------------------------------------------------------------------------+
   INFO - 17:21:21:       |                                      Parameter space                                       |
   INFO - 17:21:21:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 17:21:21:       | name      | lower_bound |        value        | upper_bound | type  | Initial distribution |
   INFO - 17:21:21:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 17:21:21:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 17:21:21:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 17:21:21:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 17:21:21:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 17:21:21:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 17:21:21:       | x_local_1 |      0      |  0.9999999999999998 |      1      | float |                      |
   INFO - 17:21:21:       | x_local_1 |      0      |          1          |      1      | float |                      |
   INFO - 17:21:21:       | x_local_1 |      0      |          1          |      1      | float |                      |
   INFO - 17:21:21:       | x_local_1 |      0      |  0.9999999999999998 |      1      | float |                      |
   INFO - 17:21:21:       | x_local_1 |      0      |  0.9999999999999998 |      1      | float |                      |
   INFO - 17:21:21:       | x_shared  |      0      |  0.1458505152901145 |      1      | float |                      |
   INFO - 17:21:21:       | x_shared  |      0      |  0.1819162891601797 |      1      | float |                      |
   INFO - 17:21:21:       | x_shared  |      0      | 0.07257747464173495 |      1      | float |                      |
   INFO - 17:21:21:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 17:21:21: *** End MDOScenario execution (time: 0:00:01.283627) ***
   INFO - 17:21:24: Generating HTML XDSM file in : results/coupling/MDF_xdsm.html
   INFO - 17:21:27: Make the starting point feasible.
   INFO - 17:21:27:
   INFO - 17:21:27: *** Start MDOScenario execution ***
   INFO - 17:21:27: MDOScenario
   INFO - 17:21:27:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 17:21:27:    MDO formulation: MDF
   INFO - 17:21:27: Optimization problem:
   INFO - 17:21:27:    minimize obj(x_local_0, x_local_1, x_shared)
   INFO - 17:21:27:    with respect to x_local_0, x_local_1, x_shared
   INFO - 17:21:27:    subject to constraints:
   INFO - 17:21:27:       cstr_0(x_local_0, x_local_1, x_shared) <= [ -4.03014722 -18.07597002]
   INFO - 17:21:27:       cstr_1(x_local_0, x_local_1, x_shared) <= [-2.53275899  0.59384442]
   INFO - 17:21:27: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 17:21:27: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 17:21:27: ...   1%|          | 1/100 [00:00<00:02, 39.09 it/sec, obj=0.5]
   INFO - 17:21:28: ...   2%|▏         | 2/100 [00:00<00:12,  7.66 it/sec, obj=0.29]
   INFO - 17:21:28: ...   3%|▎         | 3/100 [00:00<00:11,  8.59 it/sec, obj=0.248]
   INFO - 17:21:28: ...   4%|▍         | 4/100 [00:00<00:10,  9.15 it/sec, obj=0.236]
   INFO - 17:21:28: ...   5%|▌         | 5/100 [00:00<00:09,  9.50 it/sec, obj=0.186]
   INFO - 17:21:28: ...   6%|▌         | 6/100 [00:00<00:09,  9.77 it/sec, obj=0.12]
   INFO - 17:21:28: ...   7%|▋         | 7/100 [00:00<00:09,  9.97 it/sec, obj=0.114]
   INFO - 17:21:28: ...   8%|▊         | 8/100 [00:00<00:09, 10.12 it/sec, obj=0.107]
   INFO - 17:21:28: ...   9%|▉         | 9/100 [00:00<00:08, 10.24 it/sec, obj=0.104]
   INFO - 17:21:28: ...  10%|█         | 10/100 [00:00<00:08, 10.32 it/sec, obj=0.101]
   INFO - 17:21:28: ...  11%|█         | 11/100 [00:01<00:08, 10.39 it/sec, obj=0.0963]
   INFO - 17:21:29: ...  12%|█▏        | 12/100 [00:01<00:08, 10.44 it/sec, obj=0.0942]
   INFO - 17:21:29: ...  13%|█▎        | 13/100 [00:01<00:08, 10.48 it/sec, obj=0.0922]
   INFO - 17:21:29: ...  14%|█▍        | 14/100 [00:01<00:08, 10.53 it/sec, obj=0.0908]
   INFO - 17:21:29: ...  15%|█▌        | 15/100 [00:01<00:08, 10.57 it/sec, obj=0.0901]
   INFO - 17:21:29: ...  16%|█▌        | 16/100 [00:01<00:07, 10.61 it/sec, obj=0.0894]
   INFO - 17:21:29: ...  17%|█▋        | 17/100 [00:01<00:07, 10.64 it/sec, obj=0.0878]
   INFO - 17:21:29: ...  18%|█▊        | 18/100 [00:01<00:07, 10.66 it/sec, obj=0.0867]
   INFO - 17:21:29: ...  19%|█▉        | 19/100 [00:01<00:07, 10.69 it/sec, obj=0.0865]
   INFO - 17:21:29: ...  20%|██        | 20/100 [00:01<00:07, 11.24 it/sec, obj=Not evaluated]
   INFO - 17:21:29: Optimization result:
   INFO - 17:21:29:    Optimizer info:
   INFO - 17:21:29:       Status: None
   INFO - 17:21:29:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 17:21:29:       Number of calls to the objective function by the optimizer: 20
   INFO - 17:21:29:    Solution:
   INFO - 17:21:29:       The solution is feasible.
   INFO - 17:21:29:       Objective: 0.08650593635886976
   INFO - 17:21:29:       Standardized constraints:
   INFO - 17:21:29:          cstr_0 + offset = [-8.43715914  0.        ]
   INFO - 17:21:29:          cstr_1 + offset = [-6.67439741e-01  4.44089210e-16]
   INFO - 17:21:29: *** End MDOScenario execution (time: 0:00:01.799234) ***
   INFO - 17:21:32: Generating HTML XDSM file in : results/coupling/MDF_xdsm.html
   INFO - 17:21:36: Make the starting point feasible.
   INFO - 17:21:36:
   INFO - 17:21:36: *** Start MDOScenario execution ***
   INFO - 17:21:36: MDOScenario
   INFO - 17:21:36:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 17:21:36:    MDO formulation: IDF
   INFO - 17:21:36: Optimization problem:
   INFO - 17:21:36:    minimize obj(x_shared, y_0, y_1)
   INFO - 17:21:36:    with respect to x_local_0, x_local_1, x_shared, y_0, y_1
   INFO - 17:21:36:    subject to constraints:
   INFO - 17:21:36:       cstr_0(x_shared, y_0, y_1) <= [0.88589544 0.88821903]
   INFO - 17:21:36:       cstr_1(x_shared, y_0, y_1) <= [-0.17585898 -1.56050583]
   INFO - 17:21:36:       y_0: y_0(x_local_0, x_shared, y_1): y_0(x_local_0, x_shared, y_1) - y_0 == 0.0
   INFO - 17:21:36:       y_1: y_1(x_local_1, x_shared, y_0): y_1(x_local_1, x_shared, y_0) - y_1 == 0.0
   INFO - 17:21:36:    over the design space:
   INFO - 17:21:36:    |                               Parameter space                                |
   INFO - 17:21:36:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 17:21:36:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
   INFO - 17:21:36:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 17:21:36:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:36:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:36:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:36:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:36:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:36:    | y_0       |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:36:    | y_0       |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:36:    | y_1       |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:36:    | y_1       |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:36:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 17:21:36: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 17:21:36: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 17:21:36: ...   1%|          | 1/100 [00:00<00:00, 537.11 it/sec, obj=0.5]
   INFO - 17:21:36: ...   2%|▏         | 2/100 [00:00<00:01, 78.95 it/sec, obj=0.453]
   INFO - 17:21:36: ...   3%|▎         | 3/100 [00:00<00:01, 80.93 it/sec, obj=0.41]
   INFO - 17:21:36: ...   4%|▍         | 4/100 [00:00<00:01, 81.97 it/sec, obj=0.396]
   INFO - 17:21:36: ...   5%|▌         | 5/100 [00:00<00:01, 82.72 it/sec, obj=0.385]
   INFO - 17:21:36: ...   6%|▌         | 6/100 [00:00<00:01, 83.36 it/sec, obj=0.381]
   INFO - 17:21:36: ...   7%|▋         | 7/100 [00:00<00:01, 83.74 it/sec, obj=0.381]
   INFO - 17:21:36: ...   8%|▊         | 8/100 [00:00<00:00, 93.91 it/sec, obj=Not evaluated]
   INFO - 17:21:36: Optimization result:
   INFO - 17:21:36:    Optimizer info:
   INFO - 17:21:36:       Status: None
   INFO - 17:21:36:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 17:21:36:       Number of calls to the objective function by the optimizer: 8
   INFO - 17:21:36:    Solution:
   INFO - 17:21:36:       The solution is feasible.
   INFO - 17:21:36:       Objective: 0.3805016326090851
   INFO - 17:21:36:       Standardized constraints:
   INFO - 17:21:36:          cstr_0 + offset = [-0.4105685  -0.36790752]
   INFO - 17:21:36:          cstr_1 + offset = [ -4.06820466 -10.60696021]
   INFO - 17:21:36:          y_0 = [-5.55111512e-17  5.55111512e-17]
   INFO - 17:21:36:          y_1 = [-1.66533454e-16  0.00000000e+00]
   INFO - 17:21:36:       +-------------------------------------------------------------------------------------------+
   INFO - 17:21:36:       |                                      Parameter space                                      |
   INFO - 17:21:36:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 17:21:36:       | name      | lower_bound |       value        | upper_bound | type  | Initial distribution |
   INFO - 17:21:36:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 17:21:36:       | x_local_0 |      0      |         1          |      1      | float |                      |
   INFO - 17:21:36:       | x_local_1 |      0      |         1          |      1      | float |                      |
   INFO - 17:21:36:       | x_shared  |      0      | 0.4349840014945803 |      1      | float |                      |
   INFO - 17:21:36:       | x_shared  |      0      | 0.5153341160240119 |      1      | float |                      |
   INFO - 17:21:36:       | x_shared  |      0      |  0.20620547934211  |      1      | float |                      |
   INFO - 17:21:36:       | y_0       |      0      | 0.4598177788198944 |      1      | float |                      |
   INFO - 17:21:36:       | y_0       |      0      | 0.4291325171427605 |      1      | float |                      |
   INFO - 17:21:36:       | y_1       |      0      | 0.4459772572294342 |      1      | float |                      |
   INFO - 17:21:36:       | y_1       |      0      | 0.5142525316178621 |      1      | float |                      |
   INFO - 17:21:36:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 17:21:36: *** End MDOScenario execution (time: 0:00:00.119470) ***
   INFO - 17:21:39: Generating HTML XDSM file in : results/coupling/IDF_xdsm.html
   INFO - 17:21:43: Make the starting point feasible.
   INFO - 17:21:43:
   INFO - 17:21:43: *** Start MDOScenario execution ***
   INFO - 17:21:43: MDOScenario
   INFO - 17:21:43:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 17:21:43:    MDO formulation: IDF
   INFO - 17:21:43: Optimization problem:
   INFO - 17:21:43:    minimize obj(x_shared, y_0, y_1)
   INFO - 17:21:43:    with respect to x_local_0, x_local_1, x_shared, y_0, y_1
   INFO - 17:21:43:    subject to constraints:
   INFO - 17:21:43:       cstr_0(x_shared, y_0, y_1) <= [0.89887356 0.86633976]
   INFO - 17:21:43:       cstr_1(x_shared, y_0, y_1) <= [-0.78288719  0.87330214]
   INFO - 17:21:43:       y_0: y_0(x_local_0, x_shared, y_1): y_0(x_local_0, x_shared, y_1) - y_0 == 0.0
   INFO - 17:21:43:       y_1: y_1(x_local_1, x_shared, y_0): y_1(x_local_1, x_shared, y_0) - y_1 == 0.0
   INFO - 17:21:43:    over the design space:
   INFO - 17:21:43:    |                               Parameter space                                |
   INFO - 17:21:43:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 17:21:43:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
   INFO - 17:21:43:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 17:21:43:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    | y_0       |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    | y_0       |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    | y_1       |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    | y_1       |      0      |  0.5  |      1      | float |                      |
   INFO - 17:21:43:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 17:21:43: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 17:21:43: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 17:21:43: ...   1%|          | 1/100 [00:00<00:00, 552.46 it/sec, obj=0.5]
   INFO - 17:21:43: ...   2%|▏         | 2/100 [00:00<00:01, 78.53 it/sec, obj=0.369]
   INFO - 17:21:43: ...   3%|▎         | 3/100 [00:00<00:01, 80.62 it/sec, obj=0.264]
   INFO - 17:21:43: ...   4%|▍         | 4/100 [00:00<00:01, 81.69 it/sec, obj=0.206]
   INFO - 17:21:43: ...   5%|▌         | 5/100 [00:00<00:01, 82.31 it/sec, obj=0.182]
   INFO - 17:21:43: ...   6%|▌         | 6/100 [00:00<00:01, 82.63 it/sec, obj=0.172]
   INFO - 17:21:43: ...   7%|▋         | 7/100 [00:00<00:01, 82.91 it/sec, obj=0.164]
   INFO - 17:21:43: ...   8%|▊         | 8/100 [00:00<00:01, 83.12 it/sec, obj=0.158]
   INFO - 17:21:43: ...   9%|▉         | 9/100 [00:00<00:01, 83.33 it/sec, obj=0.156]
   INFO - 17:21:43: ...  10%|█         | 10/100 [00:00<00:01, 83.46 it/sec, obj=0.156]
   INFO - 17:21:43: ...  11%|█         | 11/100 [00:00<00:01, 83.56 it/sec, obj=0.154]
   INFO - 17:21:43: ...  12%|█▏        | 12/100 [00:00<00:01, 83.67 it/sec, obj=0.154]
   INFO - 17:21:43: ...  13%|█▎        | 13/100 [00:00<00:00, 89.47 it/sec, obj=Not evaluated]
   INFO - 17:21:43: Optimization result:
   INFO - 17:21:43:    Optimizer info:
   INFO - 17:21:43:       Status: None
   INFO - 17:21:43:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 17:21:43:       Number of calls to the objective function by the optimizer: 13
   INFO - 17:21:43:    Solution:
   INFO - 17:21:43:       The solution is feasible.
   INFO - 17:21:43:       Objective: 0.15383885100886432
   INFO - 17:21:43:       Standardized constraints:
   INFO - 17:21:43:          cstr_0 + offset = [-0.28367339 -0.13418614]
   INFO - 17:21:43:          cstr_1 + offset = [ 0.         -0.39931711]
   INFO - 17:21:43:          y_0 = [5.55111512e-17 1.66533454e-16]
   INFO - 17:21:43:          y_1 = [1.11022302e-16 1.11022302e-16]
   INFO - 17:21:43:       +--------------------------------------------------------------------------------------------+
   INFO - 17:21:43:       |                                      Parameter space                                       |
   INFO - 17:21:43:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 17:21:43:       | name      | lower_bound |        value        | upper_bound | type  | Initial distribution |
   INFO - 17:21:43:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 17:21:43:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 17:21:43:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 17:21:43:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 17:21:43:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 17:21:43:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 17:21:43:       | x_local_1 |      0      |          1          |      1      | float |                      |
   INFO - 17:21:43:       | x_local_1 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 17:21:43:       | x_local_1 |      0      |          1          |      1      | float |                      |
   INFO - 17:21:43:       | x_local_1 |      0      |  0.9858563292487739 |      1      | float |                      |
   INFO - 17:21:43:       | x_local_1 |      0      |  0.8952030605001723 |      1      | float |                      |
   INFO - 17:21:43:       | x_shared  |      0      | 0.03908896701511936 |      1      | float |                      |
   INFO - 17:21:43:       | x_shared  |      0      | 0.05509382017067609 |      1      | float |                      |
   INFO - 17:21:43:       | x_shared  |      0      | 0.03828687665187131 |      1      | float |                      |
   INFO - 17:21:43:       | y_0       |      0      |  0.3805135756043002 |      1      | float |                      |
   INFO - 17:21:43:       | y_0       |      0      |  0.2003934597112414 |      1      | float |                      |
   INFO - 17:21:43:       | y_1       |      0      |         0.5         |      1      | float |                      |
   INFO - 17:21:43:       | y_1       |      0      |  0.4151727380322101 |      1      | float |                      |
   INFO - 17:21:43:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 17:21:43: *** End MDOScenario execution (time: 0:00:00.188922) ***
   INFO - 17:21:46: Generating HTML XDSM file in : results/coupling/IDF_xdsm.html
   INFO - 17:21:50: Make the starting point feasible.
   INFO - 17:21:50:
   INFO - 17:21:50: *** Start MDOScenario execution ***
   INFO - 17:21:50: MDOScenario
   INFO - 17:21:50:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 17:21:50:    MDO formulation: IDF
   INFO - 17:21:50: Optimization problem:
   INFO - 17:21:50:    minimize obj(x_shared, y_0, y_1)
   INFO - 17:21:50:    with respect to x_local_0, x_local_1, x_shared, y_0, y_1
   INFO - 17:21:50:    subject to constraints:
   INFO - 17:21:50:       cstr_0(x_shared, y_0, y_1) <= [-24.15073611  -2.815194  ]
   INFO - 17:21:50:       cstr_1(x_shared, y_0, y_1) <= [-2.53275899  0.59384442]
   INFO - 17:21:50:       y_0: y_0(x_local_0, x_shared, y_1): y_0(x_local_0, x_shared, y_1) - y_0 == 0.0
   INFO - 17:21:50:       y_1: y_1(x_local_1, x_shared, y_0): y_1(x_local_1, x_shared, y_0) - y_1 == 0.0
   INFO - 17:21:50: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 17:21:50: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 17:21:50: ...   1%|          | 1/100 [00:00<00:00, 504.67 it/sec, obj=0.5]
   INFO - 17:21:50: ...   2%|▏         | 2/100 [00:00<00:01, 68.38 it/sec, obj=0.288]
   INFO - 17:21:50: ...   3%|▎         | 3/100 [00:00<00:01, 70.24 it/sec, obj=0.237]
   INFO - 17:21:50: ...   4%|▍         | 4/100 [00:00<00:01, 69.74 it/sec, obj=0.227]
   INFO - 17:21:50: ...   5%|▌         | 5/100 [00:00<00:01, 69.23 it/sec, obj=0.181]
   INFO - 17:21:50: ...   6%|▌         | 6/100 [00:00<00:01, 68.73 it/sec, obj=0.113]
   INFO - 17:21:50: ...   7%|▋         | 7/100 [00:00<00:01, 67.91 it/sec, obj=0.107]
   INFO - 17:21:50: ...   8%|▊         | 8/100 [00:00<00:01, 67.30 it/sec, obj=0.101]
   INFO - 17:21:50: ...   9%|▉         | 9/100 [00:00<00:01, 66.84 it/sec, obj=0.0948]
   INFO - 17:21:51: ...  10%|█         | 10/100 [00:00<00:01, 66.35 it/sec, obj=0.087]
   INFO - 17:21:51: ...  11%|█         | 11/100 [00:00<00:01, 65.69 it/sec, obj=0.0853]
   INFO - 17:21:51: ...  12%|█▏        | 12/100 [00:00<00:01, 65.28 it/sec, obj=0.0842]
   INFO - 17:21:51: ...  13%|█▎        | 13/100 [00:00<00:01, 65.09 it/sec, obj=0.0825]
   INFO - 17:21:51: ...  14%|█▍        | 14/100 [00:00<00:01, 64.89 it/sec, obj=0.0817]
   INFO - 17:21:51: ...  15%|█▌        | 15/100 [00:00<00:01, 64.67 it/sec, obj=0.0805]
   INFO - 17:21:51: ...  16%|█▌        | 16/100 [00:00<00:01, 64.44 it/sec, obj=0.0802]
   INFO - 17:21:51: ...  17%|█▋        | 17/100 [00:00<00:01, 64.21 it/sec, obj=0.0796]
   INFO - 17:21:51: ...  18%|█▊        | 18/100 [00:00<00:01, 64.01 it/sec, obj=0.0791]
   INFO - 17:21:51: ...  19%|█▉        | 19/100 [00:00<00:01, 63.82 it/sec, obj=0.0786]
   INFO - 17:21:51: ...  20%|██        | 20/100 [00:00<00:01, 63.67 it/sec, obj=0.0784]
   INFO - 17:21:51: ...  21%|██        | 21/100 [00:00<00:01, 66.35 it/sec, obj=Not evaluated]
   INFO - 17:21:51: Optimization result:
   INFO - 17:21:51:    Optimizer info:
   INFO - 17:21:51:       Status: None
   INFO - 17:21:51:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 17:21:51:       Number of calls to the objective function by the optimizer: 21
   INFO - 17:21:51:    Solution:
   INFO - 17:21:51:       The solution is feasible.
   INFO - 17:21:51:       Objective: 0.07837467586318368
   INFO - 17:21:51:       Standardized constraints:
   INFO - 17:21:51:          cstr_0 + offset = [ 0.         -3.92093323]
   INFO - 17:21:51:          cstr_1 + offset = [-3.95598136e-01 -1.11022302e-16]
   INFO - 17:21:51:          y_0 = [ 1.66533454e-16 -2.77555756e-17]
   INFO - 17:21:51:          y_1 = [ 0.00000000e+00 -4.16333634e-17]
   INFO - 17:21:51: *** End MDOScenario execution (time: 0:00:00.337993) ***
   INFO - 17:21:54: Generating HTML XDSM file in : results/coupling/IDF_xdsm.html

and save the results in a pickle file:

study.save("results.pkl")

We can plot these results and compare MDF and IDF formulations in terms of execution time for different number of local design variables.

results = TMParamSSPost("results.pkl")
results.plot("Comparison of MDF and IDF formulations")
Comparison of MDF and IDF formulations../../_images/mdf_idf.png

Total running time of the script: ( 1 minutes 2.797 seconds)

Gallery generated by Sphinx-Gallery