## 10 Thermal Mixing Tank System  
In this section, the application of fuzzy control based on the incremental-N state model is illustrated through the thermal mixing tank case study [15; 35; 36]. The purpose is to evaluate the system's performance and verify the achievement of zero steady-state error in response to step, ramp, and subsequent input and disturbance signals. The thermal mixing tank system, depicted in (Figure 1), is a multivariable and nonlinear system comprising a tank, two inlet valves (for hot and cold fluids), and an outlet pipe. The primary control objective is to regulate the outlet flow rate \(Q_{s}\) and the outlet temperature \(T_{s}\) to their respective setpoints, under the assumption that the outlet temperature is equal to the temperature within the tank. The system inputs are two valves: One transports a hot fluid at a constant temperature \(T_{1}\) with a variable flow rate \(Q_{1}\), and the other transports a cold fluid at a constant temperature \(T_{2}\) with a variable flow rate \(Q_{2}\). Both flow rates serve as the manipulated variables of the system, controlled through their respective motorized valves, whose dynamic model is given by  
\[ \begin{split} Q_{1}&=\frac{K_{1}}{1+\tau_{1S}}U_{1}(s )\\ Q_{2}&=\frac{K_{2}}{1+\tau_{2S}}U_{2}(s)\end{split}  \tag{61}\]  
Additionally, it is assumed that there are heat losses proportional to the temperature difference between the interior \(T_{s}\) and the exterior \(T_{e}\) of the tank, which act as a disturbance to the system. Thus, the dynamic model is given by  
\[Q_{1}+Q_{2}-Q_{s}=A\frac{dh}{dt} \tag{62}\]  
\[T_{1}Q_{1}+T_{2}Q_{2}-T_{s}Q_{s}+k_{p}(T_{s}-T_{e})=A\frac{dT_{s}h}{dt} \tag{63}\]  
\[Q_{s}=\alpha\sqrt{h} \tag{64}\]  
Substituting (64) into (62),  
\[Q_{1}+Q_{2}-\alpha\sqrt{h}=A\frac{dh}{dt} \tag{65}\]  
Rewriting (63),  
\[T_{1}Q_{1}+T_{2}Q_{2}-T_{s}Q_{s}+k_{p}(T_{s}-T_{e})=A\frac{dT_{s}h}{dt}=AT_{s }\frac{dh}{dt}+Ah\frac{dT_{s}}{dt} \tag{66}\]  
And substituting (62) into (66),  
\[ \begin{split} T_{1}Q_{1}+T_{2}Q_{2}-T_{s}Q_{s}+k_{p}(T_{s}-T_{e})= T_{s}(Q_{1}+Q_{2}-Q_{s})+Ah\frac{dT_{s}}{dt}\\ Q_{1}(T_{1}-T_{s})+Q_{2}(T_{2}-T_{s})+k_{p}(T_{s}-T_{e})=Ah\frac{ dT_{s}}{dt}\end{split}  \tag{67}\]  
The model can also be expressed in function of \(Q_{s}\), starting from (64):  
\[Q_{s}=\alpha\sqrt{h}\to h=\frac{1}{\alpha^{2}}Q_{s}^{2}\rightarrow\frac{dh}{ dt}=\frac{2}{\alpha^{2}}Q_{s}\frac{dQ_{s}}{dt} \tag{68}\]  
Figure 1: Thermal mixing tank. Thus, the complete model would be  
\[ \begin{split}\frac{dQ_{1}(t)}{dt}&=\frac{K_{1}}{\tau_{1 }}u_{1}(t)-\frac{1}{\tau_{1}}Q_{1}(t)\\ \frac{dQ_{2}(t)}{dt}&=\frac{K_{2}}{\tau_{2}}u_{2}(t )-\frac{1}{\tau_{2}}Q_{2}(t)\\ \frac{dh}{dt}&=\frac{1}{A}(Q_{1}+Q_{2}-\alpha\sqrt{h} )\\ \frac{dQ_{s}}{dt}&=\frac{\alpha^{2}}{2Q_{s}}\frac{dh} {dt}\\ \frac{dT_{s}}{dt}&=\frac{1}{Ah}(Q_{1}(T_{1}-T_{s})+Q _{2}(T_{2}-T_{s})+k_{p}(T_{s}-T_{e}))\end{split}  \tag{69}\]  
where the parameters of the thermal mixing tank system are shown in Table 1. Similarly, Table 2 describes the values of the nominal operating point of the system. In (69), it can be seen that \(Q_{s}\) is of order 2 and that \(T_{s}\) is of order 3. The open-loop simulation of the system was carried out using the Simulink tool from Matlab, with a sampling time of 0.5 s and a total simulation time of 50,000 s. The effect of actuator saturation was explicitly addressed in the simulation framework by constraining the control inputs during the design phase. Specifically, the maximum flow rate for each actuator was limited to 4 (m\({}^{3}\)/s). Once the system data were obtained, a linear identification was performed using the classical least squares method to estimate an initial set of parameters \((P_{0})\) for both the outlet flow rate and the outlet temperature. This identification process is as follows:  
\[