Scalable problem of Tedford and Martins, 2010

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

Out:

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

Out:

SubModel_0
KeysView(Grammar name: SubModel_0_input, schema: {
  "$schema": "http://json-schema.org/schema#",
  "type": "object",
  "properties": {
    "x_local_0": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "x_shared": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "y_1": {
      "type": "array",
      "items": {
        "type": "number"
      }
    }
  },
  "required": [
    "x_local_0",
    "x_shared",
    "y_1"
  ]
})
KeysView(Grammar name: SubModel_0_output, schema: {
  "$schema": "http://json-schema.org/schema#",
  "type": "object",
  "properties": {
    "y_0": {
      "type": "array",
      "items": {
        "type": "number"
      }
    }
  },
  "required": [
    "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())

Out:

SubModel_1
KeysView(Grammar name: SubModel_1_input, schema: {
  "$schema": "http://json-schema.org/schema#",
  "type": "object",
  "properties": {
    "x_local_1": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "x_shared": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "y_0": {
      "type": "array",
      "items": {
        "type": "number"
      }
    }
  },
  "required": [
    "x_local_1",
    "x_shared",
    "y_0"
  ]
})
KeysView(Grammar name: SubModel_1_output, schema: {
  "$schema": "http://json-schema.org/schema#",
  "type": "object",
  "properties": {
    "y_1": {
      "type": "array",
      "items": {
        "type": "number"
      }
    }
  },
  "required": [
    "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())

Out:

MainModel
KeysView(Grammar name: MainModel_input, schema: {
  "$schema": "http://json-schema.org/schema#",
  "type": "object",
  "properties": {
    "x_shared": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "y_0": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "y_1": {
      "type": "array",
      "items": {
        "type": "number"
      }
    }
  },
  "required": [
    "x_shared",
    "y_0",
    "y_1"
  ]
})
KeysView(Grammar name: MainModel_output, schema: {
  "$schema": "http://json-schema.org/schema#",
  "type": "object",
  "properties": {
    "cstr_0": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "cstr_1": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "obj": {
      "type": "array",
      "items": {
        "type": "number"
      }
    }
  },
  "required": [
    "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)

Out:

<gemseo.problems.scalable.parametric.core.design_space.TMDesignSpace object at 0x7fdbe0a60910>
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())

Out:

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)

Out:

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", xdsm_pdf=False)
study.run_formulation("IDF", xdsm_pdf=False)
  • scalable tm
  • scalable tm

Out:

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

We can look at the result in the console:

print(study)

Out:

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.0021817759989062324 seconds
........ SubModel_0 = 147 calls / 8 linearizations / 0.014235965929401573 seconds
........ SubModel_1 = 139 calls / 8 linearizations / 0.0128868909960147 seconds
........ mda = 8 calls / 8 linearizations / 0.48482988299656427 seconds
........ mdo_chain = 8 calls / 0 linearizations / 0.11343992301408434 seconds
........ sub_mda = 8 calls / 0 linearizations / 0.10515520201442996 seconds
........ scenario = 1 calls / 0 linearizations / 0.5371053260023473 seconds
.... IDF
........ MainModel = 12 calls / 10 linearizations / 0.0025057530001504347 seconds
........ SubModel_0 = 11 calls / 9 linearizations / 0.001998121020733379 seconds
........ SubModel_1 = 11 calls / 9 linearizations / 0.0019471219784463756 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.08641172900388483 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()
../../_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)

Out:

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

Out:

   INFO - 10:04:09: Make the starting point feasible.
   INFO - 10:04:09:
   INFO - 10:04:09: *** Start MDOScenario execution ***
   INFO - 10:04:09: MDOScenario
   INFO - 10:04:09:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 10:04:09:    MDO formulation: MDF
   INFO - 10:04:09: Optimization problem:
   INFO - 10:04:09:    minimize obj(x_local_0, x_local_1, x_shared)
   INFO - 10:04:09:    with respect to x_local_0, x_local_1, x_shared
   INFO - 10:04:09:    subject to constraints:
   INFO - 10:04:09:       cstr_0(x_local_0, x_local_1, x_shared) <= [0.88589544 0.88821903]
   INFO - 10:04:09:       cstr_1(x_local_0, x_local_1, x_shared) <= [-0.17585898 -1.56050583]
   INFO - 10:04:09:    over the design space:
   INFO - 10:04:09:    |                               Parameter space                                |
   INFO - 10:04:09:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 10:04:09:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
   INFO - 10:04:09:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 10:04:09:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:09:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:09:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:09:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:09:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:09:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 10:04:09: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 10:04:09: ...   0%|          | 0/100 [00:00<?, ?it]
WARNING - 10:04:09: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.3486125443736518e-14 is still above the tolerance 1e-14.
   INFO - 10:04:09: ...   2%|▏         | 2/100 [00:00<00:00, 961.15 it/sec]
   INFO - 10:04:09: ...   4%|▍         | 4/100 [00:00<00:00, 471.74 it/sec]
WARNING - 10:04:09: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.0303264460093434e-14 is still above the tolerance 1e-14.
WARNING - 10:04:09: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.221308406312274e-14 is still above the tolerance 1e-14.
   INFO - 10:04:09: ...   6%|▌         | 6/100 [00:00<00:00, 311.03 it/sec]
WARNING - 10:04:09: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.0624260076854628e-14 is still above the tolerance 1e-14.
WARNING - 10:04:09: MDAGaussSeidel has reached its maximum number of iterations but the normed residual 1.1319239632249289e-14 is still above the tolerance 1e-14.
   INFO - 10:04:09: ...   8%|▊         | 8/100 [00:00<00:00, 231.89 it/sec]
   INFO - 10:04:09: ...   8%|▊         | 8/100 [00:00<00:00, 231.42 it/sec]
   INFO - 10:04:09: Optimization result:
   INFO - 10:04:09:    Optimizer info:
   INFO - 10:04:09:       Status: None
   INFO - 10:04:09:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 10:04:09:       Number of calls to the objective function by the optimizer: 8
   INFO - 10:04:09:    Solution:
   INFO - 10:04:09:       The solution is feasible.
   INFO - 10:04:09:       Objective: 0.3805071026441499
   INFO - 10:04:09:       Standardized constraints:
   INFO - 10:04:09:          cstr_0 + offset = [-0.41404086 -0.37054477]
   INFO - 10:04:09:          cstr_1 + offset = [ -4.10330374 -10.67148731]
   INFO - 10:04:09:       +-------------------------------------------------------------------------------------------+
   INFO - 10:04:09:       |                                      Parameter space                                      |
   INFO - 10:04:09:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 10:04:09:       | name      | lower_bound |       value        | upper_bound | type  | Initial distribution |
   INFO - 10:04:09:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 10:04:09:       | x_local_0 |      0      |         1          |      1      | float |                      |
   INFO - 10:04:09:       | x_local_1 |      0      |         1          |      1      | float |                      |
   INFO - 10:04:09:       | x_shared  |      0      | 0.4316204495066337 |      1      | float |                      |
   INFO - 10:04:09:       | x_shared  |      0      | 0.5112660072459285 |      1      | float |                      |
   INFO - 10:04:09:       | x_shared  |      0      | 0.2050544622846011 |      1      | float |                      |
   INFO - 10:04:09:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 10:04:09: *** End MDOScenario execution (time: 0:00:00.455016) ***
   INFO - 10:04:11: Generating HTML XDSM file in : results/coupling/MDF_xdsm.html
   INFO - 10:04:13: Make the starting point feasible.
   INFO - 10:04:13:
   INFO - 10:04:13: *** Start MDOScenario execution ***
   INFO - 10:04:13: MDOScenario
   INFO - 10:04:13:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 10:04:13:    MDO formulation: MDF
   INFO - 10:04:13: Optimization problem:
   INFO - 10:04:13:    minimize obj(x_local_0, x_local_1, x_shared)
   INFO - 10:04:13:    with respect to x_local_0, x_local_1, x_shared
   INFO - 10:04:13:    subject to constraints:
   INFO - 10:04:13:       cstr_0(x_local_0, x_local_1, x_shared) <= [0.89887356 0.86633976]
   INFO - 10:04:13:       cstr_1(x_local_0, x_local_1, x_shared) <= [0.64342256 0.87330214]
   INFO - 10:04:13:    over the design space:
   INFO - 10:04:13:    |                               Parameter space                                |
   INFO - 10:04:13:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 10:04:13:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
   INFO - 10:04:13:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 10:04:13:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:13:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:13:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:13:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:13:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:13:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:13:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:13:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:13:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:13:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:13:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:13:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:13:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:13:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 10:04:13: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 10:04:13: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 10:04:13: ...   3%|▎         | 3/100 [00:00<00:00, 703.83 it/sec]
   INFO - 10:04:13: ...   6%|▌         | 6/100 [00:00<00:00, 351.26 it/sec]
   INFO - 10:04:13: ...   9%|▉         | 9/100 [00:00<00:00, 232.50 it/sec]
   INFO - 10:04:14: ...  12%|█▏        | 12/100 [00:00<00:00, 174.13 it/sec]
   INFO - 10:04:14: ...  14%|█▍        | 14/100 [00:00<00:00, 149.14 it/sec]
   INFO - 10:04:14: Optimization result:
   INFO - 10:04:14:    Optimizer info:
   INFO - 10:04:14:       Status: None
   INFO - 10:04:14:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 10:04:14:       Number of calls to the objective function by the optimizer: 14
   INFO - 10:04:14:    Solution:
   INFO - 10:04:14:       The solution is feasible.
   INFO - 10:04:14:       Objective: 0.1385357381285276
   INFO - 10:04:14:       Standardized constraints:
   INFO - 10:04:14:          cstr_0 + offset = [-0.23668859 -0.10569247]
   INFO - 10:04:14:          cstr_1 + offset = [-1.21308758 -0.34258749]
   INFO - 10:04:14:       +--------------------------------------------------------------------------------------------+
   INFO - 10:04:14:       |                                      Parameter space                                       |
   INFO - 10:04:14:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 10:04:14:       | name      | lower_bound |        value        | upper_bound | type  | Initial distribution |
   INFO - 10:04:14:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 10:04:14:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 10:04:14:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 10:04:14:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 10:04:14:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 10:04:14:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 10:04:14:       | x_local_1 |      0      |  0.9999999999999998 |      1      | float |                      |
   INFO - 10:04:14:       | x_local_1 |      0      |          1          |      1      | float |                      |
   INFO - 10:04:14:       | x_local_1 |      0      |          1          |      1      | float |                      |
   INFO - 10:04:14:       | x_local_1 |      0      |  0.9999999999999998 |      1      | float |                      |
   INFO - 10:04:14:       | x_local_1 |      0      |  0.9999999999999998 |      1      | float |                      |
   INFO - 10:04:14:       | x_shared  |      0      |  0.1458505152901145 |      1      | float |                      |
   INFO - 10:04:14:       | x_shared  |      0      |  0.1819162891601797 |      1      | float |                      |
   INFO - 10:04:14:       | x_shared  |      0      | 0.07257747464173495 |      1      | float |                      |
   INFO - 10:04:14:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 10:04:14: *** End MDOScenario execution (time: 0:00:00.688485) ***
   INFO - 10:04:16: Generating HTML XDSM file in : results/coupling/MDF_xdsm.html
   INFO - 10:04:17: Make the starting point feasible.
   INFO - 10:04:17:
   INFO - 10:04:17: *** Start MDOScenario execution ***
   INFO - 10:04:17: MDOScenario
   INFO - 10:04:17:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 10:04:17:    MDO formulation: MDF
   INFO - 10:04:17: Optimization problem:
   INFO - 10:04:17:    minimize obj(x_local_0, x_local_1, x_shared)
   INFO - 10:04:17:    with respect to x_local_0, x_local_1, x_shared
   INFO - 10:04:17:    subject to constraints:
   INFO - 10:04:17:       cstr_0(x_local_0, x_local_1, x_shared) <= [ -4.03014722 -18.07597002]
   INFO - 10:04:17:       cstr_1(x_local_0, x_local_1, x_shared) <= [-2.53275899  0.59384442]
   INFO - 10:04:17: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 10:04:17: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 10:04:18: ...   3%|▎         | 3/100 [00:00<00:00, 714.88 it/sec]
   INFO - 10:04:18: ...   6%|▌         | 6/100 [00:00<00:00, 353.52 it/sec]
   INFO - 10:04:18: ...   9%|▉         | 9/100 [00:00<00:00, 234.76 it/sec]
   INFO - 10:04:18: ...  12%|█▏        | 12/100 [00:00<00:00, 175.27 it/sec]
   INFO - 10:04:18: ...  15%|█▌        | 15/100 [00:00<00:00, 139.76 it/sec]
   INFO - 10:04:18: ...  18%|█▊        | 18/100 [00:00<00:00, 116.32 it/sec]
   INFO - 10:04:18: ...  20%|██        | 20/100 [00:00<00:00, 104.35 it/sec]
   INFO - 10:04:18: Optimization result:
   INFO - 10:04:18:    Optimizer info:
   INFO - 10:04:18:       Status: None
   INFO - 10:04:18:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 10:04:18:       Number of calls to the objective function by the optimizer: 20
   INFO - 10:04:18:    Solution:
   INFO - 10:04:18:       The solution is feasible.
   INFO - 10:04:18:       Objective: 0.08650593635886976
   INFO - 10:04:18:       Standardized constraints:
   INFO - 10:04:18:          cstr_0 + offset = [-8.43715914  0.        ]
   INFO - 10:04:18:          cstr_1 + offset = [-6.67439741e-01  4.44089210e-16]
   INFO - 10:04:18: *** End MDOScenario execution (time: 0:00:00.966829) ***
   INFO - 10:04:20: Generating HTML XDSM file in : results/coupling/MDF_xdsm.html
   INFO - 10:04:23: Make the starting point feasible.
   INFO - 10:04:23:
   INFO - 10:04:23: *** Start MDOScenario execution ***
   INFO - 10:04:23: MDOScenario
   INFO - 10:04:23:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 10:04:23:    MDO formulation: IDF
   INFO - 10:04:23: Optimization problem:
   INFO - 10:04:23:    minimize obj(x_shared, y_0, y_1)
   INFO - 10:04:23:    with respect to x_local_0, x_local_1, x_shared, y_0, y_1
   INFO - 10:04:23:    subject to constraints:
   INFO - 10:04:23:       cstr_0(x_shared, y_0, y_1) <= [0.88589544 0.88821903]
   INFO - 10:04:23:       cstr_1(x_shared, y_0, y_1) <= [-0.17585898 -1.56050583]
   INFO - 10:04:23:       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 - 10:04:23:       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 - 10:04:23:    over the design space:
   INFO - 10:04:23:    |                               Parameter space                                |
   INFO - 10:04:23:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 10:04:23:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
   INFO - 10:04:23:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 10:04:23:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:23:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:23:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:23:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:23:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:23:    | y_0       |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:23:    | y_0       |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:23:    | y_1       |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:23:    | y_1       |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:23:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 10:04:23: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 10:04:23: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 10:04:23: ...   8%|▊         | 8/100 [00:00<00:00, 2081.23 it/sec]
   INFO - 10:04:23: Optimization result:
   INFO - 10:04:23:    Optimizer info:
   INFO - 10:04:23:       Status: None
   INFO - 10:04:23:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 10:04:23:       Number of calls to the objective function by the optimizer: 8
   INFO - 10:04:23:    Solution:
   INFO - 10:04:23:       The solution is feasible.
   INFO - 10:04:23:       Objective: 0.3805016326090851
   INFO - 10:04:23:       Standardized constraints:
   INFO - 10:04:23:          cstr_0 + offset = [-0.4105685  -0.36790752]
   INFO - 10:04:23:          cstr_1 + offset = [ -4.06820466 -10.60696021]
   INFO - 10:04:23:          y_0 = [-5.55111512e-17  5.55111512e-17]
   INFO - 10:04:23:          y_1 = [-1.66533454e-16  0.00000000e+00]
   INFO - 10:04:23:       +-------------------------------------------------------------------------------------------+
   INFO - 10:04:23:       |                                      Parameter space                                      |
   INFO - 10:04:23:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 10:04:23:       | name      | lower_bound |       value        | upper_bound | type  | Initial distribution |
   INFO - 10:04:23:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 10:04:23:       | x_local_0 |      0      |         1          |      1      | float |                      |
   INFO - 10:04:23:       | x_local_1 |      0      |         1          |      1      | float |                      |
   INFO - 10:04:23:       | x_shared  |      0      | 0.4349840014945803 |      1      | float |                      |
   INFO - 10:04:23:       | x_shared  |      0      | 0.5153341160240119 |      1      | float |                      |
   INFO - 10:04:23:       | x_shared  |      0      |  0.20620547934211  |      1      | float |                      |
   INFO - 10:04:23:       | y_0       |      0      | 0.4598177788198944 |      1      | float |                      |
   INFO - 10:04:23:       | y_0       |      0      | 0.4291325171427605 |      1      | float |                      |
   INFO - 10:04:23:       | y_1       |      0      | 0.4459772572294342 |      1      | float |                      |
   INFO - 10:04:23:       | y_1       |      0      | 0.5142525316178621 |      1      | float |                      |
   INFO - 10:04:23:       +-----------+-------------+--------------------+-------------+-------+----------------------+
   INFO - 10:04:23: *** End MDOScenario execution (time: 0:00:00.063931) ***
   INFO - 10:04:24: Generating HTML XDSM file in : results/coupling/IDF_xdsm.html
   INFO - 10:04:27: Make the starting point feasible.
   INFO - 10:04:27:
   INFO - 10:04:27: *** Start MDOScenario execution ***
   INFO - 10:04:27: MDOScenario
   INFO - 10:04:27:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 10:04:27:    MDO formulation: IDF
   INFO - 10:04:27: Optimization problem:
   INFO - 10:04:27:    minimize obj(x_shared, y_0, y_1)
   INFO - 10:04:27:    with respect to x_local_0, x_local_1, x_shared, y_0, y_1
   INFO - 10:04:27:    subject to constraints:
   INFO - 10:04:27:       cstr_0(x_shared, y_0, y_1) <= [0.89887356 0.86633976]
   INFO - 10:04:27:       cstr_1(x_shared, y_0, y_1) <= [-0.78288719  0.87330214]
   INFO - 10:04:27:       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 - 10:04:27:       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 - 10:04:27:    over the design space:
   INFO - 10:04:27:    |                               Parameter space                                |
   INFO - 10:04:27:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 10:04:27:    | name      | lower_bound | value | upper_bound | type  | Initial distribution |
   INFO - 10:04:27:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 10:04:27:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    | x_local_0 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    | x_local_1 |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    | x_shared  |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    | y_0       |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    | y_0       |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    | y_1       |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    | y_1       |      0      |  0.5  |      1      | float |                      |
   INFO - 10:04:27:    +-----------+-------------+-------+-------------+-------+----------------------+
   INFO - 10:04:27: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 10:04:27: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 10:04:27: ...  13%|█▎        | 13/100 [00:00<00:00, 1203.71 it/sec]
   INFO - 10:04:27: Optimization result:
   INFO - 10:04:27:    Optimizer info:
   INFO - 10:04:27:       Status: None
   INFO - 10:04:27:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 10:04:27:       Number of calls to the objective function by the optimizer: 13
   INFO - 10:04:27:    Solution:
   INFO - 10:04:27:       The solution is feasible.
   INFO - 10:04:27:       Objective: 0.15383885100886432
   INFO - 10:04:27:       Standardized constraints:
   INFO - 10:04:27:          cstr_0 + offset = [-0.28367339 -0.13418614]
   INFO - 10:04:27:          cstr_1 + offset = [ 0.         -0.39931711]
   INFO - 10:04:27:          y_0 = [5.55111512e-17 1.66533454e-16]
   INFO - 10:04:27:          y_1 = [1.11022302e-16 1.11022302e-16]
   INFO - 10:04:27:       +--------------------------------------------------------------------------------------------+
   INFO - 10:04:27:       |                                      Parameter space                                       |
   INFO - 10:04:27:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 10:04:27:       | name      | lower_bound |        value        | upper_bound | type  | Initial distribution |
   INFO - 10:04:27:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 10:04:27:       | x_local_0 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 10:04:27:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 10:04:27:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 10:04:27:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 10:04:27:       | x_local_0 |      0      |          1          |      1      | float |                      |
   INFO - 10:04:27:       | x_local_1 |      0      |          1          |      1      | float |                      |
   INFO - 10:04:27:       | x_local_1 |      0      |  0.9999999999999999 |      1      | float |                      |
   INFO - 10:04:27:       | x_local_1 |      0      |          1          |      1      | float |                      |
   INFO - 10:04:27:       | x_local_1 |      0      |  0.9858563292487739 |      1      | float |                      |
   INFO - 10:04:27:       | x_local_1 |      0      |  0.8952030605001723 |      1      | float |                      |
   INFO - 10:04:27:       | x_shared  |      0      | 0.03908896701511936 |      1      | float |                      |
   INFO - 10:04:27:       | x_shared  |      0      | 0.05509382017067609 |      1      | float |                      |
   INFO - 10:04:27:       | x_shared  |      0      | 0.03828687665187131 |      1      | float |                      |
   INFO - 10:04:27:       | y_0       |      0      |  0.3805135756043002 |      1      | float |                      |
   INFO - 10:04:27:       | y_0       |      0      |  0.2003934597112414 |      1      | float |                      |
   INFO - 10:04:27:       | y_1       |      0      |         0.5         |      1      | float |                      |
   INFO - 10:04:27:       | y_1       |      0      |  0.4151727380322101 |      1      | float |                      |
   INFO - 10:04:27:       +-----------+-------------+---------------------+-------------+-------+----------------------+
   INFO - 10:04:27: *** End MDOScenario execution (time: 0:00:00.104657) ***
   INFO - 10:04:29: Generating HTML XDSM file in : results/coupling/IDF_xdsm.html
   INFO - 10:04:31: Make the starting point feasible.
   INFO - 10:04:31:
   INFO - 10:04:31: *** Start MDOScenario execution ***
   INFO - 10:04:31: MDOScenario
   INFO - 10:04:31:    Disciplines: MainModel SubModel_0 SubModel_1
   INFO - 10:04:31:    MDO formulation: IDF
   INFO - 10:04:31: Optimization problem:
   INFO - 10:04:31:    minimize obj(x_shared, y_0, y_1)
   INFO - 10:04:31:    with respect to x_local_0, x_local_1, x_shared, y_0, y_1
   INFO - 10:04:31:    subject to constraints:
   INFO - 10:04:31:       cstr_0(x_shared, y_0, y_1) <= [-24.15073611  -2.815194  ]
   INFO - 10:04:31:       cstr_1(x_shared, y_0, y_1) <= [-2.53275899  0.59384442]
   INFO - 10:04:31:       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 - 10:04:31:       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 - 10:04:31: Solving optimization problem with algorithm NLOPT_SLSQP:
   INFO - 10:04:31: ...   0%|          | 0/100 [00:00<?, ?it]
   INFO - 10:04:31: ...  13%|█▎        | 13/100 [00:00<00:00, 918.81 it/sec]
   INFO - 10:04:31: ...  21%|██        | 21/100 [00:00<00:00, 534.99 it/sec]
   INFO - 10:04:31: Optimization result:
   INFO - 10:04:31:    Optimizer info:
   INFO - 10:04:31:       Status: None
   INFO - 10:04:31:       Message: Successive iterates of the objective function are closer than ftol_rel or ftol_abs. GEMSEO Stopped the driver
   INFO - 10:04:31:       Number of calls to the objective function by the optimizer: 21
   INFO - 10:04:31:    Solution:
   INFO - 10:04:31:       The solution is feasible.
   INFO - 10:04:31:       Objective: 0.07837467586318368
   INFO - 10:04:31:       Standardized constraints:
   INFO - 10:04:31:          cstr_0 + offset = [ 0.         -3.92093323]
   INFO - 10:04:31:          cstr_1 + offset = [-3.95598136e-01 -1.11022302e-16]
   INFO - 10:04:31:          y_0 = [ 1.66533454e-16 -2.77555756e-17]
   INFO - 10:04:31:          y_1 = [ 0.00000000e+00 -4.16333634e-17]
   INFO - 10:04:31: *** End MDOScenario execution (time: 0:00:00.196499) ***
   INFO - 10:04:33: 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 36.712 seconds)

Gallery generated by Sphinx-Gallery