.. 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-33 .. code-block:: Python 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 34-39 Describe your MDO problem in an Excel file ------------------------------------------ .. image:: /_images/study_analysis_example/mdo_study.png .. GENERATED FROM PYTHON SOURCE LINES 41-43 Visualize this study -------------------- .. GENERATED FROM PYTHON SOURCE LINES 43-45 .. code-block:: Python study = MDOStudyAnalysis("mdo_study.xlsx") .. rst-class:: sphx-glr-script-out .. code-block:: none INFO - 20:38:28: 2 disciplines detected INFO - 20:38:28: Discipline1 INFO - 20:38:28: Inputs: a, b, c INFO - 20:38:28: Outputs: d, e, g INFO - 20:38:28: Discipline2 INFO - 20:38:28: Inputs: d, g, x, z INFO - 20:38:28: Outputs: a, b, f INFO - 20:38:28: 1 scenario detected INFO - 20:38:28: Scenario INFO - 20:38:28: Objectives: f INFO - 20:38:28: Disciplines: Discipline1, Discipline2 INFO - 20:38:28: Constraints: g INFO - 20:38:28: Design variables: x INFO - 20:38:28: Formulation: MDF .. GENERATED FROM PYTHON SOURCE LINES 46-48 Generate the N2 chart ^^^^^^^^^^^^^^^^^^^^^ .. GENERATED FROM PYTHON SOURCE LINES 48-50 .. code-block:: Python 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 51-53 Generate the XDSM ^^^^^^^^^^^^^^^^^ .. GENERATED FROM PYTHON SOURCE LINES 53-54 .. code-block:: Python study.generate_xdsm(".") .. rst-class:: sphx-glr-script-out .. code-block:: none INFO - 20:38:28: Generated the following Scenario: INFO - 20:38:28: MDOScenario INFO - 20:38:28: Optimization problem: INFO - 20:38:28: minimize f(x) INFO - 20:38:28: with respect to x INFO - 20:38:28: under the equality constraints INFO - 20:38:28: g(x) = 0 .. raw:: html


.. GENERATED FROM PYTHON SOURCE LINES 55-56 .. image:: /_images/study_analysis_example/xdsm.png .. GENERATED FROM PYTHON SOURCE LINES 58-77 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 -p 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``: - ``-o outputs`` is the output directory, - ``-h 5`` is the height of the N2 chart in inches, - ``-w 5`` is the width of the N2 chart in inches, - ``-x`` is an option to create of the XDSM (compatible only with the study type 'mdo'), - ``-p`` 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.165 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-jupyter :download:`Download Jupyter notebook: plot_mdo_study_analysis.ipynb ` .. 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-zip :download:`Download zipped: plot_mdo_study_analysis.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_