Note
Click here to download the full example code
Simple disciplinary DOE example on the Sobieski SSBJ test case¶
from __future__ import absolute_import, division, print_function, unicode_literals
from future import standard_library
from gemseo.api import configure_logger, create_discipline, create_scenario
from gemseo.problems.sobieski.core import SobieskiProblem
configure_logger()
standard_library.install_aliases()
Instantiate the discipline¶
discipline = create_discipline("SobieskiMission")
Create the design space¶
design_space = SobieskiProblem().read_design_space()
design_space.filter(["y_24", "y_34"])
Out:
<gemseo.algos.design_space.DesignSpace object at 0x7fc29dadf490>
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"})
Out:
{'eval_jac': False, 'algo': 'lhs', 'n_samples': 30}
Plot optimization history view¶
scenario.post_process("OptHistoryView", save=False, show=True)
Out:
/home/docs/checkouts/readthedocs.org/user_builds/gemseo/conda/3.0.3/lib/python3.8/site-packages/gemseo/post/opt_history_view.py:312: UserWarning: FixedFormatter should only be used together with FixedLocator
ax1.set_yticklabels(y_labels)
<gemseo.post.opt_history_view.OptHistoryView object at 0x7fc29dec5130>
Plot parallel coordinates¶
scenario.post_process(
"ScatterPlotMatrix", save=False, show=True, variables_list=["y_4", "y_24", "y_34"]
)
Out:
<gemseo.post.scatter_mat.ScatterPlotMatrix object at 0x7fc29e16a250>
Total running time of the script: ( 0 minutes 1.207 seconds)