.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/study_prototyping/plot_study_prototyping.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_study_prototyping_plot_study_prototyping.py: Generate a N2 and XDSM from an Excel description of the MDO problem =================================================================== .. GENERATED FROM PYTHON SOURCE LINES 26-37 .. code-block:: default from __future__ import division, unicode_literals from os import mkdir from os.path import exists, join from gemseo.api import configure_logger from gemseo.utils.study_analysis import StudyAnalysis configure_logger() .. rst-class:: sphx-glr-script-out Out: .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 38-43 Describe your MDO problem in an Excel file ------------------------------------------ .. image:: /_images/study_prototyping_example/disciplines_spec.png .. GENERATED FROM PYTHON SOURCE LINES 45-47 Visualize this study -------------------- .. GENERATED FROM PYTHON SOURCE LINES 47-51 .. code-block:: default study = StudyAnalysis("disciplines_spec.xlsx") if not exists("outputs"): mkdir("outputs") .. rst-class:: sphx-glr-script-out Out: .. code-block:: none INFO - 09:22:27: Detected the following disciplines: ['Discipline1', 'Discipline2', 'Scenario'] INFO - 09:22:27: Parsing discipline Discipline1 INFO - 09:22:27: Inputs: ['a', 'b', 'c'] INFO - 09:22:27: Outputs: ['d', 'e', 'g'] INFO - 09:22:27: Parsing discipline Discipline2 INFO - 09:22:27: Inputs: ['z', 'x', 'd', 'g'] INFO - 09:22:27: Outputs: ['a', 'b', 'f'] INFO - 09:22:27: Detected scenario in sheet: Scenario INFO - 09:22:27: New scenario: Scenario INFO - 09:22:27: Objectives: ['f'] INFO - 09:22:27: Disciplines: ['Discipline1', 'Discipline2'] INFO - 09:22:27: Constraints: ['g'] INFO - 09:22:27: Design variables: ['b', 'x'] INFO - 09:22:27: Formulation: MDF .. GENERATED FROM PYTHON SOURCE LINES 52-54 Generate N2 chrt ^^^^^^^^^^^^^^^^^ .. GENERATED FROM PYTHON SOURCE LINES 54-56 .. code-block:: default study.generate_n2(file_path=join("outputs", "n2.png"), save=False, show=True) .. image:: /examples/study_prototyping/images/sphx_glr_plot_study_prototyping_001.png :alt: plot study prototyping :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 57-59 Generate XDSM ^^^^^^^^^^^^^ .. GENERATED FROM PYTHON SOURCE LINES 59-60 .. code-block:: default study.generate_xdsm("outputs") .. rst-class:: sphx-glr-script-out Out: .. code-block:: none INFO - 09:22:27: Generated the following Scenario: INFO - 09:22:27: MDOScenario INFO - 09:22:27: Optimization problem: INFO - 09:22:27: Minimize: f(x) INFO - 09:22:27: With respect to: x INFO - 09:22:27: Subject to constraints: INFO - 09:22:27: g(x) == 0.0 INFO - 09:22:27: Generating HTML XDSM file in : outputs/xdsm.html MDOScenario Disciplines: Discipline1 Discipline2 MDOFormulation: MDF Algorithm: None .. GENERATED FROM PYTHON SOURCE LINES 61-62 .. image:: /_images/study_prototyping_example/xdsm.png .. GENERATED FROM PYTHON SOURCE LINES 64-81 Visualize this study from command line -------------------------------------- We can create the same figures using command line inputs: .. code:: gemseo-study disciplines_spec.xlsx -o outputs -s '(5,5)' -x -l where: - :code:`gemseo-study` is an executable provided by |g|, - :code:`disciplines_spec.xlsx` is the Excel file path, - :code:`-o outputs` is the output directory, - :code:`-s '(5,5)'` is the size of the N2 chart, - :code:`-x` is an option to create of the XDSM, - :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.624 seconds) .. _sphx_glr_download_examples_study_prototyping_plot_study_prototyping.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: plot_study_prototyping.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_study_prototyping.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_