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 0x7fd3a04bcf40>
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 - 09:03:10: Make the starting point feasible.
    INFO - 09:03:10:
    INFO - 09:03:10: *** Start MDOScenario execution ***
    INFO - 09:03:10: MDOScenario
    INFO - 09:03:10:    Disciplines: MainModel SubModel_0 SubModel_1
    INFO - 09:03:10:    MDO formulation: MDF
    INFO - 09:03:10: Optimization problem:
    INFO - 09:03:10:    minimize obj(x_local_0, x_local_1, x_shared)
    INFO - 09:03:10:    with respect to x_local_0, x_local_1, x_shared
    INFO - 09:03:10:    subject to constraints:
    INFO - 09:03:10:       cstr_0(x_local_0, x_local_1, x_shared) <= [ 0.65250671 -2.8453087  -4.16343355]
    INFO - 09:03:10:       cstr_1(x_local_0, x_local_1, x_shared) <= [0.85268891 0.52747299 0.62341835]
    INFO - 09:03:10:    over the design space:
    INFO - 09:03:10:    |                               Parameter space                                |
    INFO - 09:03:10:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 09:03:10:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
    INFO - 09:03:10:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 09:03:10:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:10:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:10:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:10:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:10:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:10:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:10:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:10:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 09:03:10: Solving optimization problem with algorithm NLOPT_SLSQP:
    INFO - 09:03:10: ...   0%|          | 0/100 [00:00<?, ?it]
    INFO - 09:03:10: ...   1%|          | 1/100 [00:00<00:01, 64.12 it/sec, obj=0.5]
    INFO - 09:03:10: ...   2%|▏         | 2/100 [00:00<00:09, 10.11 it/sec, obj=0.389]
    INFO - 09:03:10: ...   3%|▎         | 3/100 [00:00<00:08, 11.23 it/sec, obj=0.314]
    INFO - 09:03:10: ...   4%|▍         | 4/100 [00:00<00:08, 11.91 it/sec, obj=0.3]
    INFO - 09:03:10: ...   5%|▌         | 5/100 [00:00<00:07, 12.41 it/sec, obj=0.29]
    INFO - 09:03:10: ...   6%|▌         | 6/100 [00:00<00:07, 12.79 it/sec, obj=0.289]
    INFO - 09:03:10: ...   7%|▋         | 7/100 [00:00<00:07, 13.06 it/sec, obj=0.289]
    INFO - 09:03:10: ...   8%|▊         | 8/100 [00:00<00:06, 14.90 it/sec, obj=Not evaluated]
    INFO - 09:03:10: Optimization result:
    INFO - 09:03:10:    Optimizer info:
    INFO - 09:03:10:       Status: None
    INFO - 09:03:10:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
    INFO - 09:03:10:       Number of calls to the objective function by the optimizer: 8
    INFO - 09:03:10:    Solution:
    INFO - 09:03:10:       The solution is feasible.
    INFO - 09:03:10:       Objective: 0.28903317159094793
    INFO - 09:03:10:       Standardized constraints:
    INFO - 09:03:10:          cstr_0 + offset = [-1.59418542e+00 -1.77635684e-15 -2.20075451e+01]
    INFO - 09:03:10:          cstr_1 + offset = [-0.62818923 -1.7413806  -1.62123925]
    INFO - 09:03:10:       +--------------------------------------------------------------------------------------------+
    INFO - 09:03:10:       |                                      Parameter space                                       |
    INFO - 09:03:10:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 09:03:10:       | name      | lower_bound |        value        | upper_bound | type  | Initial distribution |
    INFO - 09:03:10:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 09:03:10:       | x_local_0 |      0      |  0.801127355733839  |      1      | float |                      |
    INFO - 09:03:10:       | x_local_0 |      0      |  0.6239177332508217 |      1      | float |                      |
    INFO - 09:03:10:       | x_local_1 |      0      |          1          |      1      | float |                      |
    INFO - 09:03:10:       | x_local_1 |      0      |          1          |      1      | float |                      |
    INFO - 09:03:10:       | x_shared  |      0      | 0.07024612283000739 |      1      | float |                      |
    INFO - 09:03:10:       | x_shared  |      0      |  0.1762493157624942 |      1      | float |                      |
    INFO - 09:03:10:       | x_shared  |      0      |  0.1499619831353362 |      1      | float |                      |
    INFO - 09:03:10:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 09:03:10: *** End MDOScenario execution (time: 0:00:00.553581) ***
    INFO - 09:03:12: Generating HTML XDSM file in : results/coupling/MDF_xdsm.html
    INFO - 09:03:14: Make the starting point feasible.
    INFO - 09:03:14:
    INFO - 09:03:14: *** Start MDOScenario execution ***
    INFO - 09:03:14: MDOScenario
    INFO - 09:03:14:    Disciplines: MainModel SubModel_0 SubModel_1
    INFO - 09:03:14:    MDO formulation: IDF
    INFO - 09:03:14: Optimization problem:
    INFO - 09:03:14:    minimize obj(x_shared, y_0, y_1)
    INFO - 09:03:14:    with respect to x_local_0, x_local_1, x_shared, y_0, y_1
    INFO - 09:03:14:    subject to constraints:
    INFO - 09:03:14:       cstr_0(x_shared, y_0, y_1) <= [ 0.65250671  0.23093826 -4.16343355]
    INFO - 09:03:14:       cstr_1(x_shared, y_0, y_1) <= [ 0.85268891 -1.36263503  0.62341835]
    INFO - 09:03:14:       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 - 09:03:14:       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 - 09:03:14:    over the design space:
    INFO - 09:03:14:    |                               Parameter space                                |
    INFO - 09:03:14:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 09:03:14:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
    INFO - 09:03:14:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 09:03:14:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:14:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:14:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:14:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:14:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:14:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:14:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:14:    | y_0       |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:14:    | y_0       |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:14:    | y_0       |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:14:    | y_1       |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:14:    | y_1       |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:14:    | y_1       |      0      |  0.5  |      1      | float |                      |
    INFO - 09:03:14:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 09:03:14: Solving optimization problem with algorithm NLOPT_SLSQP:
    INFO - 09:03:14: ...   0%|          | 0/100 [00:00<?, ?it]
    INFO - 09:03:14: ...   1%|          | 1/100 [00:00<00:00, 870.01 it/sec, obj=0.5]
    INFO - 09:03:14: ...   2%|▏         | 2/100 [00:00<00:00, 128.70 it/sec, obj=0.385]
    INFO - 09:03:14: ...   3%|▎         | 3/100 [00:00<00:00, 132.65 it/sec, obj=0.27]
    INFO - 09:03:14: ...   4%|▍         | 4/100 [00:00<00:00, 134.96 it/sec, obj=0.262]
    INFO - 09:03:14: ...   5%|▌         | 5/100 [00:00<00:00, 136.74 it/sec, obj=0.257]
    INFO - 09:03:14: ...   6%|▌         | 6/100 [00:00<00:00, 138.04 it/sec, obj=0.252]
    INFO - 09:03:14: ...   7%|▋         | 7/100 [00:00<00:00, 138.78 it/sec, obj=0.251]
    INFO - 09:03:14: ...   8%|▊         | 8/100 [00:00<00:00, 139.47 it/sec, obj=0.251]
    INFO - 09:03:14: ...   9%|▉         | 9/100 [00:00<00:00, 140.01 it/sec, obj=0.251]
    INFO - 09:03:14: ...  10%|█         | 10/100 [00:00<00:00, 153.10 it/sec, obj=Not evaluated]
    INFO - 09:03:14: Optimization result:
    INFO - 09:03:14:    Optimizer info:
    INFO - 09:03:14:       Status: None
    INFO - 09:03:14:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
    INFO - 09:03:14:       Number of calls to the objective function by the optimizer: 10
    INFO - 09:03:14:    Solution:
    INFO - 09:03:14:       The solution is feasible.
    INFO - 09:03:14:       Objective: 0.2505909523154283
    INFO - 09:03:14:       Standardized constraints:
    INFO - 09:03:14:          cstr_0 + offset = [ -1.27965363  -2.31226949 -19.05735903]
    INFO - 09:03:14:          cstr_1 + offset = [-0.59186125  0.         -1.52367146]
    INFO - 09:03:14:          y_0 = [ 5.55111512e-17  0.00000000e+00 -5.55111512e-17]
    INFO - 09:03:14:          y_1 = [ 1.11022302e-16 -5.55111512e-17 -1.11022302e-16]
    INFO - 09:03:14:       +--------------------------------------------------------------------------------------------+
    INFO - 09:03:14:       |                                      Parameter space                                       |
    INFO - 09:03:14:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 09:03:14:       | name      | lower_bound |        value        | upper_bound | type  | Initial distribution |
    INFO - 09:03:14:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 09:03:14:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
    INFO - 09:03:14:       | x_local_0 |      0      |          1          |      1      | float |                      |
    INFO - 09:03:14:       | x_local_1 |      0      |  0.9999999999999999 |      1      | float |                      |
    INFO - 09:03:14:       | x_local_1 |      0      |  0.7594082578802717 |      1      | float |                      |
    INFO - 09:03:14:       | x_shared  |      0      |  0.1558252960698979 |      1      | float |                      |
    INFO - 09:03:14:       | x_shared  |      0      |  0.2044810243675251 |      1      | float |                      |
    INFO - 09:03:14:       | x_shared  |      0      | 0.08695435101337673 |      1      | float |                      |
    INFO - 09:03:14:       | y_0       |      0      |  0.4682527561624886 |      1      | float |                      |
    INFO - 09:03:14:       | y_0       |      0      |   0.40066110028851  |      1      | float |                      |
    INFO - 09:03:14:       | y_0       |      0      |  0.4690830695053916 |      1      | float |                      |
    INFO - 09:03:14:       | y_1       |      0      |  0.5017764477639917 |      1      | float |                      |
    INFO - 09:03:14:       | y_1       |      0      |         0.5         |      1      | float |                      |
    INFO - 09:03:14:       | y_1       |      0      |  0.5046058665567719 |      1      | float |                      |
    INFO - 09:03:14:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 09:03:14: *** End MDOScenario execution (time: 0:00:00.086501) ***
    INFO - 09:03:16: 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.08657813700119732}

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.0022561149980901973 seconds
........ SubModel_0 = 147 calls / 8 linearizations / 0.014368682981512393 seconds
........ SubModel_1 = 139 calls / 8 linearizations / 0.013042664013482863 seconds
........ mda = 8 calls / 8 linearizations / 0.49912298399431165 seconds
........ mdo_chain = 8 calls / 0 linearizations / 0.11473106099947472 seconds
........ sub_mda = 8 calls / 0 linearizations / 0.10578220800198324 seconds
........ scenario = 1 calls / 0 linearizations / 0.5536594719997083 seconds
.... IDF
........ MainModel = 12 calls / 10 linearizations / 0.0025390219961991534 seconds
........ SubModel_0 = 11 calls / 9 linearizations / 0.00201959900186921 seconds
........ SubModel_1 = 11 calls / 9 linearizations / 0.0018935419993795222 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.08657813700119732 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 - 09:03:19: Make the starting point feasible.
   INFO - 09:03:19:
   INFO - 09:03:19: *** Start MDOScenario execution ***
   INFO - 09:03:19: MDOScenario
   INFO - 09:03:19:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 09:03:19:    MDO formulation: MDF
   INFO - 09:03:19: Optimization problem:
   INFO - 09:03:19:    minimize obj(x_local_0, x_local_1, x_shared)
   INFO - 09:03:19:    with respect to x_local_0, x_local_1, x_shared
   INFO - 09:03:19:    subject to constraints:
   INFO - 09:03:19:       cstr_0(x_local_0, x_local_1, x_shared) <= [0.88589544 0.88821903]
   INFO - 09:03:19:       cstr_1(x_local_0, x_local_1, x_shared) <= [-0.17585898 -1.56050583]
   INFO - 09:03:19:    over the design space:
   INFO - 09:03:19:    |                               Parameter space                                |
   INFO - 09:03:19:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 09:03:19:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
   INFO - 09:03:19:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 09:03:19:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:19:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:19:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:19:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:19:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:19:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 09:03:19: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 09:03:19: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 09:03:19: ...   1%|          | 1/100 [00:00<00:01, 67.20 it/sec, obj=0.5]
WARNING - 09:03:19: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.3486125443736518e-14 is still above the tolerance 1e-14.
   INFO - 09:03:19: ...   2%|▏         | 2/100 [00:00<00:08, 12.11 it/sec, obj=0.453]
   INFO - 09:03:19: ...   3%|▎         | 3/100 [00:00<00:07, 13.57 it/sec, obj=0.41]
WARNING - 09:03:19: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.0303264460093434e-14 is still above the tolerance 1e-14.
   INFO - 09:03:19: ...   4%|▍         | 4/100 [00:00<00:06, 14.46 it/sec, obj=0.396]
WARNING - 09:03:19: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.221308406312274e-14 is still above the tolerance 1e-14.
   INFO - 09:03:19: ...   5%|▌         | 5/100 [00:00<00:06, 14.96 it/sec, obj=0.384]
WARNING - 09:03:19: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.0624260076854628e-14 is still above the tolerance 1e-14.
   INFO - 09:03:19: ...   6%|▌         | 6/100 [00:00<00:06, 15.34 it/sec, obj=0.381]
WARNING - 09:03:19: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.1319239632249289e-14 is still above the tolerance 1e-14.
   INFO - 09:03:19: ...   7%|▋         | 7/100 [00:00<00:05, 15.58 it/sec, obj=0.381]
   INFO - 09:03:19: ...   8%|▊         | 8/100 [00:00<00:05, 17.77 it/sec, obj=Not evaluated]
   INFO - 09:03:19: Optimization result:
   INFO - 09:03:19:    Optimizer info:
   INFO - 09:03:19:       Status: None
   INFO - 09:03:19:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 09:03:19:       Number of calls to the objective function by the optimizer: 8
   INFO - 09:03:19:    Solution:
   INFO - 09:03:19:       The solution is feasible.
   INFO - 09:03:19:       Objective: 0.3805071026441499
   INFO - 09:03:19:       Standardized constraints:
   INFO - 09:03:19:          cstr_0 + offset = [-0.41404086 -0.37054477]
   INFO - 09:03:19:          cstr_1 + offset = [ -4.10330374 -10.67148731]
   INFO - 09:03:19:       +-------------------------------------------------------------------------------------------+
   INFO - 09:03:19:       |                                      Parameter space                                      |
   INFO - 09:03:19:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 09:03:19:       | name      | lower_bound |       value        | upper_bound | type  | Initial distribution |
   INFO - 09:03:19:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 09:03:19:       | x_local_0 |      0      |         1          |      1      | float |                      |
   INFO - 09:03:19:       | x_local_1 |      0      |         1          |      1      | float |                      |
   INFO - 09:03:19:       | x_shared  |      0      | 0.4316204495066337 |      1      | float |                      |
   INFO - 09:03:19:       | x_shared  |      0      | 0.5112660072459285 |      1      | float |                      |
   INFO - 09:03:19:       | x_shared  |      0      | 0.2050544622846011 |      1      | float |                      |
   INFO - 09:03:19:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 09:03:19: *** End MDOScenario execution (time: 0:00:00.465712) ***
   INFO - 09:03:21: Generating HTML XDSM file in : results/coupling/MDF_xdsm.html
   INFO - 09:03:24: Make the starting point feasible.
   INFO - 09:03:24:
   INFO - 09:03:24: *** Start MDOScenario execution ***
   INFO - 09:03:24: MDOScenario
   INFO - 09:03:24:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 09:03:24:    MDO formulation: MDF
   INFO - 09:03:24: Optimization problem:
   INFO - 09:03:24:    minimize obj(x_local_0, x_local_1, x_shared)
   INFO - 09:03:24:    with respect to x_local_0, x_local_1, x_shared
   INFO - 09:03:24:    subject to constraints:
   INFO - 09:03:24:       cstr_0(x_local_0, x_local_1, x_shared) <= [0.89887356 0.86633976]
   INFO - 09:03:24:       cstr_1(x_local_0, x_local_1, x_shared) <= [0.64342256 0.87330214]
   INFO - 09:03:24:    over the design space:
   INFO - 09:03:24:    |                               Parameter space                                |
   INFO - 09:03:24:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 09:03:24:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
   INFO - 09:03:24:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 09:03:24:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:24:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:24:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:24:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:24:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:24:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:24:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:24:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:24:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:24:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:24:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:24:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:24:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:24:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 09:03:24: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 09:03:24: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 09:03:24: ...   1%|          | 1/100 [00:00<00:01, 69.96 it/sec, obj=0.5]
   INFO - 09:03:24: ...   2%|▏         | 2/100 [00:00<00:07, 13.53 it/sec, obj=0.368]
   INFO - 09:03:24: ...   3%|▎         | 3/100 [00:00<00:06, 15.33 it/sec, obj=0.26]
   INFO - 09:03:24: ...   4%|▍         | 4/100 [00:00<00:05, 16.30 it/sec, obj=0.196]
   INFO - 09:03:24: ...   5%|▌         | 5/100 [00:00<00:05, 16.96 it/sec, obj=0.175]
   INFO - 09:03:24: ...   6%|▌         | 6/100 [00:00<00:05, 17.39 it/sec, obj=0.159]
   INFO - 09:03:24: ...   7%|▋         | 7/100 [00:00<00:05, 17.69 it/sec, obj=0.151]
   INFO - 09:03:24: ...   8%|▊         | 8/100 [00:00<00:05, 17.95 it/sec, obj=0.145]
   INFO - 09:03:24: ...   9%|▉         | 9/100 [00:00<00:05, 18.15 it/sec, obj=0.143]
   INFO - 09:03:24: ...  10%|█         | 10/100 [00:00<00:04, 18.31 it/sec, obj=0.14]
   INFO - 09:03:24: ...  11%|█         | 11/100 [00:00<00:04, 18.47 it/sec, obj=0.139]
   INFO - 09:03:24: ...  12%|█▏        | 12/100 [00:00<00:04, 18.60 it/sec, obj=0.139]
   INFO - 09:03:24: ...  13%|█▎        | 13/100 [00:00<00:04, 18.73 it/sec, obj=0.139]
   INFO - 09:03:24: ...  14%|█▍        | 14/100 [00:00<00:04, 20.14 it/sec, obj=Not evaluated]
   INFO - 09:03:24: Optimization result:
   INFO - 09:03:24:    Optimizer info:
   INFO - 09:03:24:       Status: None
   INFO - 09:03:24:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 09:03:24:       Number of calls to the objective function by the optimizer: 14
   INFO - 09:03:24:    Solution:
   INFO - 09:03:24:       The solution is feasible.
   INFO - 09:03:24:       Objective: 0.1385357381285276
   INFO - 09:03:24:       Standardized constraints:
   INFO - 09:03:24:          cstr_0 + offset = [-0.23668859 -0.10569247]
   INFO - 09:03:24:          cstr_1 + offset = [-1.21308758 -0.34258749]
   INFO - 09:03:24:       +--------------------------------------------------------------------------------------------+
   INFO - 09:03:24:       |                                      Parameter space                                       |
   INFO - 09:03:24:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 09:03:24:       | name      | lower_bound |        value        | upper_bound | type  | Initial distribution |
   INFO - 09:03:24:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 09:03:24:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 09:03:24:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 09:03:24:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 09:03:24:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 09:03:24:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 09:03:24:       | x_local_1 |      0      |  0.9999999999999998 |      1      | float |                      |
   INFO - 09:03:24:       | x_local_1 |      0      |          1          |      1      | float |                      |
   INFO - 09:03:24:       | x_local_1 |      0      |          1          |      1      | float |                      |
   INFO - 09:03:24:       | x_local_1 |      0      |  0.9999999999999998 |      1      | float |                      |
   INFO - 09:03:24:       | x_local_1 |      0      |  0.9999999999999998 |      1      | float |                      |
   INFO - 09:03:24:       | x_shared  |      0      |  0.1458505152901145 |      1      | float |                      |
   INFO - 09:03:24:       | x_shared  |      0      |  0.1819162891601797 |      1      | float |                      |
   INFO - 09:03:24:       | x_shared  |      0      | 0.07257747464173495 |      1      | float |                      |
   INFO - 09:03:24:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 09:03:24: *** End MDOScenario execution (time: 0:00:00.715739) ***
   INFO - 09:03:26: Generating HTML XDSM file in : results/coupling/MDF_xdsm.html
   INFO - 09:03:28: Make the starting point feasible.
   INFO - 09:03:28:
   INFO - 09:03:28: *** Start MDOScenario execution ***
   INFO - 09:03:28: MDOScenario
   INFO - 09:03:28:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 09:03:28:    MDO formulation: MDF
   INFO - 09:03:28: Optimization problem:
   INFO - 09:03:28:    minimize obj(x_local_0, x_local_1, x_shared)
   INFO - 09:03:28:    with respect to x_local_0, x_local_1, x_shared
   INFO - 09:03:28:    subject to constraints:
   INFO - 09:03:28:       cstr_0(x_local_0, x_local_1, x_shared) <= [ -4.03014722 -18.07597002]
   INFO - 09:03:28:       cstr_1(x_local_0, x_local_1, x_shared) <= [-2.53275899  0.59384442]
   INFO - 09:03:28: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 09:03:28: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 09:03:28: ...   1%|          | 1/100 [00:00<00:01, 68.10 it/sec, obj=0.5]
   INFO - 09:03:29: ...   2%|▏         | 2/100 [00:00<00:07, 13.54 it/sec, obj=0.29]
   INFO - 09:03:29: ...   3%|▎         | 3/100 [00:00<00:06, 15.25 it/sec, obj=0.248]
   INFO - 09:03:29: ...   4%|▍         | 4/100 [00:00<00:05, 16.34 it/sec, obj=0.236]
   INFO - 09:03:29: ...   5%|▌         | 5/100 [00:00<00:05, 17.05 it/sec, obj=0.186]
   INFO - 09:03:29: ...   6%|▌         | 6/100 [00:00<00:05, 17.58 it/sec, obj=0.12]
   INFO - 09:03:29: ...   7%|▋         | 7/100 [00:00<00:05, 17.88 it/sec, obj=0.114]
   INFO - 09:03:29: ...   8%|▊         | 8/100 [00:00<00:05, 18.13 it/sec, obj=0.107]
   INFO - 09:03:29: ...   9%|▉         | 9/100 [00:00<00:04, 18.35 it/sec, obj=0.104]
   INFO - 09:03:29: ...  10%|█         | 10/100 [00:00<00:04, 18.51 it/sec, obj=0.101]
   INFO - 09:03:29: ...  11%|█         | 11/100 [00:00<00:04, 18.65 it/sec, obj=0.0963]
   INFO - 09:03:29: ...  12%|█▏        | 12/100 [00:00<00:04, 18.79 it/sec, obj=0.0942]
   INFO - 09:03:29: ...  13%|█▎        | 13/100 [00:00<00:04, 18.89 it/sec, obj=0.0922]
   INFO - 09:03:29: ...  14%|█▍        | 14/100 [00:00<00:04, 18.94 it/sec, obj=0.0908]
   INFO - 09:03:29: ...  15%|█▌        | 15/100 [00:00<00:04, 19.03 it/sec, obj=0.0901]
   INFO - 09:03:29: ...  16%|█▌        | 16/100 [00:00<00:04, 19.11 it/sec, obj=0.0894]
   INFO - 09:03:29: ...  17%|█▋        | 17/100 [00:00<00:04, 19.15 it/sec, obj=0.0878]
   INFO - 09:03:29: ...  18%|█▊        | 18/100 [00:00<00:04, 19.21 it/sec, obj=0.0867]
   INFO - 09:03:29: ...  19%|█▉        | 19/100 [00:00<00:04, 19.25 it/sec, obj=0.0865]
   INFO - 09:03:29: ...  20%|██        | 20/100 [00:00<00:03, 20.24 it/sec, obj=Not evaluated]
   INFO - 09:03:29: Optimization result:
   INFO - 09:03:29:    Optimizer info:
   INFO - 09:03:29:       Status: None
   INFO - 09:03:29:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 09:03:29:       Number of calls to the objective function by the optimizer: 20
   INFO - 09:03:29:    Solution:
   INFO - 09:03:29:       The solution is feasible.
   INFO - 09:03:29:       Objective: 0.08650593635886976
   INFO - 09:03:29:       Standardized constraints:
   INFO - 09:03:29:          cstr_0 + offset = [-8.43715914  0.        ]
   INFO - 09:03:29:          cstr_1 + offset = [-6.67439741e-01  4.44089210e-16]
   INFO - 09:03:29: *** End MDOScenario execution (time: 0:00:01.000814) ***
   INFO - 09:03:31: Generating HTML XDSM file in : results/coupling/MDF_xdsm.html
   INFO - 09:03:34: Make the starting point feasible.
   INFO - 09:03:34:
   INFO - 09:03:34: *** Start MDOScenario execution ***
   INFO - 09:03:34: MDOScenario
   INFO - 09:03:34:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 09:03:34:    MDO formulation: IDF
   INFO - 09:03:34: Optimization problem:
   INFO - 09:03:34:    minimize obj(x_shared, y_0, y_1)
   INFO - 09:03:34:    with respect to x_local_0, x_local_1, x_shared, y_0, y_1
   INFO - 09:03:34:    subject to constraints:
   INFO - 09:03:34:       cstr_0(x_shared, y_0, y_1) <= [0.88589544 0.88821903]
   INFO - 09:03:34:       cstr_1(x_shared, y_0, y_1) <= [-0.17585898 -1.56050583]
   INFO - 09:03:34:       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 - 09:03:34:       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 - 09:03:34:    over the design space:
   INFO - 09:03:34:    |                               Parameter space                                |
   INFO - 09:03:34:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 09:03:34:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
   INFO - 09:03:34:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 09:03:34:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:34:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:34:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:34:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:34:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:34:    | y_0       |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:34:    | y_0       |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:34:    | y_1       |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:34:    | y_1       |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:34:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 09:03:34: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 09:03:34: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 09:03:34: ...   1%|          | 1/100 [00:00<00:00, 780.48 it/sec, obj=0.5]
   INFO - 09:03:34: ...   2%|▏         | 2/100 [00:00<00:00, 138.54 it/sec, obj=0.453]
   INFO - 09:03:34: ...   3%|▎         | 3/100 [00:00<00:00, 144.17 it/sec, obj=0.41]
   INFO - 09:03:34: ...   4%|▍         | 4/100 [00:00<00:00, 147.07 it/sec, obj=0.396]
   INFO - 09:03:34: ...   5%|▌         | 5/100 [00:00<00:00, 149.12 it/sec, obj=0.385]
   INFO - 09:03:34: ...   6%|▌         | 6/100 [00:00<00:00, 150.01 it/sec, obj=0.381]
   INFO - 09:03:34: ...   7%|▋         | 7/100 [00:00<00:00, 150.22 it/sec, obj=0.381]
   INFO - 09:03:34: ...   8%|▊         | 8/100 [00:00<00:00, 167.96 it/sec, obj=Not evaluated]
   INFO - 09:03:34: Optimization result:
   INFO - 09:03:34:    Optimizer info:
   INFO - 09:03:34:       Status: None
   INFO - 09:03:34:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 09:03:34:       Number of calls to the objective function by the optimizer: 8
   INFO - 09:03:34:    Solution:
   INFO - 09:03:34:       The solution is feasible.
   INFO - 09:03:34:       Objective: 0.3805016326090851
   INFO - 09:03:34:       Standardized constraints:
   INFO - 09:03:34:          cstr_0 + offset = [-0.4105685  -0.36790752]
   INFO - 09:03:34:          cstr_1 + offset = [ -4.06820466 -10.60696021]
   INFO - 09:03:34:          y_0 = [-5.55111512e-17  5.55111512e-17]
   INFO - 09:03:34:          y_1 = [-1.66533454e-16  0.00000000e+00]
   INFO - 09:03:34:       +-------------------------------------------------------------------------------------------+
   INFO - 09:03:34:       |                                      Parameter space                                      |
   INFO - 09:03:34:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 09:03:34:       | name      | lower_bound |       value        | upper_bound | type  | Initial distribution |
   INFO - 09:03:34:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 09:03:34:       | x_local_0 |      0      |         1          |      1      | float |                      |
   INFO - 09:03:34:       | x_local_1 |      0      |         1          |      1      | float |                      |
   INFO - 09:03:34:       | x_shared  |      0      | 0.4349840014945803 |      1      | float |                      |
   INFO - 09:03:34:       | x_shared  |      0      | 0.5153341160240119 |      1      | float |                      |
   INFO - 09:03:34:       | x_shared  |      0      |  0.20620547934211  |      1      | float |                      |
   INFO - 09:03:34:       | y_0       |      0      | 0.4598177788198944 |      1      | float |                      |
   INFO - 09:03:34:       | y_0       |      0      | 0.4291325171427605 |      1      | float |                      |
   INFO - 09:03:34:       | y_1       |      0      | 0.4459772572294342 |      1      | float |                      |
   INFO - 09:03:34:       | y_1       |      0      | 0.5142525316178621 |      1      | float |                      |
   INFO - 09:03:34:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 09:03:34: *** End MDOScenario execution (time: 0:00:00.067419) ***
   INFO - 09:03:36: Generating HTML XDSM file in : results/coupling/IDF_xdsm.html
   INFO - 09:03:38: Make the starting point feasible.
   INFO - 09:03:38:
   INFO - 09:03:38: *** Start MDOScenario execution ***
   INFO - 09:03:38: MDOScenario
   INFO - 09:03:38:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 09:03:38:    MDO formulation: IDF
   INFO - 09:03:38: Optimization problem:
   INFO - 09:03:38:    minimize obj(x_shared, y_0, y_1)
   INFO - 09:03:38:    with respect to x_local_0, x_local_1, x_shared, y_0, y_1
   INFO - 09:03:38:    subject to constraints:
   INFO - 09:03:38:       cstr_0(x_shared, y_0, y_1) <= [0.89887356 0.86633976]
   INFO - 09:03:38:       cstr_1(x_shared, y_0, y_1) <= [-0.78288719  0.87330214]
   INFO - 09:03:38:       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 - 09:03:38:       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 - 09:03:38:    over the design space:
   INFO - 09:03:38:    |                               Parameter space                                |
   INFO - 09:03:38:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 09:03:38:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
   INFO - 09:03:38:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 09:03:38:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    | y_0       |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    | y_0       |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    | y_1       |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    | y_1       |      0      |  0.5  |      1      | float |                      |
   INFO - 09:03:38:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 09:03:38: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 09:03:38: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 09:03:38: ...   1%|          | 1/100 [00:00<00:00, 923.86 it/sec, obj=0.5]
   INFO - 09:03:38: ...   2%|▏         | 2/100 [00:00<00:00, 144.43 it/sec, obj=0.369]
   INFO - 09:03:38: ...   3%|▎         | 3/100 [00:00<00:00, 147.76 it/sec, obj=0.264]
   INFO - 09:03:38: ...   4%|▍         | 4/100 [00:00<00:00, 149.16 it/sec, obj=0.206]
   INFO - 09:03:38: ...   5%|▌         | 5/100 [00:00<00:00, 150.39 it/sec, obj=0.182]
   INFO - 09:03:38: ...   6%|▌         | 6/100 [00:00<00:00, 147.76 it/sec, obj=0.172]
   INFO - 09:03:38: ...   7%|▋         | 7/100 [00:00<00:00, 148.51 it/sec, obj=0.164]
   INFO - 09:03:38: ...   8%|▊         | 8/100 [00:00<00:00, 148.82 it/sec, obj=0.158]
   INFO - 09:03:38: ...   9%|▉         | 9/100 [00:00<00:00, 149.35 it/sec, obj=0.156]
   INFO - 09:03:38: ...  10%|█         | 10/100 [00:00<00:00, 149.82 it/sec, obj=0.156]
   INFO - 09:03:38: ...  11%|█         | 11/100 [00:00<00:00, 150.21 it/sec, obj=0.154]
   INFO - 09:03:38: ...  12%|█▏        | 12/100 [00:00<00:00, 150.55 it/sec, obj=0.154]
   INFO - 09:03:38: ...  13%|█▎        | 13/100 [00:00<00:00, 160.74 it/sec, obj=Not evaluated]
   INFO - 09:03:38: Optimization result:
   INFO - 09:03:38:    Optimizer info:
   INFO - 09:03:38:       Status: None
   INFO - 09:03:38:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 09:03:38:       Number of calls to the objective function by the optimizer: 13
   INFO - 09:03:38:    Solution:
   INFO - 09:03:38:       The solution is feasible.
   INFO - 09:03:38:       Objective: 0.15383885100886432
   INFO - 09:03:38:       Standardized constraints:
   INFO - 09:03:38:          cstr_0 + offset = [-0.28367339 -0.13418614]
   INFO - 09:03:38:          cstr_1 + offset = [ 0.         -0.39931711]
   INFO - 09:03:38:          y_0 = [5.55111512e-17 1.66533454e-16]
   INFO - 09:03:38:          y_1 = [1.11022302e-16 1.11022302e-16]
   INFO - 09:03:38:       +--------------------------------------------------------------------------------------------+
   INFO - 09:03:38:       |                                      Parameter space                                       |
   INFO - 09:03:38:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 09:03:38:       | name      | lower_bound |        value        | upper_bound | type  | Initial distribution |
   INFO - 09:03:38:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 09:03:38:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 09:03:38:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 09:03:38:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 09:03:38:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 09:03:38:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 09:03:38:       | x_local_1 |      0      |          1          |      1      | float |                      |
   INFO - 09:03:38:       | x_local_1 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 09:03:38:       | x_local_1 |      0      |          1          |      1      | float |                      |
   INFO - 09:03:38:       | x_local_1 |      0      |  0.9858563292487739 |      1      | float |                      |
   INFO - 09:03:38:       | x_local_1 |      0      |  0.8952030605001723 |      1      | float |                      |
   INFO - 09:03:38:       | x_shared  |      0      | 0.03908896701511936 |      1      | float |                      |
   INFO - 09:03:38:       | x_shared  |      0      | 0.05509382017067609 |      1      | float |                      |
   INFO - 09:03:38:       | x_shared  |      0      | 0.03828687665187131 |      1      | float |                      |
   INFO - 09:03:38:       | y_0       |      0      |  0.3805135756043002 |      1      | float |                      |
   INFO - 09:03:38:       | y_0       |      0      |  0.2003934597112414 |      1      | float |                      |
   INFO - 09:03:38:       | y_1       |      0      |         0.5         |      1      | float |                      |
   INFO - 09:03:38:       | y_1       |      0      |  0.4151727380322101 |      1      | float |                      |
   INFO - 09:03:38:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 09:03:38: *** End MDOScenario execution (time: 0:00:00.104431) ***
   INFO - 09:03:41: Generating HTML XDSM file in : results/coupling/IDF_xdsm.html
   INFO - 09:03:43: Make the starting point feasible.
   INFO - 09:03:43:
   INFO - 09:03:43: *** Start MDOScenario execution ***
   INFO - 09:03:43: MDOScenario
   INFO - 09:03:43:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 09:03:43:    MDO formulation: IDF
   INFO - 09:03:43: Optimization problem:
   INFO - 09:03:43:    minimize obj(x_shared, y_0, y_1)
   INFO - 09:03:43:    with respect to x_local_0, x_local_1, x_shared, y_0, y_1
   INFO - 09:03:43:    subject to constraints:
   INFO - 09:03:43:       cstr_0(x_shared, y_0, y_1) <= [-24.15073611  -2.815194  ]
   INFO - 09:03:43:       cstr_1(x_shared, y_0, y_1) <= [-2.53275899  0.59384442]
   INFO - 09:03: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 - 09:03: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 - 09:03:43: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 09:03:43: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 09:03:43: ...   1%|          | 1/100 [00:00<00:00, 897.75 it/sec, obj=0.5]
   INFO - 09:03:43: ...   2%|▏         | 2/100 [00:00<00:00, 113.62 it/sec, obj=0.288]
   INFO - 09:03:43: ...   3%|▎         | 3/100 [00:00<00:00, 115.66 it/sec, obj=0.237]
   INFO - 09:03:43: ...   4%|▍         | 4/100 [00:00<00:00, 116.73 it/sec, obj=0.227]
   INFO - 09:03:43: ...   5%|▌         | 5/100 [00:00<00:00, 115.84 it/sec, obj=0.181]
   INFO - 09:03:43: ...   6%|▌         | 6/100 [00:00<00:00, 115.13 it/sec, obj=0.113]
   INFO - 09:03:43: ...   7%|▋         | 7/100 [00:00<00:00, 114.89 it/sec, obj=0.107]
   INFO - 09:03:43: ...   8%|▊         | 8/100 [00:00<00:00, 114.61 it/sec, obj=0.101]
   INFO - 09:03:43: ...   9%|▉         | 9/100 [00:00<00:00, 113.84 it/sec, obj=0.0948]
   INFO - 09:03:43: ...  10%|█         | 10/100 [00:00<00:00, 111.84 it/sec, obj=0.087]
   INFO - 09:03:43: ...  11%|█         | 11/100 [00:00<00:00, 111.06 it/sec, obj=0.0853]
   INFO - 09:03:43: ...  12%|█▏        | 12/100 [00:00<00:00, 110.61 it/sec, obj=0.0842]
   INFO - 09:03:43: ...  13%|█▎        | 13/100 [00:00<00:00, 110.36 it/sec, obj=0.0825]
   INFO - 09:03:43: ...  14%|█▍        | 14/100 [00:00<00:00, 109.82 it/sec, obj=0.0817]
   INFO - 09:03:43: ...  15%|█▌        | 15/100 [00:00<00:00, 109.56 it/sec, obj=0.0805]
   INFO - 09:03:43: ...  16%|█▌        | 16/100 [00:00<00:00, 109.24 it/sec, obj=0.0802]
   INFO - 09:03:43: ...  17%|█▋        | 17/100 [00:00<00:00, 108.90 it/sec, obj=0.0796]
   INFO - 09:03:43: ...  18%|█▊        | 18/100 [00:00<00:00, 108.44 it/sec, obj=0.0791]
   INFO - 09:03:43: ...  19%|█▉        | 19/100 [00:00<00:00, 108.18 it/sec, obj=0.0786]
   INFO - 09:03:43: ...  20%|██        | 20/100 [00:00<00:00, 108.04 it/sec, obj=0.0784]
   INFO - 09:03:43: ...  21%|██        | 21/100 [00:00<00:00, 112.51 it/sec, obj=Not evaluated]
   INFO - 09:03:43: Optimization result:
   INFO - 09:03:43:    Optimizer info:
   INFO - 09:03:43:       Status: None
   INFO - 09:03:43:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 09:03:43:       Number of calls to the objective function by the optimizer: 21
   INFO - 09:03:43:    Solution:
   INFO - 09:03:43:       The solution is feasible.
   INFO - 09:03:43:       Objective: 0.07837467586318368
   INFO - 09:03:43:       Standardized constraints:
   INFO - 09:03:43:          cstr_0 + offset = [ 0.         -3.92093323]
   INFO - 09:03:43:          cstr_1 + offset = [-3.95598136e-01 -1.11022302e-16]
   INFO - 09:03:43:          y_0 = [ 1.66533454e-16 -2.77555756e-17]
   INFO - 09:03:43:          y_1 = [ 0.00000000e+00 -4.16333634e-17]
   INFO - 09:03:43: *** End MDOScenario execution (time: 0:00:00.199033) ***
   INFO - 09:03:45: 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: ( 0 minutes 39.711 seconds)

Gallery generated by Sphinx-Gallery