Network-Based Controllability and Observability Analysis in PythonThe nocad toolbox

Chapter 9
Applications

The last chapter applies the whole workflow to three kinds of systems studied with the NOCAD toolbox: a heat exchanger network, where the network of state variables follows from the balance equations; the frontal neural network of C. elegans, a recorded network without known dynamics; and the state matrices of engineering benchmark models. Each case shows a different reason for the inputs and outputs a system needs, and each uses the views of chapter 4 to make that reason visible.

9.1 Problem and idea

The previous chapters introduced the analysis step by step: the network of the state variables (chapter 2), the design of inputs and outputs (chapter 3), the views that explain a design (chapter 4), roles and robustness (chapter 5), connection types (chapter 6), measures (chapter 7) and placement (chapter 8). In an application they are used together, and the order matters: first the network is derived and checked, then the minimal configuration is designed and explained, then it is improved for a small relative order and checked for robustness (fig. 9.1).

Figure 9.1

Figure 9.1. The workflow of a network-based controllability and observability analysis.

9.2 Heat exchanger networks

Heat exchanger networks recover heat from hot process streams to cold ones and are a classical object of process integration. Leitold, Vathy-Fogarassy and Abonyi derived the network of their state variables from the energy balances of the units [21, 22] and used it for sensor placement [20]. A lumped exchanger cell has two states, the outlet temperatures of its hot and its cold side,

Ṫho=vh Vh(Thi−Tho)+UA cphρhVh(Tco−Tho), Ṫco=vc Vc(Tci−Tco)+UA cpcρcVc(Tho−Tco), (9.1)

so both outlet temperatures depend on themselves and on each other, a connection of type g. The inlet temperature of a unit is the outlet temperature of the previous unit on the same stream, which adds an edge from the upstream state to the downstream state of the same side; a utility cooler has a single state with a self-loop (fig. 9.2). Every unit is therefore a strongly connected component, the self-loops form a perfect matching, and by proposition 6.2 the inputs and outputs are dictated by the source and sink components of the condensation, not by unmatched nodes.

Figure 9.2

Figure 9.2. A heat exchanger network and its state variables. (a) The hot stream passes E1 and then E2, the cold stream E2 and then E1. (b) Each exchanger is a two-state component with self-loops and mutual heat transfer; the streams add edges between the units (vermilion: hot side, blue: cold side). Because the two streams run in opposite directions, E1 and E2 feed each other, and all four states form one strongly connected component.

The case study of this chapter has the composition of the network analyzed in [20]: six hot and two cold streams, ten exchanger cells and two coolers, 22 states and 56 edges; the matches between the streams are an illustrative design written for nocad, not the published one. The maximum matching leaves no node unmatched; path finding needs one driver node, the hot outlet of E9, which belongs to the only source component, and three sensor nodes on the three sink components (fig. 9.3). The minimal sensors see some states only through six edges. GDFCMSA with the bound two adds four sensors and lowers the mean observation depth from 2.64 to 0.91 (fig. 9.4). The stream structure decides the minimal design: splitting the two cold streams into five short branches creates more source and sink components, three drivers and four sensors, but reduces the largest observation depth to four.

hot = [["E1", "E2"], ["E3", "C1"], ["E4", "E5"], ["E6", "E7", "C2"], ["E8"], ["E9", "E10"]] 
cold = [["E10", "E8", "E5", "E2", "E1"], ["E9", "E7", "E6", "E4", "E3"]] 
hen = make_heat_exchanger_network(hot, cold, coolers=["C1", "C2"]) 
print(hen.adj.shape, hen.adj.nnz, "edges;", hen.n_exchangers, "exchanger cells") 
print("unmatched nodes of a maximum matching:", nocad.maximum_matching(hen.adj).unmatched) 
design = nocad.InputOutputDesign("path_finding").fit(hen.adj) 
print("drivers:", [hen.labels[v] for v in design.driver_nodes_], " sensors:", 
      [hen.labels[v] for v in design.sensor_nodes_])
   

Figure 9.3

Figure 9.3. SCC hierarchy of the heat exchanger network with the minimal configuration: one driver on the source component, three sensors on the sink components.

Open in ColabExample plot_01_heat_exchanger_network.py in the gallery

Figure 9.4

Figure 9.4. Observation depth of the heat exchanger network with the three minimal sensors (left) and with the seven sensors placed by GDFCMSA for the bound two (right).

9.3 The frontal neural network of C. elegans

The NOCAD software paper [2] analyzed the 131 frontal neurons of C. elegans with their anatomical positions from Kaiser and Hilgetag [71]. The network has 764 connections and 22 strongly connected components; its condensation is a bow tie (fig. 9.5): ten source neurons feed a core of 109 neurons, which feeds seven sink components, on five levels. All design methods agree on twelve driver and twelve sensor neurons; ten of the driver neurons are the source neurons (critical nodes), the remaining two come from dilations and can be chosen among 30 intermittent neurons; 91 neurons are redundant. On the anatomical layout (fig. 9.6) the control depth shows how far control has to travel: 98 of the 131 neurons lie within two connections of a driver neuron, the farthest at six.

design = nocad.InputOutputDesign().fit(net.adj) 
cond = nocad.condensation(net.adj) 
print(f"{net.n_states} neurons, {net.n_edges} connections, {cond.n_components} components, " 
      f"largest {cond.sizes.max()}") 
print("driver neurons:", [net.labels[v] for v in design.driver_nodes_]) 
print("sensor neurons:", [net.labels[v] for v in design.sensor_nodes_])
   

Figure 9.5

Figure 9.5. SCC hierarchy of the frontal neural network of C. elegans: source neurons on top, the core of 109 neurons, sink components at the bottom.

Open in ColabExample plot_02_celegans.py in the gallery

Figure 9.6

Figure 9.6. Control depth of the frontal neurons of C. elegans on their anatomical positions.

9.4 State matrices of engineering models

The models of Set III (section 6.2.4) are the zero patterns of state matrices of engineering systems [54]. Most of their states have self-loops and most of their edges are symmetric, so applying the connection type g changes none of their driver counts (fig. 9.7): the network of a physical model already contains its self-influence and interactions. Eleven of the fifteen models with at most 1100 states need a single input or a few, one per strongly connected component; the four whose state matrices are diagonal or block diagonal (CD player, ISS module, FOM and transmission line) need one input per block, because the structure of 𝐀 alone shows no coupling between the blocks.

for name in list_networks("III"): 
    net = load_network(name) 
    if net.n_states > 1100: 
        continue 
    loops, sym = percent_loop_sym(net.adj) 
    comps = nocad.condensation(net.adj) 
    rows.append({"network": name, "N": net.n_states, "edges": net.n_edges, "loops %": round(loops), 
                 "symmetric %": round(sym), "SCCs": comps.n_components, 
                 "drivers": nocad.n_driver_nodes(net.adj, "minimum"), 
                 "drivers (g)": nocad.n_driver_nodes(nocad.apply_connection_type(net.adj, "g"), "minimum"), 
                 "sensors": nocad.sensor_nodes(net.adj, "minimum").size}) 
table = pd.DataFrame(rows)
   

Figure 9.7

Figure 9.7. Driver nodes of the Set III models as recorded and after applying connection type g.

Open in ColabExample plot_03_dynamical_benchmarks.py in the gallery

9.5 Lessons

Three lessons summarize the applications. First, where the network is derived from balance equations, the units are strongly connected and the minimal configuration follows from the hierarchy of the components; the minimum input theorem alone would suggest a single input. Second, in recorded networks without dynamics, the source and sink nodes dictate most inputs and outputs, and the counts drop sharply as soon as self-influence and interactions are added (chapter 6); conclusions about the controllability of such networks should be drawn with the connection types in mind. Third, the minimal configuration is the starting point, not the goal: the depth maps and the operability plane show which states are far from the inputs and outputs, placement brings them closer, and the robustness test shows whether the configuration survives the loss of a state variable.

9.6 Further reading

The analyses of heat exchanger networks are in [20, 21, 22], the C. elegans case in [2] and the Set III comparison in [1]; the book of Leitold, Vathy-Fogarassy and Abonyi [3] collects them. Gao, Liu, D’Souza and Barabási [72] study the control of target subsets of nodes, Gates and Rocha [14] compare structural controllability with the dynamics of biochemical networks, and Yan et al. [15] the energy needed to control a network, three directions in which the structural analysis of this book can be extended.