Network-Based Controllability and Observability Analysis in PythonThe nocad toolbox

Preface

This book is about a simple question with far-reaching consequences: where must a dynamical system be actuated and measured so that it can be steered to any state and its state reconstructed from the measurements? For a linear system the question has a classical answer, the rank conditions of Kalman, but checking them for every candidate set of inputs and outputs is hopeless for systems with hundreds of state variables. Network science offers a different route. The state variables are the nodes of a network, an edge connects two of them when one appears in the differential equation of the other, and the location and the number of the necessary inputs and outputs follow from the structure of this network: from a maximum matching, from its strongly connected components, and from the distances between its nodes.

The toolbox and its predecessor. The methods of the book were developed by the authors at the University of Pannonia and implemented in the NOCAD (Network-based Observability and Controllability Analysis of Dynamical systems) toolbox for MATLAB and Octave [1, 2, 3]. The NOCAD toolbox has three modules: network mapping (input and output design by maximum matching), system characterisation (about fifty measures of the network and of the designed system), and improvement and robustness (placement of additional sensors and actuators, robustness against the loss of a state variable). nocad is its Python successor. All functions of the three modules are available, function by function (chapter B), and the package adds what the past years have taught us: exact structural tests instead of rank computations on numerical matrices, an exact minimum of dedicated inputs that the greedy path-finding method approaches, the roles that nodes and edges play across all maximum matchings, and, above all, a set of visualization algorithms that show not only that a system is controllable and observable but also why.

Who the book is for. It is written for engineers, network scientists, and graduate students who want to analyse the controllability and observability of large systems: process plants and heat exchanger networks, neural and regulatory networks, power grids and other infrastructures. Linear algebra and elementary graph theory are enough to follow it; every algorithm is stated in a box, summarized in a few bullets, and demonstrated on networks whose structure is known. Readers who only want to use the toolbox can read the Using it in nocad and Examples sections of each chapter; readers interested only in the methods can skip the code.

How to run the examples. The package is installed with pip install nocad. The scripts that produce the figures are in the examples/ directory of the repository, grouped into folders by topic, and are listed in chapter C. The sphinx-gallery extension renders them as the online gallery of the documentation and converts them into Jupyter notebooks, so every experiment in the book can be rerun and modified. The code snippets printed in the chapters are extracted from the same scripts and therefore run with the version of the toolbox that the book describes.

Acknowledgments. The NOCAD toolbox and most methods of this book were developed in the papers of the authors and in their SpringerBriefs monograph [3], which are the backbone of the theory chapters. The fuzzy clustering behind the GDFCMSA placement method goes back to work with András Király and Balázs Feil. The authors acknowledge the support of the OTKA 143482 project of the National Research, Development and Innovation Office (NKFIH), Hungary.

Veszprém, November 2026 The authors