nocad.design.InputOutputDesign#

class nocad.design.InputOutputDesign(method='path_finding')[source]#

Bases: BaseEstimator

Design inputs and outputs that make a network controllable and observable.

Parameters:
method{“path_finding”, “signal_sharing”, “minimum”, “matching”}, default=”path_finding”

How perfectly matched source (sink) SCCs are handled; see the module docstring.

Attributes:
adj_scipy.sparse.csr_array of shape (N, N)

Boolean adjacency matrix of the network.

labels_list of str

Node names (networkx node names or DataFrame index of the input, else x1, x2, ...).

A_, B_, C_, D_scipy.sparse.csr_array

State-space matrices, \(\mathbf{A}=\mathbf{W}^{\mathsf T}\) (weights kept).

control_matching_Matching

Matching of \(\mathcal{G}\) whose unmatched nodes have dedicated inputs.

observation_matching_Matching

Matching of \(\mathcal{G}^{\mathsf T}\) whose unmatched nodes have dedicated outputs.

driver_nodes_, sensor_nodes_ndarray of int

All nodes receiving an input / measured by an output (shared ones included).

shared_driver_nodes_, shared_sensor_nodes_ndarray of int

Nodes on a shared signal (signal sharing only).

n_inputs_, n_outputs_, n_drivers_, n_sensors_int

Examples

>>> from nocad.datasets import load_nocad_example
>>> design = InputOutputDesign().fit(load_nocad_example().adj)
>>> design.driver_nodes_, design.sensor_nodes_
(array([7]), array([0, 8]))
annotate(**kwargs)[source]#

Node and edge tables of the design (nocad.annotation.annotate()).

is_controllable()[source]#

Structural controllability of the designed system (Lin’s theorem).

is_observable()[source]#

Structural observability of the designed system.

matrices(dense=True)[source]#

(A, B, C, D) as dense arrays (default) or sparse arrays.

to_networkx(**kwargs)[source]#

Annotated NetworkX digraph of the design (nocad.io.to_networkx()).

write(path, **kwargs)[source]#

Write the annotated design to a file; the format follows the extension (nocad.io.write()).