Generate N2 and XDSM diagrams from an Excel description of the MDO problem

from __future__ import annotations

from gemseo import configure_logger
from gemseo.utils.study_analyses.mdo_study_analysis import MDOStudyAnalysis

configure_logger()
<RootLogger root (INFO)>

Describe your MDO problem in an Excel file

../../_images/mdo_study.png

Visualize this study

study = MDOStudyAnalysis("mdo_study.xlsx")
INFO - 13:53:18: 2 disciplines detected
INFO - 13:53:18:    Discipline1
INFO - 13:53:18:       Inputs: a, b, c
INFO - 13:53:18:       Outputs: d, e, g
INFO - 13:53:18:    Discipline2
INFO - 13:53:18:       Inputs: d, g, x, z
INFO - 13:53:18:       Outputs: a, b, f
INFO - 13:53:18: 1 scenario detected
INFO - 13:53:18:    Scenario
INFO - 13:53:18:       Objectives: f
INFO - 13:53:18:       Disciplines: Discipline1, Discipline2
INFO - 13:53:18:       Constraints: g
INFO - 13:53:18:       Design variables: x
INFO - 13:53:18:       Formulation: MDF

Generate the N2 chart

study.generate_n2(save=False, show=True)
plot mdo study analysis

Generate the XDSM

study.generate_xdsm(".")
INFO - 13:53:18: Generated the following Scenario:
INFO - 13:53:18: MDOScenario
INFO - 13:53:18: Optimization problem:
INFO - 13:53:18:    minimize f(x)
INFO - 13:53:18:    with respect to x
INFO - 13:53:18:    subject to constraints:
INFO - 13:53:18:       g(x) == 0.0


../../_images/xdsm.png

Visualize this study from command line

We can create the same figures using command line inputs:

gemseo-study mdo_study.xlsx -o outputs -h 5 -w 5 -x -p

where gemseo-study is an executable provided by GEMSEO 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.

Total running time of the script: (0 minutes 0.338 seconds)

Gallery generated by Sphinx-Gallery