.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/03_roles_robustness/plot_02_control_profiles.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_03_roles_robustness_plot_02_control_profiles.py: Control profiles of real and model networks =========================================== Ruths and Ruths (2014) explained the driver nodes by three structures: source nodes, external dilations (a surplus of sinks over sources) and internal dilations. The control profile :math:`(\eta_s,\eta_e,\eta_i)` gives their shares and places a network in a triangle. The bundled networks of the NOCAD study fall into different corners. The state matrices of the dynamical systems of Set III shown here have a perfect matching and no source or sink nodes (their diagonals are non-zero); their single driver node counts as an internal dilation by the convention :math:`N_D=\max(N-|\mathcal{M}|,1)`, so they all sit in the internal-dilation corner. .. GENERATED FROM PYTHON SOURCE LINES 16-18 The bundled networks -------------------- .. GENERATED FROM PYTHON SOURCE LINES 18-36 .. code-block:: Python import matplotlib.pyplot as plt import nocad from nocad.datasets import list_networks, load_network, make_random_network from nocad.viz import plot_control_profiles # [snippet:profiles] profiles, groups = {}, {} for name in list_networks("I") + list_networks("II") + ["build", "cdplayer", "heatcont", "iss", "pde", "tline"]: net = load_network(name) profiles[name] = nocad.control_profile(net.adj) groups[name] = f"Set {net.group}" # [/snippet:profiles] for name, p in profiles.items(): print(f"{name:10s} N_D={p['n_d']:4d} eta_s={p['eta_s']:.2f} eta_e={p['eta_e']:.2f} eta_i={p['eta_i']:.2f}") fig, ax = plt.subplots(figsize=(5.6, 4.8)) plot_control_profiles(profiles, groups, ax=ax, title="control profiles of the bundled networks") .. image-sg:: /auto_examples/03_roles_robustness/images/sphx_glr_plot_02_control_profiles_001.png :alt: control profiles of the bundled networks :srcset: /auto_examples/03_roles_robustness/images/sphx_glr_plot_02_control_profiles_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none celegans N_D= 49 eta_s=0.55 eta_e=0.00 eta_i=0.45 ecoli N_D= 314 eta_s=0.99 eta_e=0.00 eta_i=0.01 mac71 N_D= 1 eta_s=1.00 eta_e=0.00 eta_i=0.00 mac95 N_D= 9 eta_s=1.00 eta_e=0.00 eta_i=0.00 s208 N_D= 29 eta_s=0.34 eta_e=0.00 eta_i=0.66 s420 N_D= 59 eta_s=0.31 eta_e=0.00 eta_i=0.69 s838 N_D= 119 eta_s=0.29 eta_e=0.00 eta_i=0.71 yeast N_D= 565 eta_s=0.17 eta_e=0.82 eta_i=0.01 dolphins N_D= 19 eta_s=0.79 eta_e=0.00 eta_i=0.21 freeman2 N_D= 1 eta_s=0.00 eta_e=0.00 eta_i=1.00 grass N_D= 46 eta_s=0.02 eta_e=0.74 eta_i=0.24 ythan N_D= 69 eta_s=0.01 eta_e=0.74 eta_i=0.25 build N_D= 1 eta_s=0.00 eta_e=0.00 eta_i=1.00 cdplayer N_D= 1 eta_s=0.00 eta_e=0.00 eta_i=1.00 heatcont N_D= 1 eta_s=0.00 eta_e=0.00 eta_i=1.00 iss N_D= 1 eta_s=0.00 eta_e=0.00 eta_i=1.00 pde N_D= 1 eta_s=0.00 eta_e=0.00 eta_i=1.00 tline N_D= 1 eta_s=0.00 eta_e=0.00 eta_i=1.00 .. GENERATED FROM PYTHON SOURCE LINES 37-42 Parameter study: random models ------------------------------ Erdős--Rényi and scale-free networks of increasing density move from the source-dominated corner toward the internal dilations, as the number of nodes without incoming or outgoing edges falls. .. GENERATED FROM PYTHON SOURCE LINES 42-52 .. code-block:: Python prof, grp = {}, {} for kind in ("erdos_renyi", "scale_free"): for k in (0.8, 1.5, 3.0, 6.0): net = make_random_network(300, k, kind=kind, random_state=1).adj key = f"{'ER' if kind == 'erdos_renyi' else 'SF'} {k}" prof[key] = nocad.control_profile(net) grp[key] = kind.replace("_", "-") fig, ax = plt.subplots(figsize=(5.6, 4.8)) plot_control_profiles(prof, grp, ax=ax, title="random networks: label = mean degree") .. image-sg:: /auto_examples/03_roles_robustness/images/sphx_glr_plot_02_control_profiles_002.png :alt: random networks: label = mean degree :srcset: /auto_examples/03_roles_robustness/images/sphx_glr_plot_02_control_profiles_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 53-56 **Take-away.** The control profile tells why a network needs its inputs: because of nodes nobody influences, because of surplus end points, or because of internal bottlenecks; each calls for a different remedy. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.316 seconds) .. _sphx_glr_download_auto_examples_03_roles_robustness_plot_02_control_profiles.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/03_roles_robustness/plot_02_control_profiles.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_02_control_profiles.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_02_control_profiles.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_02_control_profiles.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_