## 5 Simulations Results
### Results  
The controller performance evaluation includes the analysis of the temporal responses and the corresponding performance indices. The first comparison is presented in Figures 6-9, where the NGPC (Case 1) is compared to the NEGPC (Case 2), for stormy weather disturbances. For both controllers, the set point tracking is particularly good for the \(S_{O2}\), and the \(S_{NH}\) concentration satisfies the legal constraint (Table 4). The responses are very similar, and the only remarkable difference is that for \(S_{O2}\) tracking the NEGPC shows a small offset due to the incorporation of the economic term. The \(OCI\) values (Table 6) are smaller for NEGPC as expected. Secondly, in Figures 10-16 a comparison of the proposed NECLGPC (Case 4) with a NCLGPC (case 3) is presented, also for stormy weather. The responses are again very similar, only showing a small decrease of the manipulated variables for the Case 4 controller, due to the inclusion of the economic term. This is also seen in the \(OCI\) values of Table 6. For these controllers the tracking for \(S_{NO}\) improves achieving a better balance between \(S_{O2}\) and \(S_{NO}\) tracking. The two manipulated variables are shown in Figures 12 and 13 which indicate that suitable control signals \(Q_{a}\) and \(K_{La}\) drive the process to follow the set point, while satisfying the constraints (Equations (4)-(8)) imposed. The rest of constraints for the effluent (Table 4) are also satisfied (Figure 14), ensuring a proper quality of the effluent. Figures 15 and 16 show the evolution of the parameters \(c_{1}\) and \(c_{2}\), where can be seen larger variations in \(c_{1}\) due to the larger variations in \(Q_{a}\). Figure 14: Evolution of \(S_{\rm NH}\) : (left) case 3; (right) case 4. Figure 12: Profile of \(K_{L\it a}\) : (left) case3; (right) case 4. Figure 13: Profile of \(Q_{\it a}\) : (left) case 3; (right) case 4. Figure 15: Evolution of the degree of freedom \(c_{1}\) : (left) case3; (right) case 4. In Table 6, a comparison of different performance indices is shown. Comparing the \(OC1\) for the different case studies, it is possible to observe that the introduction of the economic term in the NECLGPC (case 2) and NEGPC (case 4) improves the economics reducing the \(OC1\) index. For instance, for the storm weather influent it reduces the \(OCI\) from 1292 EUR/d (Case 1) to 1261.1 EUR/d (Case 2) and from 1274.8 EUR/d (Case 3) to 1244 EUR/d (Case 4). This is observed also for different scenarios,  
Figure 16: Evolution of the degree of freedom \(c_{2}:\) (left) case3; (right) case 4. Figure 17: Responses of \(S_{O2}\) and \(S_{NO}\) for the case 5. Figure 18: Profiles of \(K_{La}\) and \(Q_{a}\) for the case 5.  
especially when dry weather influent profile is tested where a reduction of 16% of the \(OCI\) is achieved. In order to maintain the controlled variables at the desired reference value, it is necessary to consume energy, which increases the operating costs. Then, the minimization of the pumping energy (PE) and the aeration energy (AE) produce a deviation respect to the desired set point, since not enough freedom degrees are available to meet both requirements at the same time. This deviation is tolerated while the constraints required for the effluent quality are fulfilled. As general remark, note that there is a small tracking offset in the dissolved oxygen in cases 2 and 3, because of the lack of degree of freedom to minimize costs and perform good tracking simultaneously. In this process there are only two manipulated variables to control two variables and optimize costs.To overcome this problem, either additional degree of freedom could be added by incorporating extra manipulated variables, or a tracking objective can be eliminated, allowing to that variable a free evolution between lower and upper limits. The Figures 17, 18 and 19 presents the case study named case 5, where tracking of NO has been eliminated to leave an additional degree of freedom.