.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/scalable/scalable_param_umdf.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_scalable_scalable_param_umdf.py: Parametric scalable MDO problem - MDF ===================================== 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. We would like to solve this MDO problem by means of an MDF formulation. .. GENERATED FROM PYTHON SOURCE LINES 38-46 .. code-block:: default from __future__ import division, unicode_literals from gemseo.api import configure_logger, generate_n2_plot from gemseo.problems.scalable.parametric.problem import TMScalableProblem from gemseo.uncertainty.umdo.umdo_scenario import UMDOScenario configure_logger() .. GENERATED FROM PYTHON SOURCE LINES 47-49 Instantiation of the scalable problem ------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 49-54 .. code-block:: default n_shared = 3 n_local = [2, 4] n_coupling = [2, 3] problem = TMScalableProblem(n_shared, n_local, n_coupling, noised_coupling=True) .. GENERATED FROM PYTHON SOURCE LINES 55-57 Display the coupling structure ------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 57-59 .. code-block:: default generate_n2_plot(problem.disciplines, save=False, show=True) .. GENERATED FROM PYTHON SOURCE LINES 60-62 Solve the U-MDO using an MDF formulation ---------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 62-70 .. code-block:: default sampling_options = {"algo": "OT_MONTE_CARLO", "n_samples": 100} scenario = UMDOScenario( problem.disciplines, "UMDF", "obj", problem.design_space, sampling_options=sampling_options, ) .. GENERATED FROM PYTHON SOURCE LINES 71-72 We set the robustness measures for the objective and the constraints. .. GENERATED FROM PYTHON SOURCE LINES 72-78 .. code-block:: default scenario.set_robustness_measure("obj", "mean") scenario.set_robustness_measure("cstr_0", "mean_std", std_factor=3.0) scenario.set_robustness_measure("cstr_1", "mean_std", std_factor=3.0) scenario.add_constraint("cstr_0", "ineq", "p_cstr_0", value=0.0) scenario.add_constraint("cstr_1", "ineq", "p_cstr_1", value=0.0) .. GENERATED FROM PYTHON SOURCE LINES 79-80 Display XDSM .. GENERATED FROM PYTHON SOURCE LINES 80-82 .. code-block:: default scenario.xdsmize(latex_output=True) .. GENERATED FROM PYTHON SOURCE LINES 83-84 Execute .. GENERATED FROM PYTHON SOURCE LINES 84-86 .. code-block:: default scenario.execute({"algo": "NLOPT_COBYLA", "max_iter": 100, "xtol_abs": 1e-3}) .. GENERATED FROM PYTHON SOURCE LINES 87-89 Post-process the results ------------------------ .. GENERATED FROM PYTHON SOURCE LINES 89-90 .. code-block:: default scenario.post_process("OptHistoryView", save=False, show=True) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_examples_scalable_scalable_param_umdf.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: scalable_param_umdf.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: scalable_param_umdf.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_