## 10 Thermal Mixing Tank System
\begin{split} Q_{s}(k+1)&=0.00007+1.8547Q_{s}(k)- 0.8607Q_{s}(k-1)+0.0033U_{1}(k)\\ &+0.0024U_{1}(k-1)+0.0038U_{2}(k)+0.0021U_{2}(k-1)\\ T_{s}(k+1)&=0.1838+2.4484T_{s}(k)-1.9892T_{s}(k-1)+0. 5373T_{s}(k-2)\\ &+0.1116U_{1}(k)+0.0016U_{1}(k-1)-0.0748U_{1}(k-2)\\ &-0.1375U_{2}(k)+0.0018U_{2}(k-1)+0.0952U_{2}(k-2)\end{split} \] \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter** & **Symbol** & **Value** \\ \hline Steady state gain of inlet flow rate \(Q_{1}\) & \(K_{1}\) & 1 (m\({}^{3}\)/s) \\ Inlet flow time constant \(Q_{1}\) & \(\tau_{1}\) & 5 \\ Steady state gain of inlet flow rate \(Q_{2}\) & \(K_{2}\) & 1 (m\({}^{3}\)/s) \\ Inlet flow time constant \(Q_{2}\) & \(\tau_{2}\) & 4 \\ Mixing tank horizontal section area & \(A\) & 1 (m\({}^{2}\)) \\ Temperature of inlet flow \(Q_{1}\) & \(T_{1}\) & 90 (\({}^{\circ}\)C) \\ Temperature of inlet flow \(Q_{2}\) & \(T_{2}\) & 10 (\({}^{\circ}\)C) \\ Mixing tank outside temperature & \(T_{e}\) & 15 (\({}^{\circ}\)C) \\ Thermal loss coefficient & \(k_{p}\) & 0.01 (m\({}^{3}\)/s) \\ Discharge coefficient of outlet flow \(Q_{s}\) & \(\alpha\) & 1 (m\({}^{2.5}\)/s) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Mix tank system parameters. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Motorized valve input signal \(U_{1}\) & 2 \\ Motorized valve input signal \(U_{2}\) & 2 \\ Outlet flow rate \(Q_{s}\) & 4 (m\({}^{3}\)/s) \\ Outlet temperature \(T_{s}\) & 50 (\({}^{\circ}\)C) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: System nominal operating point values. The next step is to apply the identification of the T-S fuzzy model. To this end, three fuzzy sets are selected between 1 and 7 (m\({}^{3}\)/s) for the flow rate, and another three between 20 and 80 (\({}^{\circ}\)C) for the temperature. Both membership functions are shown in Figure 2.  
In this way, the fuzzy model is constructed using a set of 9 rules:  
\[\text{S}^{(1,1)}\text{: If }Q_{s}(k) \text{ is }M_{1}^{1}\text{ and }T_{s}(k)\text{ is }M_{2}^{1}\text{, then}\] \[Q_{s}(k+1) =0.0014+1.7893Q_{s}(k)-0.8034Q_{s}(k-1)+0.0070U_{1}(k)\] \[+0.0055U_{1}(k-1)+0.0093U_{2}(k)+0.0038U_{2}(k-1)\] \[T_{s}(k+1) =0.1472+2.3728T_{s}(k)-1.9048T_{s}(k-1)+0.5288T_{s}(k-2)\] \[+0.5247U_{1}(k)-0.0016U_{1}(k-1)-0.3395U_{1}(k-2)\] \[-0.1233U_{2}(k)+0.0015U_{2}(k-1)+0.0547U_{2}(k-2)\] \[\vdots\]  
\(\text{S}^{(3,3)}\text{: If }Q_{s}(k)\text{ is }M_{1}^{3}\text{ and }T_{s}(k) \text{ is }M_{2}^{3}\text{, then}\] \[Q_{s}(k+1) =0.0060+1.8593Q_{s}(k)-0.8635Q_{s}(k-1)+0.0026U_{1}(k)\] Figure 2.0 Figure 2.1 Figure 2.2 Figure 2.3  
The next step is to model the nonlinear system using the incremental state T-S model. This is achieved by applying Equation (15) presented in Section 3:  
Figure 2.4 \[\left[ \begin{array}{c}y(k+1)\\ \Delta x(k+1)\end{array} \right] =\left[ \begin{array}{cc}I&CA^{(1,1)}\\ 0&A^{(1,1)}\end{array} \right]\left[ \begin{array}{c}y(k)\\ \Delta x(k)\end{array} \right]+\left[ \begin{array}{c}CB^{(1,1)}\\ B^{(1,1)}\end{array} \right]\Delta u(k)\] \[y(k) =\left[ \begin{array}{cc}I&0\end{array} \right]+\left[ \begin{array} []{c}y(k)\\ \Delta x(k)\end{array} \right]\] \[\vdots\]  
\(\text{S}^{(33)}\text{: If }Q_{s}(k)\text{ is }M_{1}^{3}\text{ and }T_{s}(k) \text{ is }M_{2}^{3}\text{, then}\] \[\left[ \begin{array}{c}y(k+1)\\ \Delta x(k+1)\end{array} \right] =\left[ \begin{array}{cc}I&CA^{(3,3)}\\ 0&A^{(3,3)}\end{array} \right]\left[ \begin{array}{c}y(k)\\ \Delta x(k)\end{array} \right]+\left[ \begin{array}{c}CB^{(3,3)}\\ B^{(3,3)}\end{array} \right]\Delta u(k)\] \[y(k) =\left[ \begin{array}{cc}I&0\end{array} \right]+\left[ \begin{array} []{c}y(k)\\ \Delta x(k)\end{array} \right]\]  
Figure 2: Membership functions for \(Q_{s}\) and \(T_{s}\). \[C_{a}=\left[ \begin{array}{cccccc}1&0&0&0&0&0&0\\ 0&1&0&0&0&0&0\end{array} \right]\]  
Once the model is obtained, the feedback matrix \(K\) for all the fuzzy rules. To do this, the matrices \(Q\) and \(R\) are used, which are defined as follows:  
\[Q=0.001 diag(\left[ \begin{array}{cccccc}0.5&0.2&1&1&1&1&1\end{array}