Skip to main content

nocad: network-based controllability and observability analysis in Python

nocad: network-based controllability and observability analysis in Python

tests docs License: MIT

nocad analyses the controllability and observability of dynamical systems on the network of their state variables. It succeeds the NOCAD — Network-based Observability and Controllability Analysis of Dynamical systems toolbox for MATLAB (Leitold, Vathy-Fogarassy, Abonyi) and implements its three modules — network mapping, system characterisation, and the improvement of input and output configurations — together with new methods: the exact minimum of dedicated inputs, node roles and edge classes, control profiles, robustness analysis, and a visualization module whose layouts make the structural conditions of controllability visible.

Module Contents
nocad.design, nocad.matching maximum matching (Hopcroft–Karp), path finding, signal sharing, exact minimum of dedicated inputs; driver and sensor nodes; generation of B, C, D; node roles and edge classes
nocad.structural, nocad.components Lin's structural test, generic dimension of the controllable subspace (orthogonal Krylov iteration), Kalman and PBH tests, control and observe centrality; strongly connected components and condensation
nocad.distances geodesic distances, control and observation depth and regions, relative degree, placement cost
nocad.profiles, nocad.robustness driver and sensor types, control profiles; robustness against node and edge removal
nocad.connection the seven connection types, node and edge dynamics, dynamics heat maps
nocad.measures about fifty network, node, configuration and edge measures as pandas tables
nocad.placement grassroot and retrofit set covering, centrality-based retrofit, mCLASA and GDFCMSA simulated annealing (Placement estimator)
nocad.io, nocad.annotation import and export: NetworkX, igraph, pandas, state-space matrices, python-control; GraphML, GEXF (Gephi), GML, Cytoscape JSON, node-link JSON, Graphviz DOT, Pajek, edge lists, CSV, Excel, MATLAB (NOCAD toolbox), NumPy; node and edge tables with the role of every element, carried as attributes by every export and restored on import
nocad.viz SCC hierarchy layout, bipartite matching view, control cacti, block-triangular structure matrix, depth maps with network-Voronoi regions, operability plane, role and robustness maps, dashboards
nocad.datasets, nocad.plotting the networks of the NOCAD studies (Sets I–III, C. elegans frontal network), generators (random, water tanks, heat exchanger networks), drawing primitives

Installation

pip install nocad

Python ≥ 3.10; depends on numpy, scipy, networkx, pandas and matplotlib. pip install "nocad[interop]" adds python-control, igraph and openpyxl for the corresponding conversions.

Quick start

import nocad
from nocad.datasets import load_nocad_example
from nocad.viz import plot_control_cacti, plot_operability_summary

adj = load_nocad_example().adj             # network of the state variables (W = A^T)

design = nocad.InputOutputDesign(method="path_finding").fit(adj)
design.driver_nodes_, design.sensor_nodes_  # where the inputs and outputs go
A, B, C, D = design.matrices()              # structured state-space matrices
design.is_controllable(), design.is_observable()

nocad.InputOutputDesign(method="minimum").fit(adj).n_inputs_   # exact minimum

plot_control_cacti(adj)                     # Lin's cacti: why the design works
plot_operability_summary(adj)               # hierarchy, depth maps, operability plane

ann = design.annotate()                     # role of every node and edge (pandas tables)
design.write("example.gexf")                # Gephi, with role colors and positions
G = design.to_networkx()                    # annotated networkx.DiGraph
net = nocad.read_network("example.gexf")    # network and configuration come back

Estimators follow the scikit-learn conventions (fit, fitted attributes with a trailing underscore, get_params/set_params); networks are accepted as NumPy arrays, SciPy sparse matrices, NetworkX digraphs, igraph graphs or pandas DataFrames, and node names are kept in every table, file and figure.

Documentation, examples, book

  • Documentation and example gallery: https://complexsystemsintelligence.github.io/nocad. 29 runnable examples in seven sections; each generates or loads its own network, explains the method and ends with a study of its parameters. Every example is also a Jupyter notebook.
  • Book: Network-Based Controllability and Observability Analysis in Python: The nocad toolbox: read online, PDF (136 pages) and EPUB, CC BY 4.0; LaTeX source in book/, built by book/build.sh (PDF), book/epub/make_epub.py and book/web/make_web.py. Theory in one notation, algorithm boxes, propositions with proofs, and the gallery examples as case studies.
  • Migration from the MATLAB toolbox: Appendix B of the book and docs/migration.rst.

Development

git clone https://github.com/ComplexSystemsIntelligence/nocad.git && cd nocad
pip install -e ".[dev]"
pytest                                   # unit tests and doctests
ruff check src tests tools examples
python docs/build_api_pages.py && sphinx-build -b html docs docs/_build/html
book/build.sh                            # cover, figures, appendices, PDF
python book/epub/make_epub.py            # EPUB edition (tex4ebook)
python book/web/make_web.py              # web edition (make4ht) -> book/_build_web/site

DESIGN.md sets the conventions for the code, the docstrings, the examples and the book (notation, API contract, layout, templates).

Citing

Please cite the software through CITATION.cff (a Zenodo DOI is assigned with the first release) and the original publications of the methods you use, in particular

  • D. Leitold, Á. Vathy-Fogarassy, J. Abonyi: Controllability and observability in complex networks – the effect of connection types. Scientific Reports 7, 151 (2017), doi:10.1038/s41598-017-00160-5;
  • D. Leitold, Á. Vathy-Fogarassy, J. Abonyi: Network-based observability and controllability analysis of dynamical systems: the NOCAD toolbox. F1000Research 8:646 (2019), doi:10.12688/f1000research.19029.2.

Every docstring and chapter lists the publications behind its methods.

About

nocad is developed by the HUN-REN–PE Complex Systems Monitoring Research Group (AbonyiLab) at the University of Pannonia, Veszprém, Hungary. The group's open textbooks and software are collected at complexsystemsintelligence.github.io. The work was supported by the National Research, Development and Innovation Office of Hungary (NKFIH) through the OTKA 143482 project.

License

Code: MIT. Book: CC BY 4.0. Authors: János Abonyi, Dániel Leitold and Ágnes Vathy-Fogarassy (University of Pannonia), who also wrote the MATLAB toolbox this project succeeds.

Metadata

Release files for nocad 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nocad 1.0.1
File Size Uploaded Provenance Actions
nocad-1.0.1.tar.gz 321.6 kB With provenance Details for nocad-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nocad 1.0.1
File Interpreter ABI Platform Actions
nocad-1.0.1-py3-none-any.whl Python 3 none any Details for nocad-1.0.1-py3-none-any.whl

Total release size: 622.0 kB

Release files / nocad-1.0.1.tar.gz

Download URL nocad-1.0.1.tar.gz
Size 321.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2fa057510ff376079dcf103d2df9b943720d66c797fa94ae629b74145c8ecd04
BLAKE2b-256 checksum
How to use checksums
805a060b2a2f86e067adc73617b434ce4b88a6ace1f81407565af2f001539bc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / nocad-1.0.1-py3-none-any.whl

Download URL nocad-1.0.1-py3-none-any.whl
Size 300.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f0a2ac4a05a9bd28856f1f167414a2fb9e2afe5682527894a42adb575bdcfa8
BLAKE2b-256 checksum
How to use checksums
61fe86faa99238e615e80d660304439addac112e956a92fb55fc7acc1d5763d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for nocad 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nocad-1.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page