energies Article Design of Feedback Control Strategies in a Plant-Wide Wastewater Treatment Plant for Simultaneous Evaluation of Economics, Energy Usage, and Removal of Nutrients Abdul Gaffar Sheik 1 , Eagalapati Tejaswini 1 , Murali Mohan Seepana 1 , Seshagiri Rao Ambati 1, *, Montse Meneses 2 and Ramon Vilanova 2, * 1 Department of Chemical Engineering, National Institute of Technology, Warangal 506 004, Telangana, India; gskabdul@student.nitw.ac.in (A.G.S.); tejaswini.e@student.nitw.ac.in (E.T.); murali@nitw.ac.in (M.M.S.) 2 Department of Telecommunication and System Engineering, Universitat Autonoma de Barcelona, 08193 Barcelona, Spain; Montse.Meneses@uab.cat * Correspondence: seshagiri@nitw.ac.in (S.R.A.); ramon.vilanova@uab.cat (R.V.) Abstract: Simultaneous removal of nitrogen and phosphorous is a recommended practice while treating wastewater. In the present study, control strategies based on proportional-integral (PI), model predictive control (MPC), and fuzzy logic are developed and implemented on a plant-wide wastewater treatment plant. Four combinations of control frameworks are developed in order to reduce the operational cost and improve the effluent quality. As a working platform, a Benchmark  simulation model (BSM2-P) is used. A default control framework with PI controllers is used to  control nitrate and dissolved oxygen (DO) by manipulating the internal recycle and oxygen mass Citation: Sheik, A.G.; Tejaswini, E.; transfer coefficient (KL a). Hierarchical control topology is proposed in which a lower-level control Seepana, M.M.; Ambati, S.R.; framework with PI controllers is implemented to DO in the sixth reactor by regulating the KL a of Meneses, M.; Vilanova, R. Design of the fifth, sixth, and seventh reactors, and fuzzy and MPC are used at the supervisory level. This Feedback Control Strategies in a supervisory level considers the ammonia in the last aerobic reactor as a feedback signal to alter the Plant-Wide Wastewater Treatment DO set-points. PI-fuzzy showed improved effluent quality by 21.1%, total phosphorus removal Plant for Simultaneous Evaluation of rate by 33.3% with an increase of operational cost, and a slight increase in the production rates of Economics, Energy Usage, and Removal of Nutrients. Energies 2021, greenhouse gases. In all the control design frameworks, a trade-off is observed between operational 14, 6386. https://doi.org/10.3390/ cost and effluent quality. en14196386 Keywords: supervisory layer; BSM2 model; model predictive control; fuzzy controller; opera- Academic Editor: Sang-Eun Oh tional cost Received: 16 August 2021 Accepted: 28 September 2021 Published: 6 October 2021 1. Introduction The increase in the global population and urbanization has emanated in an increase Publisher’s Note: MDPI stays neutral in the use of water and therefore in the production of contaminated water (wastewater). with regard to jurisdictional claims in This causes the effect of the water cycle and generates disorder in natural functioning. The published maps and institutional affil- intensification of the demand for clean water with deficient water resources has eventually iations. resulted in a growing interest towards resource recovery during the treatment of wastewa- ter. It is perceived that valuable resources like clean water, energy, and nutrients can be recovered from wastewater [1]. This leads to the progression of wastewater treatment plants (WWTP) into a water resource recovery facility (WRRF) [2]. Modelling and control of Copyright: © 2021 by the authors. WWTPs generated a lot of interest among the wastewater community to increase flexibility Licensee MDPI, Basel, Switzerland. and reduce the costs while operating WWTPs. WWTP’s are intricate because of chemical This article is an open access article and biological interactions in between the processes, the peculiar nature of microbes, a distributed under the terms and disorder of concentrations, and dynamic rates of flow [3,4]. Among all the benchmark conditions of the Creative Commons simulation models, BSM1-P is a platform with a defined plant layout, bioprocess models Attribution (CC BY) license (https:// (activated sludge models (ASM)), influent loads, sensors, and actuators. Hence, BSM1-P creativecommons.org/licenses/by/ platform allows unbiased comparison of carbon, nitrogen, and phosphorus removal in 4.0/). Energies 2021, 14, 6386. https://doi.org/10.3390/en14196386 https://www.mdpi.com/journal/energies Energies 2021, 14, 6386 2 of 19 activated sludge control strategies [5,6]. Based on the models of WWTPs, plant-wide mod- els take the attention of researchers for a long time run as the whole plant is understood by considering all process interactions [7–9]. Different plant-wide models are studied in the literature, which includes sludge control approaches, biogas production in primary settler, handling of the anaerobic digester, and phosphorus modeling with interactions of sulfur and iron cycles [10–17]. In the literature, many control applications like fuzzy logic controller (FLC), model predictive controller (MPC), proportional-integral (PI), and ammonia-based aeration control (ABAC) with different hierarchical combinations of PI, MPC, and fuzzy were studied, and it is observed that there is a trade-off between opera- tional cost and effluent quality [18–21]. Maheswari et al. (2020) designed the nested control loop on three-stage biological treatment for ammonia changes and they observed that Efflu- ent Quality Index (EQI) is improved with higher operational costs [22]. Shiek et al. (2021) implemented an ammonia-based aeration control (ABAC) with four different combina- tions of controllers like PI-MPC, MPC-MPC, PI-fuzzy, and MPC-fuzzy, which resulted in a tradeoff between Operational Cost Index (OCI) and EQI. In their study, the ammo- nia removal rate was improved by 18% in the case of MPC-MPC but P removal was not affected much [23]. Based on the benchmark simulation model on the plant-wide model (BSM2), different control applications like PI, artificial neural network (ANN), and sludge-based strategies, hierarchal control approaches are reported [24,25]. It was reported that the application of FLC improves EQI by 8% and reduces the aeration energy consumption up to 13%. Revollar et al. (2020) implemented a cascade strategy by using PI control with DO and ammonia on the BSM2 platform, and they noticed a 9% improvement on operational cost [26]. Barbu et al. (2017) implemented controllers for DO, ammonia, and TSS (total suspended solids) on the BSM2-G (greenhouse gas emission) platform, and as a result, an improved EQI of 11% and reduced OCI of 7.7% were achieved [27]. Supervisory control approaches on BSM2 are developed with different combinations of PI, MPC, and fuzzy, and it was found that PI-MPC showed a reduced OCI of 6.7%. Similarly, PI-fuzzy provided an improved EQI of 9.2% [28]. Even though many researchers designed control approaches based on BSM2, controllers design based on BSM2-P is limited. The benchmark simulation model (BSM2-P) is an integrated version of BSM1-P that includes both water and sludge treatment process units [29] and BSM2. In the BSM2-P framework, PI-based controlling DO in the sixth reactor and cascade PI in the control of ammonia and total suspended solids were developed and it was found that OCI and EQI are in the trade-off. Closed-loop control showed an improved result when compared with open-loop operation [30]. Sludge management strategies like bio-solids beneficiation facility (BBF) are studied to improve solubility, sludge dewaterability, and handle high sludge loads with change in the microbial population [31]. To the best of the authors’ knowledge, advanced hierarchical control strategies are not implemented on the BSM2-P plant level layout to improve effluent quality and operational costs. On this note, the present work focuses on implementing advanced hierarchical control strategies based on MPC, fuzzy controllers; and the plant performance is evaluated by developing different control approaches. A lower-level control strategy is developed for DO control in the sixth reactor by manipulating the KL a of the fifth, sixth, and seventh reactors in the biological treatment process. PI controller is used at the lower level, whereas fuzzy and MPC are used at the supervisory level. The supervisory level is based on the ABAC to determine the dissolved oxygen set-point. EQI; OCI; percentage of nutrient removals; and production rates of methane, carbon dioxide, and hydrogen are studied while evaluating the control strategies. 2. Materials and Methods This section provides an explanation of the working regime of BSM2-P with details of the performance/economy assessment and indices. Model creation and simulation are performed using MATLAB/SIMULINK. Energies 2021, 14, 6386 3 of 19 2.1. Influent Data Model-based influent load generation as elucidated in [2,32,33] is used to generate dynamic influent load data to execute the performance of plant-wide scenarios of the wastewater treatment plants. The daily average dynamic mass flow rates are provided in Table 1. More information about the handling of influent generation is illustrated in [15,34,35]. Dynamic simulations are performed for 609 days with steady-state simulation for 300 days. S:COD is the ratio of added sulphate [2]. The last 1-year data are used for performance assessment of the plant. State variables of ASM2d, units with notations, and average influent data are reported in the Supplementary data Table S1. Table 1. Average data of dynamic mass flow rates. Dynamic Mass Flow Rates Average Data Chemical oxygen demand (COD) 8386 kg/d Nitrogen 1014 kg N/d Phosphorus 197 kg P/d S:COD 0.003 kg S Kg/COD 2.2. Model Scenario The plant-wide model of BSM2-P has a resemblance to BSM2 plant [9] but a modifi- cation is carried out in the activated sludge unit (ASU). In ASU, two anaerobic reactors are added ahead of anoxic and aerobic reactors (A2 /O) to enhance phosphorus removal and to improve PAO’s with a competitive dominance over other nitrogenous bacteria. The plant-wide model of BSM2-P consists of ASU, primary (PSU) and secondary (SSU) sedimentation units, Thickener (THK), anaerobic digestion (ADU) unit, storage (SU), and dewatering (DU) unit, with internal and external recycles. Figure 1 depicts the plant-wide model of BSM2-P and Table 2 represents each process unit of WWTP of BSM2-P with their working function and physical configurations. The internal recycle is maintained at three times the influent data, and sludge flow is at the rate of 600 m3 /d. Figure 1. Proposed plant-wide model layout based on BSM2-P. Energies 2021, 14, 6386 4 of 19 Table 2. Attributes of plant-wide model processes units and physical configurations. Process Unit Working Function References Configurations PSU Non-reactive [36] 900 m3 Double-exponential SSU [37–40] 6000 m3 velocity function reactive ASU ASM2d [32,41] 4500 m3 ADU ADM1 [42] 3400 m3 THK Reactive [7,43] Underflow 30.9 m3 /d 9.6 m3 /d sludge and DU Reactive [7,43] 168.9 m3 /d reject water SU Non-reactive [7] 160 m3 2.3. Plant-Wide Assessment Criteria 2.3.1. Effluent Quality Index The Effluent Quality Index (EQI) defines the amount of effluent to surface waters averaged over the assessment time interval related to the weighting factors of discharge loads of composition. The EQI (kg pollutants units/D) [2,7] is integrated with additional phosphorus process reactions, and the pollution composition with individual variables is illustrated below: 1 R tend EQI = T·1000 tstart (θTSS TSSef (t) + θCOD CODef (t) + θNKJ NKJef (t) +θNO SNOef (t) + θBOD5 BOD5ef (t) + θPorg Porgef (t) (1)  +θPinorg Pinorgef (t) Qef (t) dt CODef = SFef + SAef + SIef + XIef + XSef + XB,Hef + XPAOef + XPHAef (2) +XB,Aef + iCODS SFe(II)ef + iCODS SISef + iCODX XSO + XSRBef Fe(II) IS SO ef NKJef = SNHef + iNS SFef + iNS SIef + iNX XIef + iNX XSef F I I S  (3) +iNBM XB,Hef + XPAOef + XB,Aef + XSRBef Porgef = XPPef + iPS SFef + iPS SIef + iPX XIef + iPX XSef + F I I S  (4) iPBM XB,Hef + XPAOef + XB,Aef + XSRBef     SFef+ SAef + 1 − fSI XSef + 1 − fXIH XB,Hef BOD5ef = 0.25  (5) + 1 − fXIP XPAOef + XPHAef + 1 − fXIA XB,Aef + XSRBef Pinorgef = SPO4 (6) ef SNOef = SNO3 (7) TSSef = XTSS (8) The subscript ‘ef’ indicates the effluent discharge. θi signifies the weighting factors of different pollutants to convert into basic pollution units, which are tabulated in Table 3. iCODi denotes the COD compounds, iNi denotes the nitrogen compounds, iPi denotes the phosphorus compounds, T signifies the total assessment time interval (364 days), and Qef denotes the discharge flow rate (m3 /d). The corresponding conversion factors for fi are reported in [2,5,32,41]. All the concentrations are addressed in g/m3 units. Energies 2021, 14, 6386 5 of 19 Table 3. Weighting factors for EQI. Weighting Factors of EQI (θi ) Weighting factors θTSS θCOD θNKJ θNO θBOD5 θPorg θPinorg Value 2 1 30 10 2 100 100 2.3.2. Operational Cost Index (OCI) Operational cost is a weighted summation of costs associated with the production of sludge (SP) (kg ss/d), methane (PM) (kg.CH4 /d), pumping (PE), aeration (AE), mixing (ME), and heating (HE) energies (KWh/d); internal and external recycles are provided (m3 /d). All individual components are addressed in [2,7]. Thus, the OCI is estimated as OCI = AE + PE + zPS ·SP + ME − zPM ·PM + max(0, HE − 7PM) (9) where zi denotes the weighting factors; zPS is 3 and zPM is 6. Aeration, pumping, and mixing energies are addressed in Equations (10), (11) and (13). Here, aeration power is needed to aerate bioreactors; pumping is used to alter the flow rate from one end to another end and for internal, external flow patterns [2,7]. The aeration energy (AE) is described as (kWh/d): Ssat Z t 7 f AE = O 1800·T ∑ Vi ·KL ai (t) dt to i=1 (10) where KL ai signifies the oxygen mass transfer coefficient, Vi notifies the volume of the reactors and oxygen saturation coefficient. T is the length of evaluation time (364 days). The pumping energy (PE) is defined as (kWh/d): 1 R tf PE = T to 0.004·Qint + 0.008·Qr + 0.050·Qw + 0.075·QPU + 0.060 QTU (11) +0.004·QDO dt where Qintr is the internal recycle (m3 /d), Qexr is the external recycle (m3 /d), Qw is the waste flow (m3 /d), QPU is the primary clarifier underflow, QTU is the thickener underflow, and QDO is the dewatering overflow. The sludge production (SP) is expressed as (kg/d):  Z t  1 f SP = · XTSS (tf ) − XTSS (to ) + TSSX (t)QX (t) dt S (12) T·1000 to XTSS (t) = XTSS, ASU (t) + XTSS, SSU (t) + XTSS, PSU (t) +XTSS, ADU (t) +XTSS, SU (t) S with XTSS,X (t) = TSSX (t)·VX . Where QX (t) is the sludge flow and TSSX is the total amount of solids in the sludge flow stream (after dewatering in BSM2-P). XTSS is elucidated as the sum of TSS mass present in an individual process unit. The subscripts refer to the concern process units. The mixing energy (ME) is defined as (kWh/d): The mixing is highly necessary to avoid the biomass settling in the non-aerated and aerated reactors like all ASU tanks; anaerobic digester and the mixing energy (ME) is defined as (kWh/d): ME = MEASU + MEADU (13) where Ztf " # 24 i=7 if KL ai < 20d−1 0.005·Vi MEASU = T ∑ i−1 if KL ai ≥ 20d−1 0 ·dt to Energies 2021, 14, 6386 6 of 19 MEADU = 24·0.005·VADU where, Vi is the ith tank volume (m3 ) and 0.005 kW/m3 is the mixing power consumption factor in ASU. VADU is the volume of liquid in ADU and the mixing power consumption factor 0.005 kW/m3 . Methane production (kg CH4 /d) is defined as: The average methane production per day value is defined by using Equation (14). Ztf Patm ·16 1 PM = ·Pg,CH4 (t)·Qg (t)·dt (14) T·R·TOT Ptg (t) to where, PgCH4 (bar) is the partial pressure of methane gas produced in the headspace; R denotes the universal gas law constant i.e., 8.3145.10−2 bar m3 kmol−1 k−1 ; TOT repre- sents the operating temperature of the digester (308.15 K); Ptg is the total gas pressure in the headspace; Patm is atmospheric pressure (1.013 bar); and Qg is the gas flow rate of produced gas. Net heating energy is described as: HEnet = max(0, HE − 7·PM) (15) where HE is the amount of energy required to get the anaerobic digester up to operating temperature, as shown in the below Equation (16): Z t 24 f HE = PH2O ·CH2O ·(TOT − Tadu,i (t))·Qad (t)·dt (16) 86400·T to TPSU ·QPSU (t) + TTHK (t)·QTHK (t) TADU,i = QADU (t) Here, QADU (t) = QPSU (t) + QTHK (t). Where, PH2O is the density of water (1000 kg/m3 ), CH2O is the specific heat capacity of water (4.186 KJ kg−1 0 C−1 ). Tad,i is the temperature of ADU influent, and TOP is the optimal temperature of ADU. Qad is the flow rate to the ADU (m3 /d). Following stringent regulations is a top priority for wastewater treatment plants. The legal constraints to be followed are the same as BSM1, i.e., TP is less than 2 gP/m3 ; TN is less than 18 gN/m3 ; biological oxygen demand (BOD5 ) is less than 10 g/m3 ; COD is less than 100 gCOD/m3 ; TSS is less than 30 g/m3 ; and SNH is less than 4 gN/m3 . 3. Control Approaches 3.1. Design of Proportional-Integral (PI) Controller The PI controllers can be framed using a wide variety of techniques accessible in the literature. In the present work, the Skogested internal model control (SIMC) method is used to design the PI controllers [44]. The first-order plus time order delay (FOPTD) model as prescribed in Equation (17) is identified for the design of the PI controllers for each loop. KP e−θds G(s) = (17) τp S + 1 where, KP denotes the process gain, θd denotes the delay, and τp signifies the time constant of the system. For more clarification, the method of approach is depicted in the flow diagram in the Supplementary data Figure S1. The identification method and designed controllers are elucidated distinctly. Figure S2 depicts the PI controller in the wastewater flow diagram. Energies 2021, 14, 6386 7 of 19 3.2. Design of Model Predictive Controller (MPC) MPC is a well-known advanced controller in which the objective is to predict the future move of the variable of significance and by using optimization, the corresponding control moves are determined systematically. At each control time interval, MPC predicts the nature of the variables of outputs over the prediction horizon (P). The control move sequence is computed over the control horizon (M) based on output predictions [23,45]. A quadratic cost function (Q) is selected for the operation of MPC, which is defined in the mode of Equation (18). P M Q= ∑ ||ΓL (L(A + l/A) − r(A + l))||2 + ∑ ||Γ∆v (∆v(A + l − 1))||2 (18) i=1 i=1 Here, ΓL and Γ∆v denotes the input and output rate weights respectively. L(A + l/A) is the controlled variable output at the future time interval of A + l, where the model is predicted at a particular time of A. The identification method and designed controllers are elucidated distinctly. Figure S3 depicts the MPC controller in the wastewater flow diagram. The third order state-space model of the system as shown in Equations (19) and (20) is as below: x(A + 1) = Gx(A) + Nu(A) (19) y(A) = Sx(A) + Zu(A) (20) Here x(A) signifies the state of vector, and G, N, S, and Z denote the state-space matrices. 3.3. Design of Fuzzy-Logic Controller (FLC) Fuzzy logic is a widely used tool in a variety of control applications. FLC’s have been used in all stages of wastewater treatment processing. According to the literature, the most advanced control and processing units in WWTP are solved using fuzzy control or rule (FLC). This is achieved by employing fuzzy rules that are identical to those used in human inference design. FLC is used on the WWTP in this study [19,23]. Figure S4 depicts the FLC controller in the wastewater flow diagram. 4. Results and Discussion Implementation of control strategies on plant wide-models: The results after imple- menting all the four control strategies are discussed here. 4.1. PI Control (2 Loops) In ASU, SO,7 , in the last aerobic tank (tank7), and SNO,4 , in the second reactor of anoxic (tank 4), are controlled. The corresponding input variables are mass transfer coefficient (KL a) and internal recycle (Qintr ). The set points are chosen according to the requirements of the WWTP. Usually, the value of SO,7 in the oxic reactor is retained in the range of 1.5 to 4 gO2 /m3, and the practiced value is 2 gO2 /m3 . Similarly, the advisable working values for the nitrate levels in the anoxic tank are in the range of 1–3 gN/m3 and the practiced value is 1 gN/m3 [21]. The corresponding control relevant models are developed using the attained open-loop data for each SNO,4 and SO,7 control loops. For the values of 88,000 and 73, the concentrations of NO and DO are reported as 2 gO2 /m3 and 1 gN/m3 respectively. In the seventh and fourth reactors, a random input signal with a ±10% variation in these values is given and the attained output data for NO and DO are collected. The NO and DO output data are now used to build state-space models and also first-order plus time order delay (FOPTD) models using the method of prediction error minimization. Based on these models, each loop is equipped with PI controllers that are designed using SIMC [44]. The respective obtained FOPTD model parameters are: NO loop: KP = 0.000026144, τp = 0.012515, and θd = 0.000875. DO loop: KP = 0.04538, τi = 0.010085, and θd = 0. Energies 2021, 14, 6386 8 of 19 Based on these models, PI controllers are designed using the SIMC method and are obtained for NO and DO loops like Kc =35748.16, Ti = 0.01215, Kc =11.015, and Ti = 0.010085 respectively. With these controllers, the plant-wide model is simulated and the correspond- ing simulation results are given in Section 4.4. The resultant tracking performance of SO and SNO is depicted in Figure 2A,B. The default control approach associate with two control loops is shown in Figure 3A. Figure 2. Set-point tracking for: (A) dissolved oxygen and (B) Nitrate. 4.2. PI Control (One Loop) In this approach, a close-loop control framework contains a single PI controller as shown in Figure 3B. According to this scheme, SO in the sixth tank is maintained at a set- point of 2 mgO2 /l by regulating the KL a6 . In addition, the oxygen mass transfer coefficients entering tank 5 and tank 7 are multiplied by a factor of 1 and 0.5, respectively, to have improved manipulation and thus efficient aeration in these tanks [30]. 4.3. Ammonia-Based Aeration Control (ABAC) Approach In this approach, cascade configuration, as shown in Figure 3C, is used, in which MPC/Fuzzy controllers for ammonia (SNH,6 ) control are used by manipulating SO,6 set point in the aeration tank 6. Here, SO,6 in aeration tank 6 is controlled by regulating the airflow rates of reactors 5, 6, and 7 as implemented in strategy 2. PI controller is designed Energies 2021, 14, 6386 9 of 19 at the lower level with combinations of fuzzy and MPC at the supervisory level. PI-MPC and PI-fuzzy combinations are proposed as overall control structures. The corresponding list of all four different control approaches is listed in Table 4. Figure 3. Control frameworks for BSM2-P: (A) PI controllers, (B) Lower level control, (C) Supervisory level control framework with a lower level. Table 4. Functioning of control strategies. PI (Lower Level) + PI (Lower Level) + PI controller (Two PI controller (One Attributes MPC (Supervisory Fuzzy (Supervisory Loops) Loop) Level) Level) Controlled variable SO,7 and SNO,4 SO,6 SNH,6 SNH,6 DO set-point is DO set-point is Set-point 2 gO2 /m3 1 gN/m3 2 gO2 /m3 determined by higher determined by higher level level KL a7 and internal KL a in the last three Set-point for DO Set-point for DO Regulating variables recycle reactors controller controller Controller design PI PI PI and MPC PI and Fuzzy Energies 2021, 14, 6386 10 of 19 4.3.1. PI-MPC Control Strategy Here, PI controller is implemented for BSM2-P at the lower level and MPC is im- plemented in the supervisory layer. To design MPC in the supervisory layer, system identification of the model in the supervisory layer is carried out. In which, the SO set-point is varied by ±10% around the operating point, and the resulting SNH concentration values are collected. The prediction error method is used to identify a third order state-space model based on this data set [46]. The identified state-space model for the supervisory layer is expressed below Equation (21): −0.09427     0.7231 0.1351 −0.03826 A =  −0.3957 −0.2845 0.01298  B =  −0.75    −1.994 (21) −0.0068 −0.0477 −0.1704   C = 1.306 0.074 −0.01624 D = [0] Based on this model, MPC is designed with a sampling time of control as 0.05 days (72 min); prediction and control horizons of 10 and 2, respectively; and rate of change of regulated variable as 0.1. The corresponding results are given in Figure 4 in which the computed values of SO by supervisory MPC controller and its tracking by the lower-layer controller for 245–252 days are shown. The performance evaluation was done in the period of 245–609 days. Figure 4 depicts that a good supervisory set-point tracking is achieved by using the PI-MPC controller design framework in the sixth bioreactor. The resultant average concentrations of nutrient removal, energy usages, and greenhouse gas emissions, and performance of the plant with cost assessment are reported in Section 4.4 and compared with the other three control frameworks. Figure 4. Dissolved oxygen tracking in the sixth reactor (PI-MPC). 4.3.2. PI-Fuzzy Control Strategy In this case, the fuzzy controller manipulates the SO set-points at a supervisory layer to minimize ammonia peaks. The membership functions (MF) of SO,6 and SNH,6 are considered in the range of 0–4 mg O2 /l and 0.1–20 mg N/l, respectively. The MF’s for both input and output variables are in a Gaussian bell-shaped curve, which is divided into three linguistic variables, “high,” “low,” and “medium,” as shown in Figure 5A,B. A total of three rules are considered according to the SO control loop requirement [23,28]. • If SNH level is “low”, then SO level is “low” Energies 2021, 14, 6386 11 of 19 • If SNH level is “high”, then SO level is “high” • If SNH level is “medium”, then SO level is “medium” The corresponding linguistic variables for “high,” “low,” and “medium,” are given in Table 5. With these controllers, closed-loop simulations are carried out and the results are given in Figure 5C. It can be observed that a good supervisory set-point tracking is achieved by using the PI-fuzzy controller design framework. The effluent quality and operational cost details along with other quantitative results are given in Section 4.4. Table 5. Linguistic functions and MF’s for control inputs and outputs. Linguistic Variable (Output) Linguistic Value Range MF Characteristic Ranges 1 Lower Gaussian bell-shaped shaped 0.175 5.4 0.11 2 Medium Gaussian bell-shaped shaped 1.06 5.87 1.36 3 Higher Gaussian bell-shaped shaped 3.56 18 6 Linguistic Variable (Input) Linguistic Value Range MF Characteristic Ranges 1 Lower Gaussian bell-shaped shaped 1.89 9.18 0.034 2 Medium Gaussian bell-shaped shaped 1.02 7.75 2.96 3 Higher Gaussian bell-shaped shaped 8.26 42.2 12.36 4.4. Comparison of Four Control Design Frameworks on BSM2-P Nitrification oxidizes ammonium to nitrate, and denitrification reduces nitrate to nitrogen gas. Then a high DO improves nitrification, but an excess of nitrate perhaps is not fully denitrified in the anoxic reactors due to a lack of COD. Moreover, phosphorous removal is largely influenced by dissolved oxygen, which is directly proportional to the formation of orthophosphates. The effluent concentrations of ammonia, TN, TP, and TSS are compared for all four control frameworks with their corresponding pollutant limit value. These are depicted in Figure 6A–D. Figure 5. Cont. Energies 2021, 14, 6386 12 of 19 Figure 5. Membership functions rules: (A) Output, (B) Input, and (C) corresponding tracking performance. Based on the simulation results of all four control designs [PI controllers (two loops), PI controller (one loop), PI–MPC at supervisory level, and PI–fuzzy at a supervisory level], the corresponding average values of effluent concentrations are given in Table 6. From Table 6, comparing with only lower-level controllers, the ammonia, TP, TSS, and TN removal concentrations are improved. For ammonia, TP, TSS, and TN, the removal efficiency is improved by 36%, 33.6%, 1.02%, and 11.3% in PI-MPC, PI-fuzzy, PI (one loop), and PI (two loops) respectively. Energies 2021, 14, 6386 13 of 19 Table 6. Comparison of average concentration values of effluent discharge for four control strategies. PI Controller PI Controller Parameters PI-MPC PI-Fuzzy (Two Loops) (One Loop) SNH 1.05 0.96 0.57 1.28 TSS 15.39 15.54 15.38 16.23 TN 9.07 9.81 9.86 8.7 TP 4.54 4.05 4.4 2.69 COD 42.17 42.04 42.17 41.95 BOD5 2.43 2.42 2.45 2.50 IQI 97,875.71 97,875.71 97,875.71 97,875.71 EQI 14,625.98 13,715.37 14,391 10,824.9 Average production rates Methane 1029 1024 1035 1438 Hydrogen 0.00392 0.00393 0.0039 0.0041 Carbon dioxide 1504 1527 1517 1640 Gas flow 2630 2635 2646 2722 OCI 10,959.1 10,949 11,810 11,007 Average percentage of Violations TP 86.71 72.5 70.4 38.4 NH 2.71 3.12 0.21 1.28 TSS 0.025 0.062 0.048 0.58 BOD5 — – – 0.0085 Nremoved /OCI 0.08131 0.0800 0.0740 0.0815 Premoved /OCI 0.01044 0.0113 0.0098 0.0139 Figure 6. Cont. Energies 2021, 14, 6386 14 of 19 Figure 6. Cont. Energies 2021, 14, 6386 15 of 19 Figure 6. The effluent concentrations of (A) ammonia, (B) TN, (C) TP, (D) TSS, and (E) bar graph for all (SP, AE, PE, ME, HE, and consumed energy (CE)) the operational plant performance parameters are compared for four control frameworks with their corresponding average values. Figure 6E depicts the average values of energy usages like aeration, pumping, mixing, heating, consumed energies (kwh/d), and sludge production rate (kg ss/d). From the graph, it was observed that energy consumption was high in the case of PI-MPC and low in the case of the PI-fuzzy controller. The sludge production rate and heat energy are high with the PI-fuzzy controller. In comparison, the fuzzy controller shows less aeration energy to obtain better nutrient removal with a slight increase in the cost. In the literature, also it was showed that the fuzzy control is favorable for better removal of phosphorous. In comparison, PI (one loop) and PI-fuzzy showed an improved EQI of 21.1% with a 0.52% increase in OCI. In the comparison of all four control strategies, there is a trade-off between OCI and EQI. Overall, in comparison with the PI (one loop) controller, ammonia removal is improved with PI-MPC, and TP is improved with PI-fuzzy strategies. In both cases, PI-MPC and PI-fuzzy showed improved EQI with an increase of OCI. The corresponding greenhouse gases like methane, hydrogen, and carbon dioxides of averages Energies 2021, 14, 6386 16 of 19 production rates are also reported in Table 6. It is noticed that PI-fuzzy shows high methane, hydrogen, carbon dioxide, and gas flow production rates of 28.7%, 4.87%, 6.8%, and 3.2% in comparison with PI (one loop). PI-fuzzy and PI-MPC showed good improvement in minimizing the percentage of violations in TP and ammonia. The percentage of violations is also reported in Table 6. PI-fuzzy showed good removal efficiency in the phosphorus. Moreover, PI-fuzzy showed lower OCI when compared with PI-MPC. 4.5. Summary of Previous and Present Studies on BSM2-P For the biological seven-reactor A2O process, different control frameworks have been designed [47,48]. Optimal set-points are computed by higher-level control loops [49,50]. In [30] used BSM2-P as a simulation platform. PI controllers are designed to control DO by regulating the oxygen mass transfer coefficient with additional aeration-based ammonia controller and TSS control by regulating the external recycle. The control strategy showed significant improvement in both effluent quality and operating costs. The designed controllers showed improved EQI of 31% with decreased OCI of 6.9% when compared with open loop. As far as pollutant concentration is concerned, TN and TP are improved by 17% and 42.1% respectively. In the present work, an ammonia-based aeration controller at the supervisory level is designed. By using two different control combinations, PI-MPC and PI-fuzzy, the performance is compared with [30] PI-fuzzy showed improved EQI of 13.5% with an increase of 13.6% OCI. Phosphorus and TN removal are improved by 29.7% and 5.4%, respectively, with the PI-fuzzy control framework and produce better EQI. PI-fuzzy shows a high production rate of methane when compared to [30]. 5. Conclusions In this study, MPC and fuzzy were designed at the supervisory level, and PI was designed for lower-level control for BSM2-P in ASM2d as an activated sludge model. A total of four control frameworks were implemented to evaluate and test the plant performance, concentrations, as well as effluent quality. The resultant performance indices were compared with the PI strategy. In each control application case, there was a trade-off between EQI and OCI. In comparison with PI (one loop), PI-fuzzy showed an improved EQI of 21.1% with a 0.52% increase in OCI. Of all the compared outcomes, PI-fuzzy showed better EQI and increased OCI. When comparing all four control strategies, it was reported that average effluent pollutant concentrations like BOD5 , COD, TN, ammonia, and TSS attained the regulatory limits, except for phosphorus. Optimized ammonia removal was noticed in PI-MPC, whereas better optimized phosphorous removal was noticed in PI-fuzzy. PI-fuzzy showed high production rates of greenhouse gas emissions and low consumption of aeration energy. The percentage of violations of total phosphorus was less in the case of PI-fuzzy. Supplementary Materials: The following are available online at https://www.mdpi.com/article/ 10.3390/en14196386/s1, Figure S1: Systematic procedure for model identification and control im- plementation, Figure S2: A simple PI controller in WWTP, Figure S3: Model Predictive Controller scheme in WWTP, Figure S4: A classical Fuzzy controller in WWTP, Table S1: State variables of ASM2d, units with notations, and average influent data. Author Contributions: Conceptualization, A.G.S., R.V. and S.R.A.; methodology, A.G.S., E.T., M.M., M.M.S., S.R.A.; software, A.G.S.; validation, A.G.S., M.M., R.V., S.R.A. and E.T.; formal analysis, A.G.S., M.M., M.M.S., R.V., S.R.A.; investigation, A.G.S., M.M., R.V., S.R.A. and E.T.; resources, A.G.S., M.M., R.V., S.R.A. and M.M.S.; data curation, A.G.S. and E.T.; writing—original draft preparation, A.G.S., E.T.; writing—review and editing, M.M., R.V., M.M.S., S.R.A. and E.T.; supervision, M.M.S., R.V., S.R.A.; project administration, M.M.S., R.V. and S.R.A.; funding acquisition, M.M., R.V. All authors have read and agreed to the published version of the manuscript. Energies 2021, 14, 6386 17 of 19 Funding: This research was funded by the Catalan Government under Projects 2017 SGR 1202. The APC was funded by the Spanish Government under Project PID2019-105434RBC33 co-funded with European Regional Development Funds of the European Union. Data Availability Statement: Data is available upon request from the authors. Acknowledgments: Xavier Flores-Alsina, Senior Researcher, Denmark Technical University, Den- mark, is acknowledged for sending the BSM2-P Matlab/Simulink codes. Conflicts of Interest: The authors declare no conflict of interest. Nomenclature AE Aeration Energy (Kwh/d) ASM1 Activated Sludge Model No.1 ASM2 Activated Sludge Model No.2 ASM2d Activated Sludge Model No.2d ASM3 Activated Sludge Model No.3 BOD5 Biological Oxygen Demand COD Chemical Oxygen Demand DO Dissolved Oxygen EQI Effluent Quality Index IQI Influent Quality Index K Proportional gain KL a Oxygen transfer coefficient TN Total Nitrogen TKN Total Kjeldahl Nitrogen TSS Total suspended solids NO Nitrate P Phosphorus PE Pumping Energy (kWh/d) KUt Pollutant load corresponding to component Qo Influent flow rate (m3 /d) Qintr Internal recycle flow rate (m3 /d) Qr Return sludge flow rate (m3 /d) Qw Waste sludge flow rate (m3 /d) SA Fermentation products (g COD/m3 ) SF Readily biodegradable organic substrate SHCO Alkalinity of the waste water (HCO3 /m3 ) SI Inert soluble organic material (g COD/m3 ) SNH Ammonium and ammonia nitrogen (g N/m3 ) SNO Nitrate and nitrite nitrogen (g N/m3 ) SN2 Dinitrogen (g N/m3 ) SPO4 Inorganic soluble phosphate (g P/m3 ) SS Readily biodegradable organic substrate (g COD/m3 ) to Start time tf End time BODef Total BOD concentration CODef Total COD concentration SNO Nitrate concentration SPorg Total N concentration SPinorg Total phosphorus concentration TKN Total organic N concentration WWTP Wastewater Treatment Plant XA Nitrifying organisms (g COD/m3 ) XH Heterotrophic organisms (g COD/m3 ) XI Inert particulate organic material (g COD/m3 ) XS Slowly biodegradable substrates (g COD/m3 ) XPAO Poly accumulating organisms (g COD/m3 ) Energies 2021, 14, 6386 18 of 19 XPHA Cell internal storage product of PAO’S (g COD/m3 ) XPP Polyphosphate (g P/m3 ) XSTO Cell inner storage product of heterotopy XTSS Suspended solids (g SS /m3 ) References 1. Matejczyk, M.; Ofman, P.; Dabrowska, ˛ K.; Świsłocka, R.; Lewandowski, W. The study of biological activity of transformation products of diclofenac and its interaction with chlorogenic acid. J. Environ. Sci. 2020, 91, 128–141. [CrossRef] [PubMed] 2. Solon, K. Extending Wastewater Treatment Process Models for Phosphorus Removal and Recovery: A Framework for Plant-Wide Approach of Phosphorus, Sulfur and Iron. Ph.D. Thesis, Lund University, Sweden, 2017. 3. Asadi, A.; Verma, A.; Yang, K.; Mejabi, B. Wastewater treatment aeration process optimization: A data mining approach. J. Environ. Manag. 2017, 203, 630–639. [CrossRef] [PubMed] 4. Olsson, G.; Newell, B. Wastewater Treatment Systems: Modelling, Diagnosis and Control; IWA Publishing: London, UK, 1999. 5. Henze, M.; Gujer, W.; Mino, T.; van Loosdrecht, M.C.M. Activated Sludge Models ASM1, ASM2, ASM2d, and ASM3; IWA Scientific and Technical Report, No. 9; IWA Publishing: London, UK, 2000. 6. Rieger, L.; Koch, G.; Kühni, M.; Gujer, W.; Siegrist, H. The EAWAG bio-P module for activated sludge model no. 3. Water Res. 2001, 35, 3887–3903. [CrossRef] 7. Gernaey, K.V.; Jeppsson, U.; Vanrolleghem, P.A.; Copp, J.B. Benchmarking of Control Strategies for Wastewater Treatment Plants; IWA Scientific and Technical Report, No. 23; IWA Publishing: London, UK, 2014. 8. Nopens, I.; Batstone, D.J.; Copp, J.B.; Jeppsson, U.; Volcke, E.; Alex, J.; Vanrolleghem, P.A. An ASM/ADM model interface for dynamic plantwide simulation. Water Res. 2009, 43, 1913–1923. [CrossRef] 9. Jeppsson, U.; Pons, M.N.; Nopens, I.; Alex, J.; Copp, J.B.; Gernaey, K.V.; Rosén, C.; Steyer, J.P.; Vanrolleghem, P.A. Benchmark Simulation Model No. 2: General protocol and exploratory case studies. Water Sci. Technol. 2007, 56, 67–78. [CrossRef] [PubMed] 10. Barker, P.S.; Dold, P.L. General model for biological nutrient removal activated sludge systems: Model presentation. Water Environ. Res. 1997, 69, 969–984. [CrossRef] 11. Jeppsson, U.; Alex, J.; Batstone, D.; Benedetti, L.; Comas, J.; Copp, J.B.; Corominas, L.; Flores-Alsina, X.; Gernaey, K.V.; Nopens, I.; et al. Benchmark simulation models, quo vadis? Water Sci. Technol. 2013, 68, 1–15. [CrossRef] 12. Ekama, G.A. Using bioprocess stoichiometry to build a plant-wide mass balance based steady-state WWTP model. Water Res. 2009, 43, 2101–2120. [CrossRef] [PubMed] 13. Grau, P.; de Gracia, M.; Vanrolleghem, P.A.; Ayesa, E. A new plant-wide modelling methodology for WWTPs. Water Res. 2017, 41, 4357–4372. [CrossRef] 14. Flores-Alsina, X.; Arnell, M.; Amerlinck, Y.; Corominas, L.; Gernaey, K.V.; Guo, L.; Lindblom, E.; Nopens, I.; Porro, J.; Shaw, A.; et al. Balancing effluent quality, economical cost and greenhouse gas emissions during the evaluation of plant-wide wastewater treatment plant control strategies. Sci. Total. Environ. 2014, 466, 616–624. [CrossRef] 15. Flores-Alsina, X.; Saagi, R.; Lindblom, E.; Thirsing, C.; Thornberg, D.; Gernaey, K.V.; Jeppsson, U. Calibration and validation of a phenomenological influent pollutant disturbance scenario generator using full-scale data. Water Res. 2014, 51, 172–185. [CrossRef] 16. Ruano, M.V.; Serralta, J.; Ribes, J.; Garcia-Usach, F.; Bouzas, A.; Barat, R. Application of the general model Biological Nutrient Removal Model No. 1 to upgrade two full-scale WWTPs. Environ. Technol. 2011, 33, 1005–1012. [CrossRef] 17. Volcke, E.I.P.; Gernaey, K.V.; Vrecko, D.; Jeppsson, U.; van Loosdrecht, M.C.M.; Vanrolleghem, P.A. Plant-wide (BSM2) evaluation of reject water treatment with a SHARON-Anammox process. Water Sci. Technol. 2006, 54, 93–100. [CrossRef] [PubMed] 18. Luca, L.; Pricopie, A.; Barbu, M.; Ifrim, G.; Caraman, S. Control strategies of phosphorus removal in wastewater treatment plants. In Proceedings of the 23rd International Conference on System Theory, Control and Computing (ICSTCC), Sinaia, Romania, 9–11 October 2019; pp. 236–241. 19. Xu, H.; Vilanova, R. PI and fuzzy control for P-removal in wastewater treatment plant. Int. J. Comp. Commun. Control 2015, 10, 176–191. [CrossRef] 20. Hongyang, X.; Pedret, C.; Santin, I.; Vilanova, R. Decentralized model predictive control for N and P removal in wastewater treatment plants. In Proceedings of the 22nd International Conference on System Theory, Control and Computing (ICSTCC), Sinaia, Romania, 10–12 October 2018; pp. 224–230. 21. Shiek, A.G.; Machavolu, V.R.K.; Seepana, M.M.; Ambati, S.R. Design of control strategies for nutrient removal in a biological wastewater treatment process. Environ. Sci. Pollut. Res. 2021, 28, 12092–12106. [CrossRef] [PubMed] 22. Maheswari, P.; Sheik, A.G.; Tejaswini, E.S.S.; Ambati, S.R. Nested control loop configuration for a three stage biological wastewater treatment process. Chem. Prod. Process Model. 2021, 16, 87–100. [CrossRef] 23. Sheik, A.G.; Seepana, M.M.; Seshagiri Rao, A. Supervisory Control Configurations Design for Nitrogen and Phosphorus Removal in Wastewater Treatment Plants. Water Environ. Res. 2021. [CrossRef] [PubMed] 24. Santin, I.; Pedret, C.; Meneses, M.; Vilanova, R. Artificial Neural Network for nitrogen and ammonia effluent limit violations risk detection in Wastewater Treatment Plants. In Proceedings of the International Conference on System Theory, Control and Computing (ICSTCC), Cheile Gradistei, Romania, 14–16 October 2015; pp. 589–594. 25. Barbu, M.; Santin, I.; Vilanova, R. Applying Control Actions for the Water Line and Sludge Line to Increase the Wastewater Treatment Plants Performances. Ind. Eng. Chem. Res. 2018, 57, 5630–5638. [CrossRef] Energies 2021, 14, 6386 19 of 19 26. Revollar, S.; Vilanova, R.; Vega, P.; Franciscoand, M. Wastewater Treatment Plant Operation: Simple Control Schemes with a Holistic Perspective. Sustainability 2020, 12, 768. [CrossRef] 27. Barbu, M.; Vilanova, R.; Meneses, M.; Santin, I. Global Evaluation of Wastewater Treatment Plants Control Strategies Including CO2 Emissions. IFAC Papers 2017, 50, 12956–12961. [CrossRef] 28. Tejaswini, E.S.S.; Panjwani, S.; Babu, G.U.B.; Rao, A.S. Model Based Control of a Full-Scale Biological Wastewater Treatment Plant. IFAC Papers 2020, 53, 208–213. [CrossRef] 29. Flores-Alsina, X.; Gernaey, K.V.; Jeppsson, U. Benchmarking biological nutrient removal in wastewater treatment plants: Influence of mathematical model assumptions. Water Sci. Technol. 2012, 65, 1496–1505. [CrossRef] 30. Solon, K.; Flores-Alsina, X.; Mbamba, C.K.; Ikumi, D.; Volcke, E.I.P.; Vaneeckhaute, C.; Ekama, G.; Vanrolleghem, P.A.; Batstone, D.J.; Gernaey, K.V.; et al. Plant-wide modelling of phosphorus transformations in wastewater treatment systems: Impacts of control and operational strategies. Water Res. 2017, 113, 97–110. [CrossRef] 31. Flores-Alsina, X.; Ramin, E.; Ikumi, D.; Harding, T.; Batstone, D.; Brouckaert, C.; Sotemann, S.; Gernaey, K.V. Assessment of sludge management strategies in wastewater treatment systems using a plant-wide approach. Water Res. 2021, 190, 116–714. [CrossRef] 32. Flores-Alsina, X.; Solon, K.; Kazadi Mbamba, C.; Tait, S.; Jeppsson, U.; Gernaey, K.V.; Batstone, D.J. Modelling phosphorus, sulphur and iron interactions during the dynamic simulation of anaerobic digestion processes. Water Res. 2016, 95, 370–382. [CrossRef] [PubMed] 33. Gernaey, K.V.; Flores-Alsina, X.; Rosen, C.; Benedetti, L.; Jeppsson, U. Dynamic influent pollutant disturbance scenario generation using a phenomenological modelling approach. Environ. Model. Softw. 2011, 26, 1255–1267. [CrossRef] 34. Martin, C.; Vanrolleghem, P.A. Analysing, completing, and generating influent data for WWTP modelling: A critical review. Environ. Model. Softw. 2014, 60, 188–201. [CrossRef] 35. Snip, L.J.P.; Flores-Alsina, X.; Aymerich, I.; Rodríguez-Mozaz, S.; Barcelo, D.; Plosz, B.G.; Corominas, L.; Rodriguez-Roda, I.; Jeppsson, U.; Gernaey, K.V. Generation of synthetic data to perform (micro) pollutant wastewater treatment modelling studies. Sci. Total Environ. 2016, 569, 278–290. [CrossRef] 36. Otterpohl, R. Dynamische Simulation zur Unterstützung der Planung und des Betriebes von Kommunalen Kläranlagen [Dynamic Simulation to Support the Design and Operation of Municipal Wastewater Treatment Plants]. Ph.D. Thesis, Technical University of Aachen, Aachen, Germany, 1995. 37. Takács, I.; Patry, G.G.; Nolasco, D. A dynamic model of the clarification-thickening process. Water Res. 1991, 25, 1263–1271. [CrossRef] 38. Guerrero, J.; Flores-Alsina, X.; Guisasola, A.; Baeza, J.A.; Gernaey, K.V. Effect of nitrite, limited reactive settler and plant design configuration on the predicted performance of simultaneous C/N/P removal WWTPs. Bioresour. Technol. 2013, 136, 680–688. [CrossRef] 39. Kazadi Mbamba, C.; Flores-Alsina, X.; Batstone, D.J.; Tait, S. Validation of a plant-wide phosphorus modelling approach with minerals precipitation in a full-scale WWTP. Water Res. 2016, 100, 169–183. [CrossRef] 40. Flores-Alsina, X.; Ikumi, D.; Batstone, D.; Gernaey, K.V.; Brouckaert, C.; Ekama, G.A.; Jeppsson, U. Towards a plant-wide Benchmark Simulation Model with simultaneous nitrogen and phosphorus removal wastewater treatment processes. In Proceedings of the IWA 8th World Water Congress and Exhibition, Busan, South Korea, 16–21 September 2012. 41. Henze, M.; Gujer, W.; Mino, T.; Matsuo, T.; Wentzel, M.C.; Marais, G.V.R.; van Loosdrecht, M.C.M. Activated Sludge Model No. 2d, ASM2d. Water Sci. Technol. 1999, 39, 165–182. [CrossRef] 42. Batstone, D.J.; Keller, J.; Angelidaki, I.; Kalyuzhnyi, S.V.; Pavlostathis, S.G.; Rozzi, A.; Sanders, W.T.M.; Siegrist, H.; Vavilin, V.A. The IWA Anaerobic Digestion Model No. 1 (ADM1). Water Sci. Technol. 2002, 45, 65–73. [CrossRef] 43. Gernaey, K.; Jeppsson, U.; Batstone, D.J.; Ingildsen, P. Impact of reactive settler models on simulated WWTP performance. Water Sci. Technol. 2006, 53, 159–167. [CrossRef] [PubMed] 44. Grimholt, C.; Skogestad, S. Optimal PI and PID control of first-order plus delay processes and evaluation of the original and improved SIMC rules. J. Proc. Control 2018, 70, 36–46. [CrossRef] 45. Maciejowski, J.M. Predictive Control with Constraints, 1st ed.; Pearson Education: Harlow, UK, 2002. 46. Ljung, L. System Identification—A Theory for the User; Prentice Hall International: Upper Saddle River, NJ, USA, 1999. 47. Ostace, G.S.; Baeza, J.A.; Guerrero, J.; Guisasola, A.; Cristea, V.M.; Agachi, P.Ş.; Lafuente, F.J. Development and economic assessment of different WWTP control strategies for optimal simultaneous removal of carbon, nitrogen and phosphorus. Comput. Chem. Eng. 2013, 53, 164–177. [CrossRef] 48. Stare, A.; Vrečko, D.; Hvala, N.; Strmčnik, S. Comparison of control strategies for nitrogen removal in an activated sludge process in terms of operating costs: A simulation study. Water Res. 2007, 41, 2004–2014. [CrossRef] 49. Guerrero, J.; Guisasola, A.; Vilanova, R.; Baeza, J.A. Improving the performance of a WWTP control system by model-based setpoint optimisation. Environ. Model. Softw. 2011, 26, 492–497. [CrossRef] 50. Rojas, J.D.; Baeza, J.A.; Vilanova, R. Effect of the controller tuning on the performance of the BSM1 using a data driven approach. In Proceedings of the Watermatex 2011 8th IWA Symposium on Systems Analysis and Integrated Assessment, San Sebastián, Spain, 20–22 June 2011; pp. 785–792.