# Protocol for Energy-Efficiency in Networked Control Systems Based on WSN
## 6 Example of Application of the Energy-Efficiency Protocol
### Coupled Multi-Level Tank  
Consider a plant composed by two coupled tanks, where the values of the physical parameters were borrowed from the Coupled Tanks System model 33-041 [49]. The plant diagram is depicted in Figure 3a, where the actuators and sensors are highlighted, and the actual plant from which the physical parameters were obtained is shown in Figure 3b. Figure 3: (**a**) Operating system diagram; (**b**) Level control plant used in the experiment. Observe that the plant consists in two indistinguishable tanks coupled by an opening valve (\(C_{c}\)). Variable pace pumps (\(Q_{in}^{1}\) and \(Q_{in}^{2}\)) supply water to the first and second tanks. The hole between the tanks (\(C_{c}\)) allows the water to stream into the second tank and thus out to a store. The control action aims to adjust the inlet flow rate (\(Q_{in}^{1}\) and \(Q_{in}^{2}\)) in order to maintain the levels \(H_{1}\) and \(H_{2}\) in the first and second tanks close to some desired set points. The continuous-time dynamic equations that describe the level variation for each tank are given by  
\[ \begin{split}\frac{\partial H_{1}(t)}{\partial t}& =\frac{\mathcal{K}Q_{in}^{1}(t)}{A_{r}}-\frac{\mathcal{C}_{d}a \sqrt{2 gH_{1}(t)}}{A_{r}}-\frac{\mathcal{C}_{c}a\sqrt{2g(H_{1}(t)-H_{2}(t))}}{ A_{r}}+\lambda_{1}(t),\\ \frac{\partial H_{2}(t)}{\partial t}&=\frac{ \mathcal{K}Q_{in}^{2}(t)}{A_{r}}-\frac{\mathcal{C}_{d}a\sqrt{2 gH_{2}(t)}}{A_{ r}}+\frac{\mathcal{C}_{c}a\sqrt{2g(H_{1}(t)-H_{2}(t))}}{A_{r}}+\lambda_{2}(t), \end{split}  \tag{21}\]  
where \(\lambda_{1}\) and \(\lambda_{2}\) denote exogenous inputs with null mean and standard deviation given, respectively, by \(\rho_{1}\) and \(\rho_{2}\). The plant parameters are presented in Table 3.  
Adopting the same procedure provided in [50], the state vector is defined as \(x(t)=[H_{1}(t)\ H_{2}(t)]^{\prime}\), and \(\dot{x}(t)=[\Delta H_{1}(t)\ \Delta H_{2}(t)]^{\prime}\), where \(\Delta H_{1}(t)\) and \(\Delta H_{2}(t)\) represent the variation of the fluid height around the linearization points of tanks 1 and 2, respectively. Then, by linearizing Equation (21) around \(H_{1}=20\,\mathrm{cm}\) and \(H_{2}=10\,\mathrm{cm}\), the state-space matrices of a continuous-time system similar to Equation (1) are given by  
\[A= \begin{bmatrix}-0.0239&-0.0127\\ 0.0127&-0.0285\end{bmatrix} ,\ E= \begin{bmatrix}3&0\\ 0&2.5\end{bmatrix} ,\ B=0.7198I,\ C_{z}=C_{y}=I,\ E_{y}=D_{z}=E_{z}=0, \tag{22}\]  
The measurement information required for feedback purposes and the control signal are transmitted, respectively, from the plant to the remote controller and from the controller to the plant in periodic samples (with a sampling interval \(T_{S}\)) of the output and control signals, through a semi-reliable network with topology shown in Figure 4. To obtain a discrete-model, suitable for digital control, a discretization procedure based on the Zero-Order Holder was implemented. Since the sampling time \(T_{S}\) is one of the parameters used to compute the energy consumption cost given by Equation (17), the choice of \(T_{S}\) is significant. For instance, choosing an unsuitable value of \(T_{S}\) may lead to a discrete-time model that does not accurately represent the plant and, as a consequence, affecting the performance of the controller. An appropriate choice of the sampling interval can be accomplished, for instance, by analyzing the frequency response and computing the rising time [51] Chapter 13, and the bandwidth of the system [52] Chapter 11.