Simple disciplinary DOE example on the Sobieski SSBJ test case

from __future__ import annotations

from gemseo.api import configure_logger
from gemseo.api import create_discipline
from gemseo.api import create_scenario
from gemseo.problems.sobieski.core.problem import SobieskiProblem

configure_logger()
<RootLogger root (INFO)>

Instantiate the discipline

discipline = create_discipline("SobieskiMission")

Create the design space

design_space = SobieskiProblem().design_space
design_space.filter(["y_24", "y_34"])
<gemseo.algos.design_space.DesignSpace object at 0x7f3d292c4070>

Create the scenario

Build scenario which links the disciplines with the formulation and The DOE algorithm.

scenario = create_scenario(
    [discipline],
    formulation="DisciplinaryOpt",
    objective_name="y_4",
    design_space=design_space,
    maximize_objective=True,
    scenario_type="DOE",
)

Execute the scenario

Here we use a latin hypercube sampling algorithm with 30 samples.

scenario.execute({"n_samples": 30, "algo": "lhs"})
    INFO - 11:20:30:
    INFO - 11:20:30: *** Start DOEScenario execution ***
    INFO - 11:20:30: DOEScenario
    INFO - 11:20:30:    Disciplines: SobieskiMission
    INFO - 11:20:30:    MDO formulation: DisciplinaryOpt
    INFO - 11:20:30: Optimization problem:
    INFO - 11:20:30:    minimize -y_4(y_24, y_34)
    INFO - 11:20:30:    with respect to y_24, y_34
    INFO - 11:20:30:    over the design space:
    INFO - 11:20:30:    +------+-------------+------------+-------------+-------+
    INFO - 11:20:30:    | name | lower_bound |   value    | upper_bound | type  |
    INFO - 11:20:30:    +------+-------------+------------+-------------+-------+
    INFO - 11:20:30:    | y_24 |     0.44    | 4.15006276 |    11.13    | float |
    INFO - 11:20:30:    | y_34 |     0.44    | 1.10754577 |     1.98    | float |
    INFO - 11:20:30:    +------+-------------+------------+-------------+-------+
    INFO - 11:20:30: Solving optimization problem with algorithm lhs:
    INFO - 11:20:30: ...   0%|          | 0/30 [00:00<?, ?it]
    INFO - 11:20:30: ... 100%|██████████| 30/30 [00:00<00:00, 1854.90 it/sec, obj=-2.73e+3]
    INFO - 11:20:30: Optimization result:
    INFO - 11:20:30:    Optimizer info:
    INFO - 11:20:30:       Status: None
    INFO - 11:20:30:       Message: None
    INFO - 11:20:30:       Number of calls to the objective function by the optimizer: 30
    INFO - 11:20:30:    Solution:
    INFO - 11:20:30:       Objective: -2726.3660548732214
    INFO - 11:20:30:       Design space:
    INFO - 11:20:30:       +------+-------------+--------------------+-------------+-------+
    INFO - 11:20:30:       | name | lower_bound |       value        | upper_bound | type  |
    INFO - 11:20:30:       +------+-------------+--------------------+-------------+-------+
    INFO - 11:20:30:       | y_24 |     0.44    | 9.094543945649603  |    11.13    | float |
    INFO - 11:20:30:       | y_34 |     0.44    | 0.4769766573300308 |     1.98    | float |
    INFO - 11:20:30:       +------+-------------+--------------------+-------------+-------+
    INFO - 11:20:30: *** End DOEScenario execution (time: 0:00:00.025280) ***

{'eval_jac': False, 'algo': 'lhs', 'n_samples': 30}

Plot optimization history view

scenario.post_process("OptHistoryView", save=False, show=True)
  • Evolution of the optimization variables
  • Evolution of the objective value
  • Distance to the optimum
<gemseo.post.opt_history_view.OptHistoryView object at 0x7f3d0bebc7c0>

Plot parallel coordinates

scenario.post_process(
    "ScatterPlotMatrix",
    variable_names=["y_4", "y_24", "y_34"],
    save=False,
    show=True,
)
plot sobieski doe disc example
<gemseo.post.scatter_mat.ScatterPlotMatrix object at 0x7f3d0bebca00>

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

Gallery generated by Sphinx-Gallery