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 0x7f40120f1370>
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 - 11:21:52: Make the starting point feasible.
    INFO - 11:21:52:
    INFO - 11:21:52: *** Start MDOScenario execution ***
    INFO - 11:21:52: MDOScenario
    INFO - 11:21:52:    Disciplines: MainModel SubModel_0 SubModel_1
    INFO - 11:21:52:    MDO formulation: MDF
    INFO - 11:21:52: Optimization problem:
    INFO - 11:21:52:    minimize obj(x_local_0, x_local_1, x_shared)
    INFO - 11:21:52:    with respect to x_local_0, x_local_1, x_shared
    INFO - 11:21:52:    subject to constraints:
    INFO - 11:21:52:       cstr_0(x_local_0, x_local_1, x_shared) <= [ 0.65250671 -2.8453087  -4.16343355]
    INFO - 11:21:52:       cstr_1(x_local_0, x_local_1, x_shared) <= [0.85268891 0.52747299 0.62341835]
    INFO - 11:21:52:    over the design space:
    INFO - 11:21:52:    |                               Parameter space                                |
    INFO - 11:21:52:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 11:21:52:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
    INFO - 11:21:52:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 11:21:52:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:52:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:52:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:52:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:52:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:52:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:52:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:52:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 11:21:52: Solving optimization problem with algorithm NLOPT_SLSQP:
    INFO - 11:21:52: ...   0%|          | 0/100 [00:00<?, ?it]
    INFO - 11:21:53: ...   2%|▏         | 2/100 [00:00<00:00, 752.69 it/sec, obj=0.5]
    INFO - 11:21:53: ...   4%|▍         | 4/100 [00:00<00:00, 368.52 it/sec, obj=0.5]
    INFO - 11:21:53: ...   6%|▌         | 6/100 [00:00<00:00, 245.02 it/sec, obj=0.5]
    INFO - 11:21:53: ...   8%|▊         | 8/100 [00:00<00:00, 184.38 it/sec, obj=0.5]
    INFO - 11:21:53: ...   8%|▊         | 8/100 [00:00<00:00, 184.05 it/sec, obj=0.5]
    INFO - 11:21:53: Optimization result:
    INFO - 11:21:53:    Optimizer info:
    INFO - 11:21:53:       Status: None
    INFO - 11:21:53:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
    INFO - 11:21:53:       Number of calls to the objective function by the optimizer: 8
    INFO - 11:21:53:    Solution:
    INFO - 11:21:53:       The solution is feasible.
    INFO - 11:21:53:       Objective: 0.28903317159094793
    INFO - 11:21:53:       Standardized constraints:
    INFO - 11:21:53:          cstr_0 + offset = [-1.59418542e+00 -1.77635684e-15 -2.20075451e+01]
    INFO - 11:21:53:          cstr_1 + offset = [-0.62818923 -1.7413806  -1.62123925]
    INFO - 11:21:53:       +--------------------------------------------------------------------------------------------+
    INFO - 11:21:53:       |                                      Parameter space                                       |
    INFO - 11:21:53:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 11:21:53:       | name      | lower_bound |        value        | upper_bound | type  | Initial distribution |
    INFO - 11:21:53:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 11:21:53:       | x_local_0 |      0      |  0.801127355733839  |      1      | float |                      |
    INFO - 11:21:53:       | x_local_0 |      0      |  0.6239177332508217 |      1      | float |                      |
    INFO - 11:21:53:       | x_local_1 |      0      |          1          |      1      | float |                      |
    INFO - 11:21:53:       | x_local_1 |      0      |          1          |      1      | float |                      |
    INFO - 11:21:53:       | x_shared  |      0      | 0.07024612283000739 |      1      | float |                      |
    INFO - 11:21:53:       | x_shared  |      0      |  0.1762493157624942 |      1      | float |                      |
    INFO - 11:21:53:       | x_shared  |      0      |  0.1499619831353362 |      1      | float |                      |
    INFO - 11:21:53:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 11:21:53: *** End MDOScenario execution (time: 0:00:00.559659) ***
    INFO - 11:21:55: Generating HTML XDSM file in : results/coupling/MDF_xdsm.html
    INFO - 11:21:57: Make the starting point feasible.
    INFO - 11:21:57:
    INFO - 11:21:57: *** Start MDOScenario execution ***
    INFO - 11:21:57: MDOScenario
    INFO - 11:21:57:    Disciplines: MainModel SubModel_0 SubModel_1
    INFO - 11:21:57:    MDO formulation: IDF
    INFO - 11:21:57: Optimization problem:
    INFO - 11:21:57:    minimize obj(x_shared, y_0, y_1)
    INFO - 11:21:57:    with respect to x_local_0, x_local_1, x_shared, y_0, y_1
    INFO - 11:21:57:    subject to constraints:
    INFO - 11:21:57:       cstr_0(x_shared, y_0, y_1) <= [ 0.65250671  0.23093826 -4.16343355]
    INFO - 11:21:57:       cstr_1(x_shared, y_0, y_1) <= [ 0.85268891 -1.36263503  0.62341835]
    INFO - 11:21:57:       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 - 11:21:57:       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 - 11:21:57:    over the design space:
    INFO - 11:21:57:    |                               Parameter space                                |
    INFO - 11:21:57:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 11:21:57:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
    INFO - 11:21:57:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 11:21:57:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:57:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:57:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:57:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:57:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:57:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:57:    | x_shared  |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:57:    | y_0       |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:57:    | y_0       |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:57:    | y_0       |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:57:    | y_1       |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:57:    | y_1       |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:57:    | y_1       |      0      |  0.5  |      1      | float |                      |
    INFO - 11:21:57:    +-----------+-------------+-------+-------------+-------+----------------------+
    INFO - 11:21:57: Solving optimization problem with algorithm NLOPT_SLSQP:
    INFO - 11:21:57: ...   0%|          | 0/100 [00:00<?, ?it]
    INFO - 11:21:57: ...  10%|█         | 10/100 [00:00<00:00, 1584.87 it/sec, obj=0.5]
    INFO - 11:21:57: Optimization result:
    INFO - 11:21:57:    Optimizer info:
    INFO - 11:21:57:       Status: None
    INFO - 11:21:57:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
    INFO - 11:21:57:       Number of calls to the objective function by the optimizer: 10
    INFO - 11:21:57:    Solution:
    INFO - 11:21:57:       The solution is feasible.
    INFO - 11:21:57:       Objective: 0.2505909523154283
    INFO - 11:21:57:       Standardized constraints:
    INFO - 11:21:57:          cstr_0 + offset = [ -1.27965363  -2.31226949 -19.05735903]
    INFO - 11:21:57:          cstr_1 + offset = [-0.59186125  0.         -1.52367146]
    INFO - 11:21:57:          y_0 = [ 5.55111512e-17  0.00000000e+00 -5.55111512e-17]
    INFO - 11:21:57:          y_1 = [ 1.11022302e-16 -5.55111512e-17 -1.11022302e-16]
    INFO - 11:21:57:       +--------------------------------------------------------------------------------------------+
    INFO - 11:21:57:       |                                      Parameter space                                       |
    INFO - 11:21:57:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 11:21:57:       | name      | lower_bound |        value        | upper_bound | type  | Initial distribution |
    INFO - 11:21:57:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 11:21:57:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
    INFO - 11:21:57:       | x_local_0 |      0      |          1          |      1      | float |                      |
    INFO - 11:21:57:       | x_local_1 |      0      |  0.9999999999999999 |      1      | float |                      |
    INFO - 11:21:57:       | x_local_1 |      0      |  0.7594082578802717 |      1      | float |                      |
    INFO - 11:21:57:       | x_shared  |      0      |  0.1558252960698979 |      1      | float |                      |
    INFO - 11:21:57:       | x_shared  |      0      |  0.2044810243675251 |      1      | float |                      |
    INFO - 11:21:57:       | x_shared  |      0      | 0.08695435101337673 |      1      | float |                      |
    INFO - 11:21:57:       | y_0       |      0      |  0.4682527561624886 |      1      | float |                      |
    INFO - 11:21:57:       | y_0       |      0      |   0.40066110028851  |      1      | float |                      |
    INFO - 11:21:57:       | y_0       |      0      |  0.4690830695053916 |      1      | float |                      |
    INFO - 11:21:57:       | y_1       |      0      |  0.5017764477639917 |      1      | float |                      |
    INFO - 11:21:57:       | y_1       |      0      |         0.5         |      1      | float |                      |
    INFO - 11:21:57:       | y_1       |      0      |  0.5046058665567719 |      1      | float |                      |
    INFO - 11:21:57:       +-----------+-------------+---------------------+-------------+-------+----------------------+
    INFO - 11:21:57: *** End MDOScenario execution (time: 0:00:00.083986) ***
    INFO - 11:21:59: 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.08405520000087563}

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.002333254993573064 seconds
........ SubModel_0 = 147 calls / 8 linearizations / 0.014170751008350635 seconds
........ SubModel_1 = 139 calls / 8 linearizations / 0.012809540985472267 seconds
........ mda = 8 calls / 8 linearizations / 0.5045115910033928 seconds
........ mdo_chain = 8 calls / 0 linearizations / 0.11866624999674968 seconds
........ sub_mda = 8 calls / 0 linearizations / 0.1096057569993718 seconds
........ scenario = 1 calls / 0 linearizations / 0.5597266250006214 seconds
.... IDF
........ MainModel = 12 calls / 10 linearizations / 0.0024654390035721008 seconds
........ SubModel_0 = 11 calls / 9 linearizations / 0.0019781560004048515 seconds
........ SubModel_1 = 11 calls / 9 linearizations / 0.0018792350019793957 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.08405520000087563 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 - 11:22:02: Make the starting point feasible.
   INFO - 11:22:02:
   INFO - 11:22:02: *** Start MDOScenario execution ***
   INFO - 11:22:02: MDOScenario
   INFO - 11:22:02:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 11:22:02:    MDO formulation: MDF
   INFO - 11:22:02: Optimization problem:
   INFO - 11:22:02:    minimize obj(x_local_0, x_local_1, x_shared)
   INFO - 11:22:02:    with respect to x_local_0, x_local_1, x_shared
   INFO - 11:22:02:    subject to constraints:
   INFO - 11:22:02:       cstr_0(x_local_0, x_local_1, x_shared) <= [0.88589544 0.88821903]
   INFO - 11:22:02:       cstr_1(x_local_0, x_local_1, x_shared) <= [-0.17585898 -1.56050583]
   INFO - 11:22:02:    over the design space:
   INFO - 11:22:02:    |                               Parameter space                                |
   INFO - 11:22:02:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 11:22:02:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
   INFO - 11:22:02:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 11:22:02:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:02:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:02:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:02:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:02:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:02:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 11:22:02: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 11:22:02: ...   0%|          | 0/100 [00:00<?, ?it]
WARNING - 11:22:02: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.3486125443736518e-14 is still above the tolerance 1e-14.
   INFO - 11:22:02: ...   2%|▏         | 2/100 [00:00<00:00, 946.03 it/sec, obj=0.5]
   INFO - 11:22:02: ...   4%|▍         | 4/100 [00:00<00:00, 461.38 it/sec, obj=0.5]
WARNING - 11:22:02: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.0303264460093434e-14 is still above the tolerance 1e-14.
WARNING - 11:22:02: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.221308406312274e-14 is still above the tolerance 1e-14.
   INFO - 11:22:02: ...   6%|▌         | 6/100 [00:00<00:00, 304.55 it/sec, obj=0.5]
WARNING - 11:22:02: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.0624260076854628e-14 is still above the tolerance 1e-14.
WARNING - 11:22:02: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.1319239632249289e-14 is still above the tolerance 1e-14.
   INFO - 11:22:02: ...   8%|▊         | 8/100 [00:00<00:00, 226.45 it/sec, obj=0.5]
   INFO - 11:22:02: ...   8%|▊         | 8/100 [00:00<00:00, 225.97 it/sec, obj=0.5]
   INFO - 11:22:02: Optimization result:
   INFO - 11:22:02:    Optimizer info:
   INFO - 11:22:02:       Status: None
   INFO - 11:22:02:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 11:22:02:       Number of calls to the objective function by the optimizer: 8
   INFO - 11:22:02:    Solution:
   INFO - 11:22:02:       The solution is feasible.
   INFO - 11:22:02:       Objective: 0.3805071026441499
   INFO - 11:22:02:       Standardized constraints:
   INFO - 11:22:02:          cstr_0 + offset = [-0.41404086 -0.37054477]
   INFO - 11:22:02:          cstr_1 + offset = [ -4.10330374 -10.67148731]
   INFO - 11:22:02:       +-------------------------------------------------------------------------------------------+
   INFO - 11:22:02:       |                                      Parameter space                                      |
   INFO - 11:22:02:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 11:22:02:       | name      | lower_bound |       value        | upper_bound | type  | Initial distribution |
   INFO - 11:22:02:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 11:22:02:       | x_local_0 |      0      |         1          |      1      | float |                      |
   INFO - 11:22:02:       | x_local_1 |      0      |         1          |      1      | float |                      |
   INFO - 11:22:02:       | x_shared  |      0      | 0.4316204495066337 |      1      | float |                      |
   INFO - 11:22:02:       | x_shared  |      0      | 0.5112660072459285 |      1      | float |                      |
   INFO - 11:22:02:       | x_shared  |      0      | 0.2050544622846011 |      1      | float |                      |
   INFO - 11:22:02:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 11:22:02: *** End MDOScenario execution (time: 0:00:00.457369) ***
   INFO - 11:22:04: Generating HTML XDSM file in : results/coupling/MDF_xdsm.html
   INFO - 11:22:06: Make the starting point feasible.
   INFO - 11:22:06:
   INFO - 11:22:06: *** Start MDOScenario execution ***
   INFO - 11:22:06: MDOScenario
   INFO - 11:22:06:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 11:22:06:    MDO formulation: MDF
   INFO - 11:22:06: Optimization problem:
   INFO - 11:22:06:    minimize obj(x_local_0, x_local_1, x_shared)
   INFO - 11:22:06:    with respect to x_local_0, x_local_1, x_shared
   INFO - 11:22:06:    subject to constraints:
   INFO - 11:22:06:       cstr_0(x_local_0, x_local_1, x_shared) <= [0.89887356 0.86633976]
   INFO - 11:22:06:       cstr_1(x_local_0, x_local_1, x_shared) <= [0.64342256 0.87330214]
   INFO - 11:22:06:    over the design space:
   INFO - 11:22:06:    |                               Parameter space                                |
   INFO - 11:22:06:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 11:22:06:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
   INFO - 11:22:06:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 11:22:06:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:06:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:06:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:06:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:06:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:06:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:06:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:06:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:06:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:06:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:06:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:06:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:06:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:06:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 11:22:06: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 11:22:06: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 11:22:06: ...   2%|▏         | 2/100 [00:00<00:00, 996.84 it/sec, obj=0.5]
   INFO - 11:22:06: ...   5%|▌         | 5/100 [00:00<00:00, 409.10 it/sec, obj=0.5]
   INFO - 11:22:07: ...   8%|▊         | 8/100 [00:00<00:00, 254.84 it/sec, obj=0.5]
   INFO - 11:22:07: ...  11%|█         | 11/100 [00:00<00:00, 184.21 it/sec, obj=0.5]
   INFO - 11:22:07: ...  14%|█▍        | 14/100 [00:00<00:00, 144.48 it/sec, obj=0.5]
   INFO - 11:22:07: ...  14%|█▍        | 14/100 [00:00<00:00, 144.27 it/sec, obj=0.5]
   INFO - 11:22:07: Optimization result:
   INFO - 11:22:07:    Optimizer info:
   INFO - 11:22:07:       Status: None
   INFO - 11:22:07:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 11:22:07:       Number of calls to the objective function by the optimizer: 14
   INFO - 11:22:07:    Solution:
   INFO - 11:22:07:       The solution is feasible.
   INFO - 11:22:07:       Objective: 0.1385357381285276
   INFO - 11:22:07:       Standardized constraints:
   INFO - 11:22:07:          cstr_0 + offset = [-0.23668859 -0.10569247]
   INFO - 11:22:07:          cstr_1 + offset = [-1.21308758 -0.34258749]
   INFO - 11:22:07:       +--------------------------------------------------------------------------------------------+
   INFO - 11:22:07:       |                                      Parameter space                                       |
   INFO - 11:22:07:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 11:22:07:       | name      | lower_bound |        value        | upper_bound | type  | Initial distribution |
   INFO - 11:22:07:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 11:22:07:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 11:22:07:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 11:22:07:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 11:22:07:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 11:22:07:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 11:22:07:       | x_local_1 |      0      |  0.9999999999999998 |      1      | float |                      |
   INFO - 11:22:07:       | x_local_1 |      0      |          1          |      1      | float |                      |
   INFO - 11:22:07:       | x_local_1 |      0      |          1          |      1      | float |                      |
   INFO - 11:22:07:       | x_local_1 |      0      |  0.9999999999999998 |      1      | float |                      |
   INFO - 11:22:07:       | x_local_1 |      0      |  0.9999999999999998 |      1      | float |                      |
   INFO - 11:22:07:       | x_shared  |      0      |  0.1458505152901145 |      1      | float |                      |
   INFO - 11:22:07:       | x_shared  |      0      |  0.1819162891601797 |      1      | float |                      |
   INFO - 11:22:07:       | x_shared  |      0      | 0.07257747464173495 |      1      | float |                      |
   INFO - 11:22:07:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 11:22:07: *** End MDOScenario execution (time: 0:00:00.713205) ***
   INFO - 11:22:09: Generating HTML XDSM file in : results/coupling/MDF_xdsm.html
   INFO - 11:22:11: Make the starting point feasible.
   INFO - 11:22:11:
   INFO - 11:22:11: *** Start MDOScenario execution ***
   INFO - 11:22:11: MDOScenario
   INFO - 11:22:11:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 11:22:11:    MDO formulation: MDF
   INFO - 11:22:11: Optimization problem:
   INFO - 11:22:11:    minimize obj(x_local_0, x_local_1, x_shared)
   INFO - 11:22:11:    with respect to x_local_0, x_local_1, x_shared
   INFO - 11:22:11:    subject to constraints:
   INFO - 11:22:11:       cstr_0(x_local_0, x_local_1, x_shared) <= [ -4.03014722 -18.07597002]
   INFO - 11:22:11:       cstr_1(x_local_0, x_local_1, x_shared) <= [-2.53275899  0.59384442]
   INFO - 11:22:11: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 11:22:11: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 11:22:11: ...   2%|▏         | 2/100 [00:00<00:00, 999.30 it/sec, obj=0.5]
   INFO - 11:22:11: ...   5%|▌         | 5/100 [00:00<00:00, 407.32 it/sec, obj=0.5]
   INFO - 11:22:11: ...   8%|▊         | 8/100 [00:00<00:00, 253.23 it/sec, obj=0.5]
   INFO - 11:22:11: ...  11%|█         | 11/100 [00:00<00:00, 183.50 it/sec, obj=0.5]
   INFO - 11:22:12: ...  14%|█▍        | 14/100 [00:00<00:00, 143.34 it/sec, obj=0.5]
   INFO - 11:22:12: ...  17%|█▋        | 17/100 [00:00<00:00, 117.83 it/sec, obj=0.5]
   INFO - 11:22:12: ...  19%|█▉        | 19/100 [00:00<00:00, 105.40 it/sec, obj=0.5]
   INFO - 11:22:12: ...  20%|██        | 20/100 [00:00<00:00, 100.05 it/sec, obj=0.5]
   INFO - 11:22:12: Optimization result:
   INFO - 11:22:12:    Optimizer info:
   INFO - 11:22:12:       Status: None
   INFO - 11:22:12:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 11:22:12:       Number of calls to the objective function by the optimizer: 20
   INFO - 11:22:12:    Solution:
   INFO - 11:22:12:       The solution is feasible.
   INFO - 11:22:12:       Objective: 0.08650593635886976
   INFO - 11:22:12:       Standardized constraints:
   INFO - 11:22:12:          cstr_0 + offset = [-8.43715914  0.        ]
   INFO - 11:22:12:          cstr_1 + offset = [-6.67439741e-01  4.44089210e-16]
   INFO - 11:22:12: *** End MDOScenario execution (time: 0:00:01.010823) ***
   INFO - 11:22:14: Generating HTML XDSM file in : results/coupling/MDF_xdsm.html
   INFO - 11:22:16: Make the starting point feasible.
   INFO - 11:22:16:
   INFO - 11:22:16: *** Start MDOScenario execution ***
   INFO - 11:22:16: MDOScenario
   INFO - 11:22:16:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 11:22:16:    MDO formulation: IDF
   INFO - 11:22:16: Optimization problem:
   INFO - 11:22:16:    minimize obj(x_shared, y_0, y_1)
   INFO - 11:22:16:    with respect to x_local_0, x_local_1, x_shared, y_0, y_1
   INFO - 11:22:16:    subject to constraints:
   INFO - 11:22:16:       cstr_0(x_shared, y_0, y_1) <= [0.88589544 0.88821903]
   INFO - 11:22:16:       cstr_1(x_shared, y_0, y_1) <= [-0.17585898 -1.56050583]
   INFO - 11:22:16:       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 - 11:22:16:       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 - 11:22:16:    over the design space:
   INFO - 11:22:16:    |                               Parameter space                                |
   INFO - 11:22:16:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 11:22:16:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
   INFO - 11:22:16:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 11:22:16:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:16:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:16:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:16:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:16:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:16:    | y_0       |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:16:    | y_0       |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:16:    | y_1       |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:16:    | y_1       |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:16:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 11:22:16: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 11:22:16: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 11:22:16: ...   8%|▊         | 8/100 [00:00<00:00, 2179.86 it/sec, obj=0.5]
   INFO - 11:22:16: Optimization result:
   INFO - 11:22:16:    Optimizer info:
   INFO - 11:22:16:       Status: None
   INFO - 11:22:16:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 11:22:16:       Number of calls to the objective function by the optimizer: 8
   INFO - 11:22:16:    Solution:
   INFO - 11:22:16:       The solution is feasible.
   INFO - 11:22:16:       Objective: 0.3805016326090851
   INFO - 11:22:16:       Standardized constraints:
   INFO - 11:22:16:          cstr_0 + offset = [-0.4105685  -0.36790752]
   INFO - 11:22:16:          cstr_1 + offset = [ -4.06820466 -10.60696021]
   INFO - 11:22:16:          y_0 = [-5.55111512e-17  5.55111512e-17]
   INFO - 11:22:16:          y_1 = [-1.66533454e-16  0.00000000e+00]
   INFO - 11:22:16:       +-------------------------------------------------------------------------------------------+
   INFO - 11:22:16:       |                                      Parameter space                                      |
   INFO - 11:22:16:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 11:22:16:       | name      | lower_bound |       value        | upper_bound | type  | Initial distribution |
   INFO - 11:22:16:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 11:22:16:       | x_local_0 |      0      |         1          |      1      | float |                      |
   INFO - 11:22:16:       | x_local_1 |      0      |         1          |      1      | float |                      |
   INFO - 11:22:16:       | x_shared  |      0      | 0.4349840014945803 |      1      | float |                      |
   INFO - 11:22:16:       | x_shared  |      0      | 0.5153341160240119 |      1      | float |                      |
   INFO - 11:22:16:       | x_shared  |      0      |  0.20620547934211  |      1      | float |                      |
   INFO - 11:22:16:       | y_0       |      0      | 0.4598177788198944 |      1      | float |                      |
   INFO - 11:22:16:       | y_0       |      0      | 0.4291325171427605 |      1      | float |                      |
   INFO - 11:22:16:       | y_1       |      0      | 0.4459772572294342 |      1      | float |                      |
   INFO - 11:22:16:       | y_1       |      0      | 0.5142525316178621 |      1      | float |                      |
   INFO - 11:22:16:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 11:22:16: *** End MDOScenario execution (time: 0:00:00.064824) ***
   INFO - 11:22:18: Generating HTML XDSM file in : results/coupling/IDF_xdsm.html
   INFO - 11:22:20: Make the starting point feasible.
   INFO - 11:22:20:
   INFO - 11:22:20: *** Start MDOScenario execution ***
   INFO - 11:22:20: MDOScenario
   INFO - 11:22:20:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 11:22:20:    MDO formulation: IDF
   INFO - 11:22:20: Optimization problem:
   INFO - 11:22:20:    minimize obj(x_shared, y_0, y_1)
   INFO - 11:22:20:    with respect to x_local_0, x_local_1, x_shared, y_0, y_1
   INFO - 11:22:20:    subject to constraints:
   INFO - 11:22:20:       cstr_0(x_shared, y_0, y_1) <= [0.89887356 0.86633976]
   INFO - 11:22:20:       cstr_1(x_shared, y_0, y_1) <= [-0.78288719  0.87330214]
   INFO - 11:22:20:       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 - 11:22:20:       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 - 11:22:20:    over the design space:
   INFO - 11:22:20:    |                               Parameter space                                |
   INFO - 11:22:20:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 11:22:20:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
   INFO - 11:22:20:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 11:22:20:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    | y_0       |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    | y_0       |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    | y_1       |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    | y_1       |      0      |  0.5  |      1      | float |                      |
   INFO - 11:22:20:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 11:22:20: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 11:22:20: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 11:22:21: ...  13%|█▎        | 13/100 [00:00<00:00, 1289.97 it/sec, obj=0.5]
   INFO - 11:22:21: Optimization result:
   INFO - 11:22:21:    Optimizer info:
   INFO - 11:22:21:       Status: None
   INFO - 11:22:21:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 11:22:21:       Number of calls to the objective function by the optimizer: 13
   INFO - 11:22:21:    Solution:
   INFO - 11:22:21:       The solution is feasible.
   INFO - 11:22:21:       Objective: 0.15383885100886432
   INFO - 11:22:21:       Standardized constraints:
   INFO - 11:22:21:          cstr_0 + offset = [-0.28367339 -0.13418614]
   INFO - 11:22:21:          cstr_1 + offset = [ 0.         -0.39931711]
   INFO - 11:22:21:          y_0 = [5.55111512e-17 1.66533454e-16]
   INFO - 11:22:21:          y_1 = [1.11022302e-16 1.11022302e-16]
   INFO - 11:22:21:       +--------------------------------------------------------------------------------------------+
   INFO - 11:22:21:       |                                      Parameter space                                       |
   INFO - 11:22:21:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 11:22:21:       | name      | lower_bound |        value        | upper_bound | type  | Initial distribution |
   INFO - 11:22:21:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 11:22:21:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 11:22:21:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 11:22:21:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 11:22:21:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 11:22:21:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 11:22:21:       | x_local_1 |      0      |          1          |      1      | float |                      |
   INFO - 11:22:21:       | x_local_1 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 11:22:21:       | x_local_1 |      0      |          1          |      1      | float |                      |
   INFO - 11:22:21:       | x_local_1 |      0      |  0.9858563292487739 |      1      | float |                      |
   INFO - 11:22:21:       | x_local_1 |      0      |  0.8952030605001723 |      1      | float |                      |
   INFO - 11:22:21:       | x_shared  |      0      | 0.03908896701511936 |      1      | float |                      |
   INFO - 11:22:21:       | x_shared  |      0      | 0.05509382017067609 |      1      | float |                      |
   INFO - 11:22:21:       | x_shared  |      0      | 0.03828687665187131 |      1      | float |                      |
   INFO - 11:22:21:       | y_0       |      0      |  0.3805135756043002 |      1      | float |                      |
   INFO - 11:22:21:       | y_0       |      0      |  0.2003934597112414 |      1      | float |                      |
   INFO - 11:22:21:       | y_1       |      0      |         0.5         |      1      | float |                      |
   INFO - 11:22:21:       | y_1       |      0      |  0.4151727380322101 |      1      | float |                      |
   INFO - 11:22:21:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 11:22:21: *** End MDOScenario execution (time: 0:00:00.100837) ***
   INFO - 11:22:23: Generating HTML XDSM file in : results/coupling/IDF_xdsm.html
   INFO - 11:22:25: Make the starting point feasible.
   INFO - 11:22:25:
   INFO - 11:22:25: *** Start MDOScenario execution ***
   INFO - 11:22:25: MDOScenario
   INFO - 11:22:25:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 11:22:25:    MDO formulation: IDF
   INFO - 11:22:25: Optimization problem:
   INFO - 11:22:25:    minimize obj(x_shared, y_0, y_1)
   INFO - 11:22:25:    with respect to x_local_0, x_local_1, x_shared, y_0, y_1
   INFO - 11:22:25:    subject to constraints:
   INFO - 11:22:25:       cstr_0(x_shared, y_0, y_1) <= [-24.15073611  -2.815194  ]
   INFO - 11:22:25:       cstr_1(x_shared, y_0, y_1) <= [-2.53275899  0.59384442]
   INFO - 11:22:25:       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 - 11:22:25:       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 - 11:22:25: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 11:22:25: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 11:22:25: ...  13%|█▎        | 13/100 [00:00<00:00, 956.53 it/sec, obj=0.5]
   INFO - 11:22:25: ...  21%|██        | 21/100 [00:00<00:00, 559.77 it/sec, obj=0.5]
   INFO - 11:22:25: Optimization result:
   INFO - 11:22:25:    Optimizer info:
   INFO - 11:22:25:       Status: None
   INFO - 11:22:25:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 11:22:25:       Number of calls to the objective function by the optimizer: 21
   INFO - 11:22:25:    Solution:
   INFO - 11:22:25:       The solution is feasible.
   INFO - 11:22:25:       Objective: 0.07837467586318368
   INFO - 11:22:25:       Standardized constraints:
   INFO - 11:22:25:          cstr_0 + offset = [ 0.         -3.92093323]
   INFO - 11:22:25:          cstr_1 + offset = [-3.95598136e-01 -1.11022302e-16]
   INFO - 11:22:25:          y_0 = [ 1.66533454e-16 -2.77555756e-17]
   INFO - 11:22:25:          y_1 = [ 0.00000000e+00 -4.16333634e-17]
   INFO - 11:22:25: *** End MDOScenario execution (time: 0:00:00.190599) ***
   INFO - 11:22:27: 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 38.331 seconds)

Gallery generated by Sphinx-Gallery