Chapter 8
Placement of additional drivers and sensors
A configuration with the minimum number of inputs and outputs is rarely a good one: the states are far from the inputs and outputs, so the effect of an input arrives after many integrations and a disturbance is seen late. In the network this distance is the relative degree. This chapter shows that the relative degree equals the network distance plus one, defines the cost of a configuration used in the NOCAD papers, and presents the methods of the third NOCAD module that add driver and sensor nodes: grassroot and retrofit set covering, centrality-based retrofit, and two simulated annealing methods, mCLASA and the fuzzy-clustering-based GDFCMSA.
8.1 Problem and idea
The relative degree of an output with respect to an input counts the integrations between them, and it matters for control design: it fixes the delay with which an input acts on an output, it is the order of the derivative that input–output linearization needs, and a large relative degree makes a loop sluggish and sensitive to uncertainty [17, 18]. Daoutidis and Kravaris [18] showed that, for generic parameters, it can be read from the structure of the system as a path length. A minimal configuration of a chain of states needs one input and one output and has relative degree ; an additional driver in the middle halves the largest distance (fig. 8.1). The placement problem is to add as few driver or sensor nodes as possible so that every state lies within a required distance, or to place a given number of them so that the distances are as small as possible. Leitold, Vathy-Fogarassy and Abonyi formulated both problems on the network and solved them by set covering, centrality and simulated annealing [2, 20].
8.2 Theory
8.2.1 Relative degree and network distance
The relative degree of output with respect to input (acting through ) is the smallest with : the input appears in the -th derivative of the output and not earlier.
Proposition 8.1 (Daoutidis and Kravaris [18]). Let act on the driver node and read the sensor node . For generic values of the free parameters, , where is the length of the shortest path from to ( if there is none).
Proof. The entry is the sum, over all walks of length from to , of the products of the edge weights along the walk. It vanishes identically for . For the walks are the shortest paths; distinct shortest paths use distinct sets of edges, so their products are distinct monomials in the free parameters and their sum is a non-zero polynomial, which is non-zero for almost all parameter values. □
When disturbances may act on every state, the worst case over the states matters. With the control depth (distance from the nearest driver node) or the observation depth (distance to the nearest sensor node) of section 4.2.5, the relative order of a configuration is , and the NOCAD papers measure its quality by
| (8.1) |
which weighs the worst state against the average [20]. States that no configured node reaches are given the distance , as in the MATLAB code.
8.2.2 Set covering
Let be the set of states that node reaches within steps. Every state lies within distance of a configuration iff the sets , , cover all states: the smallest such configuration is a minimum set cover. Set cover is NP-hard, and the greedy algorithm, which repeatedly takes the set that covers most uncovered states, is within a factor of the optimum [64]. Grassroot set covering applies it to the whole network. It ignores the matching condition and can lose controllability: in a star the single node covers every state within one step, but two leaves remain unmatched. Retrofit set covering keeps the nodes of a matching-based design and covers only what they leave uncovered. Since adding dedicated inputs to a structurally controllable system keeps it controllable, every configuration that contains a valid design is valid; this holds for retrofit, for the centrality-based method and for the annealing methods below.
8.2.3 Centrality-based retrofit
The MATLAB function analyseComponents assigns the states to their nearest configured node (the control regions of section 4.2.5) and, in every region whose largest depth exceeds , adds the node with the largest product of normalized betweenness and out-closeness in the subnetwork of the region: a node through which many shortest paths pass and from which the region is reached quickly. nocad repeats the rounds on the re-partitioned network until the bound holds, which always terminates and agrees with the recursive MATLAB version when regions do not interact.
8.2.4 Simulated annealing: mCLASA and GDFCMSA
With a fixed number of additional nodes, eq. (8.1) is a medoid problem on the network: the configured nodes are medoids and every state belongs to its closest one [65]. The nodes of the matching-based design stay fixed; the additional ones move. Simulated annealing [66] proposes to replace a randomly chosen additional node by another state, accepts the move if it does not increase the cost, and otherwise with probability , while the temperature decreases geometrically from to . The two methods differ in the proposal [20]:
- mCLASA, a modified clustering-large-applications method based on simulated annealing [67], draws the new node uniformly from the states;
-
GDFCMSA, geodesic-distance-based fuzzy -medoid clustering with simulated annealing [68, 69], draws it by roulette wheel from the fuzzy memberships of the states in the removed medoid,
(8.2) computed from symmetrized geodesic distances, with a fuzziness exponent that falls from 10 to 2 along the run: early moves explore widely, late moves stay close to the hard assignment.
To meet a bound , the number of additional nodes is increased one at a time, with several independent runs for each, until the best configuration found satisfies it (algorithm 8.1).
In a nutshell: Placement
- Generically, relative degree network distance ; the relative order of a configuration is the largest depth of a state.
- Cost: .
- Grassroot set covering bounds the relative order with few nodes but may lose controllability; retrofit set covering, centrality-based retrofit and annealing keep the matching-based nodes and therefore controllability.
- mCLASA and GDFCMSA solve the medoid problem for a given number of additional nodes; GDFCMSA guides its moves by geodesic fuzzy memberships.
8.3 Using it in nocad
nocad.placement.Placement(kind="drivers", method="gdfcmsa", r_max=None, n_add=None, beta=0.5, n_iter=500, n_runs=10, base="path_finding", random_state=None)
kind: "drivers" or "sensors"; method: "set_cover" (grassroot), "retrofit", "centrality", "mclasa", "gdfcmsa"; give r_max (bound) or n_add (number of nodes). fit(adj) sets base_nodes_, nodes_, n_added_, cost_, max_order_, mean_order_, depth_ and, for the annealing methods, history_.
functions
relative_degree_matrix(adj, drivers, sensors, classical), relative_degree, placement_cost(dist, nodes, beta); nocad.placement.configuration_cost(adj, nodes, kind, beta), improve_configuration(adj, r_max) (all five methods for drivers and sensors, MATLAB extendData), set_cover, set_cover_except, centrality_retrofit, anneal, annealing_placement, reach_within; nocad.viz.plot_placement_history.
Relative degrees and costs of the NOCAD example:
R = nocad.relative_degree_matrix(adj, design.driver_nodes_, design.sensor_nodes_) print("classical relative degrees (rows: sensors, columns: drivers):\n", R) print("relative order of the configuration:", nocad.relative_degree(adj, design.driver_nodes_, design.sensor_nodes_)) for drivers in ([7], [3, 7]): cost, mx, mean = configuration_cost(adj, drivers, kind="drivers", beta=0.5) print(f"drivers {np.add(drivers, 1)}: cost {cost:.4f}, max {mx:.0f}, mean {mean:.4f}")
The three heuristics with bound two:
results = {} for method in ("set_cover", "retrofit", "centrality"): p = Placement(kind="sensors", method=method, r_max=2).fit(hen.adj) results[method] = p print(f"{method:10s} sensors={len(p.nodes_):2d} added={p.n_added_:2d} max={p.max_order_:.0f} " f"mean={p.mean_order_:.2f} cost={p.cost_:.3f}")
The annealing methods for an increasing number of sensors:
for method in ("mclasa", "gdfcmsa"): p = Placement(kind="sensors", method=method, r_max=0, n_iter=400, n_runs=5, random_state=0).fit(hen.adj) hist[method] = p.history_ print(method, p.history_[["n_added", "cost", "max_order", "mean_order"]].round(3).to_string(index=False))
All five methods at once, with their robustness:
table = improve_configuration(adj, r_max=2, beta=0.5, n_iter=300, n_runs=5, random_state=0) shown = table.assign(nodes=table.nodes.apply(lambda v: " ".join(f"x{i + 1}" for i in v))) print(shown[["kind", "method", "nodes", "cost", "max_order", "mean_order", "structural"]].round(4).to_string(index=False)) configs = {m: (table.query("kind == ’drivers’ and method == @m").nodes.iloc[0], table.query("kind == ’sensors’ and method == @m").nodes.iloc[0]) for m in table.method.unique()} labels = [f"x{i + 1}" for i in range(9)] print(nocad.robustness_table(adj, configs, labels=labels).round(3).to_string(index=False))
8.4 Examples
8.4.1 Relative degrees and the cost
With the input at , the relative degrees of outputs at are 5, 4, 5, 3, 4, 2, 3, 1 and 4; the first non-zero Markov parameter of a random realization gives the same numbers (fig. 8.2). The sensors and of the minimal design have relative degrees five and four; the relative order of the configuration is four. With the single driver the cost with is 3.22 (largest depth four, mean 2.44); a second driver at lowers it to 1.56 (largest depth two, mean 1.11), the improvement suggested in the NOCAD manual. Ranking all second drivers (fig. 8.3) shows that and tie as the best choice for every , whereas the order of the others depends on the weight: with the drivers , , and tie, with the mean distance prefers .
Open in ColabExample plot_01_relative_degree.py in the gallery
8.4.2 Heuristics
The minimal design of the heat exchanger network has three sensors and observation depths up to six. With the bound (fig. 8.4), grassroot set covering needs seven sensors (mean depth 0.95), retrofit set covering adds four to the three of the minimal design (mean depth 1.00), and the centrality-based retrofit adds five (mean depth 0.86, the lowest cost). As the bound is relaxed from zero, where every state needs a sensor, to six, the number of sensors falls from 22 to three for every heuristic (fig. 8.5); on this network all configurations remain observable. The star of section 8.2.2 shows the failure that grassroot set covering can cause: it returns the single driver , which leaves two leaves uncontrollable, while retrofit returns , and .
8.4.3 Simulated annealing
For the sensors of the heat exchanger network both annealing methods find the same best configurations for every number of additional sensors (fig. 8.6): the cost falls from 4.32 with the minimal design (largest depth six) to 1.46 with four additional sensors (largest depth two) and 0.77 with seven (largest depth one). The difference is in the effort (fig. 8.7): for four additional sensors, the mean final cost of twenty runs of GDFCMSA is lower than that of mCLASA for 50 to 200 iterations, and both reach the same value with 400 iterations.
8.4.4 Comparison of the five methods
On the NOCAD example with , all five methods add one driver to , at (four methods) or (mCLASA), with the same cost 1.56. The two choices differ in robustness: with the configuration tolerates seven of nine node removals, with five. For the sensors, grassroot set covering replaces the matching-based sensor by and (cost 1.44); the other methods keep and and add or (cost 1.39). On the heat exchanger network (fig. 8.8) the methods need between nine and twelve nodes for and five to seven for ; the centrality-based retrofit needs the most in three of the four cases, the annealing methods always need the fewest, and no configuration loses controllability or observability.
Open in ColabExample plot_04_method_comparison.py in the gallery
8.5 Further reading
The structural characterization of the relative degree is due to Daoutidis and Kravaris [18]; Isidori [17] explains its role in nonlinear control. The placement methods are from Leitold, Vathy-Fogarassy and Abonyi [2, 20], and their application to heat exchanger networks from [21, 22]. Greedy set cover is analyzed by Chvátal [64], simulated annealing introduced by Kirkpatrick, Gelatt and Vecchi [66], medoid clustering described by Kaufman and Rousseeuw [65], and geodesic fuzzy -medoid clustering by Király, Vathy-Fogarassy and Abonyi [68]. Summers, Cortesi and Lygeros [70] and Pasqualetti, Zampieri and Bullo [16] study input placement from the energy point of view, a complementary, numerical criterion.