.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/study_analysis/plot_mdo_study_analysis.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_study_analysis_plot_mdo_study_analysis.py: Generate N2 and XDSM diagrams from an Excel description of the MDO problem ========================================================================== .. GENERATED FROM PYTHON SOURCE LINES 24-32 .. code-block:: default from __future__ import annotations from gemseo import configure_logger from gemseo.utils.study_analyses.mdo_study_analysis import MDOStudyAnalysis configure_logger() .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 33-38 Describe your MDO problem in an Excel file ------------------------------------------ .. image:: /_images/study_analysis_example/mdo_study.png .. GENERATED FROM PYTHON SOURCE LINES 40-42 Visualize this study -------------------- .. GENERATED FROM PYTHON SOURCE LINES 42-44 .. code-block:: default study = MDOStudyAnalysis("mdo_study.xlsx") .. rst-class:: sphx-glr-script-out .. code-block:: none INFO - 16:29:31: 2 disciplines detected INFO - 16:29:31: Discipline1 INFO - 16:29:31: Inputs: a, b, c INFO - 16:29:31: Outputs: d, e, g INFO - 16:29:31: Discipline2 INFO - 16:29:31: Inputs: d, g, x, z INFO - 16:29:31: Outputs: a, b, f INFO - 16:29:31: 1 scenario detected INFO - 16:29:31: Scenario INFO - 16:29:31: Objectives: f INFO - 16:29:31: Disciplines: Discipline1, Discipline2 INFO - 16:29:31: Constraints: g INFO - 16:29:31: Design variables: x INFO - 16:29:31: Formulation: MDF .. GENERATED FROM PYTHON SOURCE LINES 45-47 Generate the N2 chart ^^^^^^^^^^^^^^^^^^^^^ .. GENERATED FROM PYTHON SOURCE LINES 47-49 .. code-block:: default study.generate_n2(save=False, show=True) .. image-sg:: /examples/study_analysis/images/sphx_glr_plot_mdo_study_analysis_001.png :alt: plot mdo study analysis :srcset: /examples/study_analysis/images/sphx_glr_plot_mdo_study_analysis_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 50-52 Generate the XDSM ^^^^^^^^^^^^^^^^^ .. GENERATED FROM PYTHON SOURCE LINES 52-53 .. code-block:: default study.generate_xdsm(".") .. rst-class:: sphx-glr-script-out .. code-block:: none INFO - 16:29:31: Generated the following Scenario: INFO - 16:29:31: MDOScenario INFO - 16:29:31: Optimization problem: INFO - 16:29:31: minimize f(x) INFO - 16:29:31: with respect to x INFO - 16:29:31: subject to constraints: INFO - 16:29:31: g(x) == 0.0 .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 54-55 .. image:: /_images/study_analysis_example/xdsm.png .. GENERATED FROM PYTHON SOURCE LINES 57-76 Visualize this study from command line -------------------------------------- We can create the same figures using command line inputs: .. code:: gemseo-study mdo_study.xlsx -o outputs -h 5 -w 5 -x -l where ``gemseo-study`` is an executable provided by |g| and the Excel file path ``mdo_study.xlsx`` is the specification of the MDO study. Here, we set some options of ``gemseo-study``: - :code:`-o outputs` is the output directory, - :code:`-h 5` is the height of the N2 chart in inches, - :code:`-w 5` is the width of the N2 chart in inches, - :code:`-x` is an option to create of the XDSM (compatible only with the study type 'mdo'), - :code:`-l` is an option to create a PDF file with the creation of the XDSM. .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.345 seconds) .. _sphx_glr_download_examples_study_analysis_plot_mdo_study_analysis.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_mdo_study_analysis.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_mdo_study_analysis.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_