.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/02_visualization/plot_06_operability_plane.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 or to run this example in your browser via Binder. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_02_visualization_plot_06_operability_plane.py: The operability plane ===================== Placing every state at the point :math:`(\rho^C_i,\rho^O_i)`, its control and its observation depth, gives a compact picture of a whole input--output configuration. The sum :math:`\rho^C_i+\rho^O_i` is the length of the shortest input-to-output path through the state (dotted level lines); the largest coordinates are the relative orders of the input and output configurations; states in the upper right corner are slow both to steer and to see. Marginal bars count the states at every depth. .. GENERATED FROM PYTHON SOURCE LINES 14-16 Heat exchanger network: minimal configuration --------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 16-29 .. code-block:: Python import nocad from nocad.datasets import make_hen_case_study from nocad.placement import Placement from nocad.viz import plot_operability_plane hen = make_hen_case_study() design = nocad.InputOutputDesign().fit(hen.adj) # [snippet:plane] axes = plot_operability_plane(hen.adj, design.driver_nodes_, design.sensor_nodes_, labels=hen.labels) # [/snippet:plane] axes["top"].set_title(f"minimal design: {design.n_drivers_} driver, {design.n_sensors_} sensor nodes", fontsize=10) .. image-sg:: /auto_examples/02_visualization/images/sphx_glr_plot_06_operability_plane_001.png :alt: minimal design: 1 driver, 3 sensor nodes :srcset: /auto_examples/02_visualization/images/sphx_glr_plot_06_operability_plane_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Text(0.5, 1.0, 'minimal design: 1 driver, 3 sensor nodes') .. GENERATED FROM PYTHON SOURCE LINES 30-34 Parameter study: improved configurations ---------------------------------------- Adding drivers and sensors with GDFCMSA until the relative order is at most 2 moves the cloud toward the origin; the dashed lines mark the bound. .. GENERATED FROM PYTHON SOURCE LINES 34-41 .. code-block:: Python drv = Placement(kind="drivers", method="gdfcmsa", r_max=2, n_iter=300, n_runs=4, random_state=0).fit(hen.adj) sen = Placement(kind="sensors", method="gdfcmsa", r_max=2, n_iter=300, n_runs=4, random_state=0).fit(hen.adj) print("drivers:", [hen.labels[v] for v in drv.nodes_]) print("sensors:", [hen.labels[v] for v in sen.nodes_]) axes = plot_operability_plane(hen.adj, drv.nodes_, sen.nodes_, labels=hen.labels, r_max=2) axes["top"].set_title(f"improved: {drv.nodes_.size} drivers, {sen.nodes_.size} sensors (bound 2)", fontsize=10) .. image-sg:: /auto_examples/02_visualization/images/sphx_glr_plot_06_operability_plane_002.png :alt: improved: 6 drivers, 7 sensors (bound 2) :srcset: /auto_examples/02_visualization/images/sphx_glr_plot_06_operability_plane_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none drivers: ['E2.c', 'E3.h', 'E4.h', 'E6.h', 'E8.c', 'E9.h'] sensors: ['E1.h', 'E2.h', 'E4.c', 'E5.c', 'E10.h', 'C1', 'C2'] Text(0.5, 1.0, 'improved: 6 drivers, 7 sensors (bound 2)') .. GENERATED FROM PYTHON SOURCE LINES 42-46 **Take-away.** The operability plane condenses a configuration into one scatter plot: its corners show the worst states, its marginals the distribution of the relative orders, and moving nodes between configurations shows the trade-off between the number of inputs and outputs and how fast the system can be steered and seen. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.450 seconds) .. _sphx_glr_download_auto_examples_02_visualization_plot_06_operability_plane.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/ComplexSystemsIntelligence/nocad/main?urlpath=lab/tree/notebooks/auto_examples/02_visualization/plot_06_operability_plane.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_06_operability_plane.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_06_operability_plane.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_06_operability_plane.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_