Decentralized control of nonlinear N-tank network

Updated:

Tags: , , , , ,

Application of decentralized control to the N-tank network, using the one-step method.


The quadruple-tank network presented in [1], whose MATLAB code is presented in this example, can be generalized to N tanks. Consider $N$ interconnected tanks, where $N$ is an even integer. The water level of tank $i$ is denoted by $h_i$. The network is actuated by $N/2$ pumps, which are controlled by the lower tanks, whose inputs are denoted by $u_i$ for $i=1,…,N/2$, in accordance with the schematic. Each pump is connected to a three-way valve that regulates the fraction of the flow, held constant, that goes to each of the tanks supplied by the pump. Each tank has a sensor, which measures its water level. Making use of mass balances and Bernoulli’s law, the system dynamics, in the absence of noise, are given by

\[\begin{cases} A_i\dot{h}_i(t) = -a_i\sqrt{2gh_i(t)}+a_{\frac{N}{2}+i}\sqrt{2gh_{\frac{N}{2}+i}(t)}+\gamma_ik_iu_i(t), \:\: i = 1,...,N/2\\ A_i\dot{h}_i(t) = -a_i\sqrt{2gh_i(t)}+(1-\gamma_{i-\frac{N}{2}-1})k_{i-\frac{N}{2}-1}u_{i-\frac{N}{2}-1}(t), \:\: i = \frac{N}{2}+2,...,N\\ A_{\frac{N}{2}+1}\dot{h}_{\frac{N}{2}+1}(t) = -a_{\frac{N}{2}+1}\sqrt{2gh_{\frac{N}{2}+1}(t)}+(1-\gamma_{\frac{N}{2}})k_{\frac{N}{2}}u_{\frac{N}{2}}(t) \end{cases}\:,\]

where $A_i$ and $a_i$ are the cross sections of tank $i$ and of its outlet hole, respectively; the constant $\gamma_i$ represents the fraction of the flow that passes through the valve $i$ to the lower tanks; $k_i$ is the constant of proportionality between the mass flow and the input of pump $i$; and $g$ denotes the acceleration of gravity. Furthermore, the input of each pump is subject to a hard constraint $u_i\in [0,u^{\mathrm{sat}}]$, where $u^{\mathrm{sat}} \in \mathbb{R}^+$.

image-title-here

This network is presented to show the scalability of the one-step method. The same control approach as in the example for the quadruple-tank network is used, which is described in [1]. The simulation of the N-tank network is analogous to the quadruple tank network. To open this example execute the following command in the MATLAB command window

open NTanksNetworkControlOneStep

and set the number of tanks to an even integer number in the field Nof struct cte in private function getConstantsNTankNetwork, as exemplified below

%% getConstantsNTankNetwork - Description
% This function outputs a struct of constants of the model dynamics.
% Input:    -flagEqMatrices: only if true compute equilibrium matrices
% Output:   -Cte: struct with the necessary constants and parameters
function cte = getConstantsNTankNetwork(flagEqMatrices)
% --- Define dimentions of the model ---
cte.N = 40;      % number of tanks

(...)

end

For $N=40$, the evolution of the water level in some of the tanks is shown below

The evolution of the inputs to some pumps is shown below

References

[1] Pedroso, L. and Batista, P., 2021. Discrete‐time decentralized linear quadratic control for linear time‐varying systems. International Journal of Robust and Nonlinear Control. doi:10.1002/rnc.5772.