Question 7.10: Modeling a Two-Tank Liquid-Level System with Simulink Consid...
Modeling a Two-Tank Liquid-Level System with Simulink
Consider the two-tank liquid-level system in Example 7.5. Construct a Simulink block diagram to find the liquid levels h_{1}(t) and h_{2}(t). Assume \rho=1000 \mathrm{~kg} / \mathrm{m}^{3}, g=9.81 \mathrm{~m} / \mathrm{s}^{2}, A_{1}=2 \mathrm{~m}^{2}, A_{2}=3 \mathrm{~m}^{2}, R_{1}=R_{2}=R_{3}=400 \mathrm{~N} \cdot \mathrm{s} /\left(\mathrm{kg} \cdot \mathrm{m}^{2}\right), and initial liquid heights h_{1}(0)=1 \mathrm{~m} and h_{2}(0)=0 \mathrm{~m}. The pump pressure \Delta p is a step function with a magnitude of 0 before t=0 \mathrm{~s} and a magnitude of 130 \mathrm{kPa} after t=0 \mathrm{~s}.
Learn more on how we answer questions.
The Simulink block diagram can be constructed based on either the differential equations obtained in Part (a) or the state-space form obtained in Part (b) in Example 7.5. Substituting the values of the parameters into the differential equations gives
\begin{aligned} \frac{\mathrm{d} h_{1}}{\mathrm{~d} t} & =-0.0245 h_{1}+1.25 \times 10^{-6} p, \\ \frac{\mathrm{d} h_{2}}{\mathrm{~d} t} & =0.0082 h_{1}-0.0082 h_{2} . \end{aligned}
Figure 7.38 shows the resulting Simulink block diagram, in which two Integrator blocks are used to form h_{1} and h_{2}. Double-clicking on each Integrator block, we can enter the initial liquid level for each tank.
Substituting the values of the parameters into the state-space equations gives
\begin{gathered} \left\{\begin{array}{l} \dot{x}_{1} \\ \dot{x}_{2} \end{array}\right\}=\left[\begin{array}{cc} -0.0245 & 0 \\ 0.0082 & -0.0082 \end{array}\right]\left\{\begin{array}{l} x_{1} \\ x_{2} \end{array}\right\}+\left[\begin{array}{c} 1.25 \times 10^{-6} \\ 0 \end{array}\right] u, \\ \left\{\begin{array}{l} y_{1} \\ y_{2} \end{array}\right\}=\left[\begin{array}{ll} 1 & 0 \\ 0 & 1 \end{array}\right]\left\{\begin{array}{l} x_{1} \\ x_{2} \end{array}\right\}+\left[\begin{array}{l} 0 \\ 0 \end{array}\right] u . \end{gathered}
The Simulink block diagram based on the state-space form is shown in Figure 7.39, in which a state-Space block is used to represent the liquid-level system. Double-clicking on the Statespace block with the name Liquid-level system, we can define the matrices \mathbf{A}, \mathbf{B}, \mathbf{C}, and \mathbf{D}. The initial liquid level is the vector \left[\begin{array}{ll}1 & 0\end{array}\right]. Running either of the two simulations, we can obtain the same results as plotted in Figure 7.40.


