## 4 Thermal Mixing Tank System
### Fuzzy Modeling and Fuzzy Control Based on MDMFs Fitted by the FCM Algorithm  
This section describes modeling, identification, and fuzzy T-S control based on MDMFs tuned by means of the FCM algorithm and applied to the same example of a thermal mixing tank system. In order to test whether there is any improvement in the nine rules specified by the traditional method in Section 4.1, we selected seven fuzzy rules defined by MDMFs. Because the design objective for the MDMFs is that they should cover the full working range of the thermal mixing tank system, the uniform data discussed above are used for the FCM algorithm. It should be noted that the data have been normalized to avoid the weight of the temperature in the distances being much larger than the weight of the flow rate due to the numerical difference between these two ranges. The performance of this algorithm was tested with different values of the m parameter, which indicates the degree of overlap between the membership functions. As this parameter is increased, the slopes of the functions become smoother, which is not desirable. After several trials, a value of \(m=2\) was selected, resulting in the MDMFs shown in Figure 17 at the conclusion of the FCM algorithm. The results of the FCM algorithm produce normalized centers that do not correspond to the workspace of the system under study. Therefore, both of the MDMFs must be denormalized in order to be represented on the workspace of the system. Figure 16: Response of temperature T to various setpoint changes using fuzzy control based on one-dimensional membership functions. Figure 17: Representation of the MDMFs obtained by the FCM method. Figure 18 shows the areas of the workspace that are best represented by the different clusters obtained by the FCM algorithm. The centers of the clusters are also shown in the locations determined by the algorithm. One of the cluster centers was intentionally located at point (4, 50), as this is the nominal operating point of the thermal mixing tank system. When performing traditional identification by means of the membership functions fitted with the FCM algorithm, the following identification errors are obtained based on the open-loop data of the thermal mixing tank system:  
\[RMSE(err_{Q})=0.0025,\ \ RMSE(err_{T})=0.0984. \tag{76}\]  
It can be seen that these errors are smaller than those obtained in the previous section. Moreover, this accuracy level was reached with two fewer rules than required when using one-dimensional membership functions, allowing us to affirm an improvement in the modeling and identification of the system. However, having to normalize and then renormalize the samples in order to use this method is a problem that needs to be taken into account. The following fuzzy vector variable z(k) is defined for all methodologies based on MDMFs:  
\[z(k)=\left[ \begin{array}{c}Q_{m}(k)\\ T_{S}(k)\end{array} \right]. \tag{77}\]  
As in the previous section, the incremental state model obtained for the central rule is  
\[S^{(1)}: \text{If}\ z(k)\text{is}\ M^{(1)}\ \text{then}:\] \[x_{a}(k+1)=A_{a}^{(1)}x_{a}(k)+B_{a}^{(1)}\delta\text{u}(k)\] \[y(k)=C_{a}^{(1)}x_{a}(k), \tag{78}\]  
Figure 18: Representation of the cluster centers obtained by the FCM method in the working area of uniform samples. where  
\[A_{a}^{(1)}=\left[ \begin{array}{cccccccccccc}1&0&1.83&1&0&0&0&0&0&0&0&0\\ 0&1&0&0&0&0&0&0&2.26&1&0&0\\ 0&0&1.83&1&0&0&0&0&0&0&0&0\\ 0&0&-0.84&0&1&0&0&0&0&0&0&0\\ 0&0&0&0&0&1&0&0&0&0&0\\ 0&0&0&0&0&0&1&0&0&0&0\\ 0&0&0&0&0&0&0&1&0&0&0&0\\ 0&0&0&0&0&0&0&0&0&0&0\\ 0&0&0&0&0&0&0&0&2.26&1&0&0\\ 0&0&0&0&0&0&0&-1.72&0&1&0\\ 0&0&0&0&0&0&0&0.44&0&0&1\\ 0&0&0&0&0&0&0&0&0&0&0\end{array} \right],B_{a}^{(1)}=\left[ \begin{array}{ c}0&0\\ 0&0\\ 0&0\\ 0&0\\ 0&0\\ 0&0\\ 0&0.0083&-0.0004\\ -0.0008&0\\ 0&-0.3351\\ 0.2935&0.1572\\ -0.1360&0\end{array} \right]. \tag{79}\]  
The C matrix is the same as in the 1 DMFs. The state feedback matrix is calculated using the same algorithm as in Section 4.1.