# Advanced Construction of the Dynamic Matrix in Numerically Efficient Fuzzy MPC Algorithms
## 3 Example
### Experiments
Near \(C_{B}=1\) mol/L and \(C_{B}=1.25\) mol/L, the NMPC algorithm generated a bigger maximal error than the FMPC algorithms. In all three cases, there was no overshoot. It can be noticed that the FMPC1a and FMPC2a algorithms generated responses closer to the ones generated by the NMPC algorithm than the FMPC1 and FMPC2 algorithms. This is because in the algorithms with the advanced construction of the dynamic matrix, the prediction was more accurate, thanks to using the proposed mechanism. It should be, however, emphasized that all the FMPC algorithms used a reliable quadratic programming routine to generate the control action instead of the non-convex, nonlinear optimization utilized in the NMPC algorithm. When comparing the SSE (Sum of Squared Errors), one can notice that the smallest value was obtained with the FMPC2 and FMPC2a algorithms. This is because they used the modified performance index in the optimization problem solved by the algorithm in each time step. We also performed experiments with the changes of the parameters (\(\lambda\) coefficient and the control horizon) of the algorithms, like the ones in [12]. First, the \(\lambda\) coefficient was changed to 0.0001 (Figures 5 and 6). All the algorithms now worked faster than in the previous case (for \(\lambda=0.001\)); the control action was more aggressive, and the maximal errors at the beginning of the experiment were now bigger. However, the relations between the FMPC and NMPC algorithms remained unchanged. It can be also noticed that the differences between the FMPC1a and FMPC2a (and also FMPC1 and FMPC2) algorithms became much smaller compared to the previous experiments. The FMPC1a algorithm was practically as fast as the FMPC2a one. This is because for \(\lambda=0\), both performance indexes (42) and (47) were the same. Thus, the closer the value of the \(\lambda\) coefficient to zero is, the closer the responses generated with the FMPC1a and FMPC2a algorithms should be. The SSE values obtained for all the algorithms were smaller than in the previous case, i.e., for \(\lambda=0.001\). Figure 3: Responses of the control system to changes in the setpoint to \(\overline{C}_{B1}=1\) mol/L and \(\overline{C}_{B2}=1.25\) mol/L and to the change of the disturbance by 10% in the 6 th minute of the experiment; \(\lambda=0.001\); NMPC—red lines (SSE = 1.2900), FMPC1—blue lines (SSE = 1.2764), FMPC1a—magenta lines (SSE = 1.2740). Figure 4: Responses of the control system to changes in the setpoint to \(\overline{C}_{B1}=1\bmod/\mathrm{L}\) and \(\overline{C}_{B2}=1.25\bmod/\mathrm{L}\) and to the change of the disturbance by 10% in the 6 th minute of the experiment; \(\lambda=0.001\); NMPC—red lines (SSE = 1.2900), FMPC2—blue lines (SSE = 1.2230), FMPC2—magenta lines (SSE = 1.2183). Figure 5: Responses of the control system to changes in the setpoint to \(\overline{C}_{B1}=1\bmod/\mathrm{L}\) and \(\overline{C}_{B2}=1.25\bmod/\mathrm{L}\) and to the change of the disturbance by 10% in the 6 th minute of the experiment; \(\lambda=0.0001\); NMPC—red lines (SSE = 1.1913), FMPC1—blue lines (SSE = 1.1679), FMPC1a—magenta lines (SSE = 1.1629). To simplify the optimization problem by reducing the number of decision variables, one can decrease the control horizon \(s\). The responses obtained for different values of the control horizon are shown in Figures 7 and 8 for the FMPC1a and FMPC2a algorithms, respectively. In the case of both algorithms, the control horizon can be shortened significantly, because the obtained responses do not change too much when the control horizon is between \(s=10\) and \(s=35\). However, reduction of the control horizon should be done carefully, because for a too short control horizon, the control performance can get worse. The FMPC1a algorithm, for \(s=5\), compensated the disturbance near \(C_{B}=1.25\) mol/L faster, but achieved the setpoint \(\overline{C}_{B1}=1\) mol/L slightly more slowly.