ISA Transactions 120 (2022) 167–189 Contents lists available at ScienceDirect ISA Transactions journal homepage: www.elsevier.com/locate/isatrans Research article New approach for regulation of the internal recirculation flow rate by fuzzy logic in biological wastewater treatments ∗ I. Santín a , , R. Vilanova a , C. Pedret a , M. Barbu a,b a Department of Telecommunications and Systems Engineering, School of Engineering, Universitat Autònoma de Barcelona, 08193 Bellaterra, Barcelona, Spain b Department of Automatic Control and Electrical Engineering, ‘‘Dunarea de Jos’’ University of Galati, 800008 Galati, Romania article info a b s t r a c t Article history: The internal recirculation plays an important role on the different biological processes of wastewater Received 7 August 2020 treatment plants because it has a great influence on the concentration of pollutants, especially Received in revised form 17 March 2021 nutrients. Usually, the internal recirculation flow rate is kept fixed or manipulated by control Accepted 17 March 2021 techniques to maintain a fixed nitrate set-point in the last anoxic tank. This work proposes a new Available online 24 March 2021 control strategy to manipulate the internal recirculation flow rate by applying a fuzzy controller. Keywords: The proposed controller takes into account the effects of the internal recirculation flow rate on Wastewater biological treatment the inlet of the biological treatment and on the denitrification and nitrification processes with the Fuzzy control aim of reducing violations of legally established limits of nitrogen and ammonia and also reducing Internal recirculation flow rate operational costs. The proposed fuzzy controller is tested by simulation with the internationally known Benchmark simulation model no 2 benchmark simulation model no. 2. The objective is to apply the proposed fuzzy controller in any Control strategies control strategy, only replacing the manipulation of the internal recirculation flow rate, to improve the plant operation.Therefore, it has been implemented in five operation strategies from the literature, replacing their original internal recirculation flow rate control, and simulation results are compared with those of the original strategies. Results show improvements with the application of the proposed fuzzy controller of between 2.25 and 57.94% in reduction of total nitrogen limit violations, between 55.22 and 79.69% in reduction of ammonia limit violations and between 0.84 and 38.06% in cost reduction of pumping energy. © 2021 The Authors. Published by Elsevier Ltd on behalf of ISA. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/). 1. Introduction concentrations below the limits is usually one of the most dif- ficult objectives to fulfill in WWTPs. In order to achieve all these Large amounts of freshwater are used daily around the world, targets, the application of operation strategies in WWTPs are very becoming waste water. This waste water must be treated to avoid common. contamination of the receiving waters (rivers, lakes, etc.), which Given the importance of keeping the pollutant concentra- could affect aquatic life and consequently biodiversity. Due to this tion within the established limits, and achieving this with the reason, wastewater treatment plants (WWTPs) are necessary to lowest possible operational costs, several research works have maintain the required levels of water quality. been published in recent years focusing on the application of Specifically, maximum concentration limits are established control strategies in WWTPs. In Katebi et al. [1], Santín et al. [2], for discharges in the receiving environment of Total Suspended i Arbós et al. [3] several control strategies applied in WWTPs are Solids (TSS), organic matter (Biological Oxygen Demand in 5 summarized. days (BOD5 ), and Chemical Oxygen Demand (COD), total nitrogen Some works apply control strategies in the sludge treatment (SNtot ), phosphorous and ammonium and ammonia nitrogen con- as in Barbu et al. [4] and Santín et al. [5], but most articles do centration (SNH ). Nitrogen and phosphorus are nutrients that can it in the secondary treatment, which corresponds to biological cause eutrophication in the receiving water, and consequently treatment, whose operation is explained in Section 2. In the the death of aquatic beings. SNH , in addition to containing ni- trogen, is toxic to aquatic life. Precisely, keeping SNtot and SNH literature there are several works that aim to improve the control of the concentration of the dissolved oxygen (SO ) in the aerobic ∗ Corresponding author. reactors, by manipulating the oxygen transfer coefficient (KL a), E-mail addresses: Ignacio.Santin@uab.cat (I. Santín), using different control techniques (Serralta et al. [6], Belchior Ramon.Vilanova@uab.cat (R. Vilanova), Carles.Pedret@uab.cat (C. Pedret), et al. [7], Yang et al. [8], Harja et al. [9], Du et al. [10], Santín Marian.Barbu@ugal.ro (M. Barbu). et al. [11]). The regulation of the SO set-point in the nitrification https://doi.org/10.1016/j.isatra.2021.03.028 0019-0578/© 2021 The Authors. Published by Elsevier Ltd on behalf of ISA. This is an open access article under the CC BY-NC-ND license (http://creativecommons. org/licenses/by-nc-nd/4.0/). I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 List of abbreviations SO,i Dissolved oxygen concentration in tank i (mg/l) AE Aeration Energy (kWh/d) SP Sludge Production (kg/d) ASM1 Activated Sludge Model no. 1 Tas Temperature (◦ C) BOD5 5-day Biological Oxygen Demand (mg/l) TSS Total Suspended Solids (mg/l) BSM1 Benchmark Simulation Model no 1 WWTP Wastewater Treatment Plants BSM2 Benchmark Simulation Model no2 XB,H The active heterotrophic biomass COD Chemical Oxygen Demand (mg/l) Z any concentration of the process DCS Default Control Strategy Zi is Z at the output of the reactor i EC External Carbon (kg/d) HEnet Net Heating Energy (kWh/d) HRT Hydraulic Retention Time (s) KL a Oxygen transfer coefficient (d−1 ) process has also been the goal of many articles, such as Serralta KL ai Oxygen transfer coefficient in tank i et al. [6], Vega et al. [12], Błaszkiewicz et al. [13], Santín et al. [14], (d−1 ) Li et al. [15], Revollar et al. [16], Qiao et al. [17], Sadeghassadi et al. ME Mixing Energy (kWh/d) [18], Zhang et al. [19], Caraman et al. [20]. METprod Methane production in the anaerobic Another variable that can be manipulated in the biological digester (kg/d) treatment is the internal recirculation flow rate (Qa ). However, MPC Model Predictive Control research into a new control strategy to manipulate Qa is not com- OCI Overall Cost Index mon. The work Karches [21] shows the improvement obtained by adding an internal recirculation in completely stirred tank PE Pumping Energy (kWh/d) reactors. In some operation strategies of the articles cited above, PI Proportional-Integral Qa is kept fixed and in others Qa is manipulated to maintain Q Flow rate (m3 /d) the nitrate (SNO ) set-point in the last anoxic reactor. In Serralta Qa Internal recycle flow rate (m3 /d) et al. [6], Sadeghassadi et al. [18], Qiao et al. [17] and Caraman qEC External carbon flow rate (m3 /d) et al. [20], in addition to manipulating SO set-point, the SNO set- qEC,1 External carbon flow rate in the first point in the last anoxic reactor is regulated by manipulating Qa tank (m3 /d) with different techniques. In Caraman et al. [20] by applying Qin Influent flow rate (m3 /d) optimization techniques, in Sadeghassadi et al. [18] with neural Qw Wastage flow rate (m3 /d) network and MPC, in Qiao et al. [17] with adaptive fuzzy neural rSNH Conversion rate of ammonium and am- network and in Serralta et al. [6] by fuzzy controllers. In Serralta monia nitrogen concentration in the et al. [6] there are two internal recirculations in the biological biological process treatment because anoxic and aerobic tanks are alternated. The works Revollar et al. [16] and Zhang et al. [19] apply optimization rSNO Conversion rate of nitrate concentration techniques to manipulate both SO and Qa directly, without SNO in the biological process control. In Santín et al. [22], the usual manipulation of Qa is SNtot Total nitrogen concentration (mg/l) modified to avoid SNH violations, but only in the periods of time SNtot,e Total nitrogen concentration in the when a risk of SNH violation is predicted. effluent (mg/l) Within the control techniques, it is common to find papers SNH Ammonium and ammonia nitrogen that apply fuzzy logic in WWTPs. Some of these articles have concentration (mg/l) already been referred above, which regulate the SNO set-point or SNH,0 Ammonium and ammonia nitrogen Qa directly (Serralta et al. [6], Santín et al. [22], Qiao et al. [17], concentration at the input of the first Caraman et al. [20]). In the case of Caraman et al. [20], the fuzzy reactor (mg/l) controller is not applied to regulate SO and SNO set-points, but to SNH,5 Ammonium and ammonia nitrogen differentiate the operating regime (dry, rain or storm). In addi- concentration at the output of the fifth tion to the articles mentioned, fuzzy controllers have also been reactor (mg/l) applied in WWTPs for other purposes. For example, in Camilleri SNH,in Ammonium and ammonia nitrogen and Katebi [23] a fuzzy controller is applied for global control, concentration in the influent (mg/l) taking into account not only WWTP but also the river and the SNH,po Ammonium and ammonia nitrogen sewer; and in Boiocchi et al. [24], the goal of the fuzzy controller concentration from the primary clarifier is to reduce nitrous oxide emissions by manipulating the aeration (mg/l) of the aerobic reactor based on input and output values of SNH and SNH,e Ammonium and ammonia nitrogen SNO . concentration in the effluent (mg/l) The novelty proposed in this paper is a new control strategy SNO Nitrate concentration (mg/l) to manipulate Qa by a fuzzy controller. The variation of Qa has several effects on the nitrification and denitrification processes SNO,0 Nitrate concentration at the input of the of the biological treatment. The analysis of these effects explains first reactor (mg/l) why the proposed control strategy has better results than those SNO,2 Nitrate concentration at the output of normally used. For the design of the Proposed Fuzzy Controller for the second reactor (mg/l) Qa manipulation (PFC_Qa ), the dilution or the increase of concen- SNO,5 Nitrate concentration at the output of tration of different compounds at the beginning of the biological the fifth reactor (mg/l) treatment is taken into account, as well as the variation of the SO Dissolved oxygen concentration (mg/l) Hydraulic Retention Time (HRT) (a more exhaustive explanation is found in Section 3). This paper uses operation strategies from the literature, replacing only the manipulation of Qa by PFC_Qa , 168 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 Fig. 1. BSM2 plant with notation used for flow rates. Fig. 2. Qa effects on the biological treatment. and shows the improvements it provides in terms of reducing shown, as well as the discussion about them. Finally, the most violations of SNtot and SNH , and operational costs. important conclusions are drawn. The use of simulation models to test control strategies in WWTPs is a common practice in research. So much so that 2. Materials and methods most of the previously referenced papers use the internation- ally known and accepted standard Benchmark Simulation Model The evaluation of the PFC_Qa for wastewater treatment plants no. 2 (BSM2)1 (Gernaey et al. [25]), which is an extension of has been carried out using the internationally known BSM2 the Benchmark Simulation Model no. 1 (BSM1) developed by (Jeppsson et al. [28]), which was updated by Nopens et al. [29]. the International Association on Water Pollution Research and The BSM2 layout (Fig. 1) includes the biological treatment (sec- Control (Alex et al. [26], Copp [27]). BSM2 differs from BSM1 ondary treatment) of BSM1 and, in addition, a primary settler, a by including the entire cycle of a WWTP, adding the sludge sludge treatment by a thickener, a digester and a dewatering. The liquid extracted in the dewatering is stored in a regulator tank treatment, and in that the simulation period is extended to one- and later recirculated to the primary settler. year assessment. In this work, the simulations and evaluations of BSM2 includes dynamics of the different influent concentra- the control strategies have been carried out with BSM2. tions for a period of 609 days, and the data from day 245 to 609 The paper is organized as follows. First, BSM2 is presented. (one year) are evaluated. These dynamics include rain events and Next, PFC_Qa is explained. Afterward, the simulation results are temperature (Tas ) variations. The biological treatment consists of five activated sludge re- 1 http://iwa-mia.org/benchmarking actors, followed by a secondary settler. The first two reactors 169 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 Fig. 3. Graphic surfaces of the fuzzy control output related to the inputs. are anoxic, where the denitrification process is carried out, and soluble organic nitrogen. They are defined below: the following three tanks are aerobics, where the nitrification ( )( ) SS SO process takes place. The influent has an average dry weather ρ1 = µHT XB,H (3) flow rate of 20,648.36 m3 /d and an average COD of 592.53 mg/l. 10 + SS 0.2 + SO The volume of each anoxic tank is 1500 m3 and that of each where SS is the readily biodegradable substrate and µHT is: aerobic tank is 3000 m3 . The HRT of the biological treatment is (( (4)) ) 14 h. There is a recirculation from the last tank to the first one Ln µHT = 4 · exp 3 · (Tas − 15) (4) (internal recirculation) and another from the underflow of the 5 settler (external recirculation) in order to recirculate sludge. 0.2 ( )( )( ) SS SNO The Activated Sludge Model No. 1 (ASM1) (Henze et al. [30]) ρ2 = µHT 0.8 · XB,H (5) describes the processes of the biological reactors. They define the 10 + SS 0.2 + SO 0.5 + SNO ( )( ) conversion rates and the mass balance of the different variables SNH SO of the biological treatment. The design of the PFC_Qa is based on ρ3 = µAT XB,A (6) 1 + SNH 0.4 + SO the Qa effects on the biological treatment taking into account the conversion rates of SNH (rSNH ) and SNO (rSNO ) and the reactors mass where XB,A is the active autotrophic biomass and µAT is: balance. ( 0.5 ) ) (( ) Ln 0.3 The equations of conversion rates and mass balance are shown µAT = 0.5 · exp · (Tas − 15) (7) below: 5 ρ6 = kaT · SND · XB,H ( ) 1 (8) rNH = −0.08ρ1 − 0.08ρ2 − 0.08 + ρ3 + ρ6 (1) 0.24 where SND is the soluble biodegradable organic nitrogen and kaT rNO = −0.1722ρ2 + 4.1667ρ3 (2) is: (( ( 0.05 ) ) ) where ρ1 , ρ2 , ρ3 , ρ6 are four of the eight biological processes Ln 0.04 defined in ASM1. Specifically, ρ1 is the aerobic growth of het- kaT = 0.05 · exp · (Tas − 15) (9) 5 erotrophs, ρ2 is the anoxic growth of heterotrophs, ρ3 is the aerobic growth of autotrophs and ρ6 is the ammonification of The general equations for mass balancing are: 170 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 Fig. 4. Operation strategies where PFC_Qa is tested. Selection A is the original control strategy and selection B corresponds to replace the Qa manipulation by PFC_Qa . • For reactor 1: methane production in the anaerobic digester and HEnet is the net dZ1 1 heating energy. = (Qa · Za + Qr · Zr + Qpo · Zpo + rz ,1 · V1 − Q1 · Z1 ) (10) AE is calculated according to the following relation: dt V1 ∫ t =609days 5 where Z is any concentration of the process, Z1 is Z in the 8 ∑ AE = Vi · KL ai (t) · dt (13) first reactor, Za is Z in the internal recirculation, Zr is Z in the T · 1.8 · 1000 t =245days i=1 external recirculation, Zpo is Z from the primary clarifier, V is the volume, V1 is V in the first reactor, Qpo is the overflow where KL ai is KL a in tank i. from the primary clarifier and Q1 is the flow rate in the first PE is calculated as: tank and it is equal to the sum of Qa , Qr and Qpo . 609days ∫ 1 • For reactor 2 to 5: PE = (0.004 · Q0 (t) + 0.008 · Qa (t) T 245days dZk 1 = (Qk−1 · Zk−1 + rz ,k · Vk − Qk · Zk ) (11) + 0.06 · Qw (t) + 0.06 · Qto (t) + 0.004 · Qdu (t)) · dt (14) dt Vk where Qw is the wastage flow rate, Qto is the overflow rate from where k is the number of reactor and Qk is equal to Qk−1 the thickener and Qdu is the underflow rate. Result evaluation is carried out by the effluent quality and the SP is calculated from the total solid flow from wastage and operational costs. Effluent quality is evaluated by the percentage the solids accumulated in the system over the period of time of time that the effluent concentrations of SNtot , COD, SNH , TSS considered: and BOD5 are above the established limits, shown in Table A.6. 1 Costs are evaluated by the Overall Cost Index (OCI) and each of SP = · (TSSa (609days) − TSSa (245days) T its components. + TSSs (609days) − TSSs (245days)+ OCI is defined to evaluate the operational cost as: ∫ t =609days OCI = AE + PE + 3 · SP + 3 · EC + ME − 6 · METprod + HEnet (12) + 0.75 · TSSw · Qw · dt) (15) t =245days where AE is the aeration energy, PE is the pumping energy, SP is where TSSa is the amount of solids in the reactors, TSSs is the the sludge production to be disposed, EC is the consumption of amount of solids in the settler and TSSw is the amount of solids external carbon source, ME is the mixing energy, METprod is the in the wastage. 171 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 Fig. 5. Time evolution of Qin , SNH,in , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa of day 341 for CS1 and CS1+PFC_Qa . Table A.6 METprod is calculated as: Effluent quality limits. Variable Value ∫ t =609days 16 · Patm Qgas (t) · pgas,ch4 (t) SNtot <18 g N m −3 METprod = · · dt (18) R · Tad · T t =245days Pgas (t) COD <100 g COD m−3 SNH <4 g N m−3 TSS <30 g SS m−3 where Patm is the atmosphere pressure equal to 1.013 bar, R is BOD5 <10 g BOD m−3 the gas constant equal to 0.083145 bar m3 K−1 kmol−1 , Tad is the temperature in the anaerobic digester, Qgas is the gas flow rate of the anaerobic digester, Pgas in the gas pressure of the anaerobic digester and Qpgas,ch4 is the methane pressure of the anaerobic EC refers to the carbon that could be added to improve deni- digester. trification: HEnet is defined as: HEnet = max 0., HE − 7. · METprod ( ) (19) ( i=n ) ∫ t =609days CODEC ∑ EC = qEC ,i · dt (16) T · 1000 t =245days where HE is the necessary energy to heat the anaerobic digester i=1 to the operating temperature, and it is calculated as: where qEC,i is the external carbon addition (qEC ) added to com- ∫ t =609days 100 · 4186 ( ) partment i, CODEC = 400 gCOD.m −3 is the concentration of readily HE = Tad − Tad,i · Qad (t) · dt (20) 86, 400 · T t =245days biodegradable substrate in the external carbon source. ME is a function of the compartment volume and is the energy where Tad,i is the temperature in the entrance of the anaerobic employed to mix the anoxic tanks to avoid settling (KWh/d): digester. The simulation conditions are the ones established in BSM2 by 5 default to fairly compare the results with other works using the ∫ t =609days 24 ∑ same benchmark. Thus, the variable-step solver ode45 is taken. 0.005 · Vi if KL ai (t) < 20d−1 other w ise 0 ·dt [ ] ME = T t =245days Variable-step size is needed in order to guarantee the best nu- i=1 merical solution as the mathematical model includes components (17) with very different time constants. 172 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 Fig. 6. Time evolution of Qin , SNH,in , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa of day 368 for CS1 and CS1+PFC_Qa . Table A.7 Ranges, types and parameters of the membership functions. Variables Range Fuzzy sets Type Parameters Low Z-shaped [12 24.2] SNH,in [12 40] Medium Triangular [18 25 32] High S-shaped [26 40] Low Z-shaped [14 16.5] SNH,0 [10 21] Medium Triangular [14 17.5 21] High S-shaped [19 21] Low Z-shaped [0.4 1.84] Inputs SNH,5 [0.4 3.5] Medium Triangular [0.71 1.95 3.19] High S-shaped [2.06 3.5] Low Z-shaped [5 11.25] SNO,5 [5 20] Medium Triangular [8.5 12 15.5] High S-shaped [13 20] Low Z-shaped [13 17.5] Tas [10 20] High S-shaped [13.5 17] Low Z-shaped [1e+04 2.25e+04] Qin [1e+04 5e+04] Medium Triangular [1.7e+04 2.75e+04 3.75e+04] High S-shaped [2.75e+04 4.2e+04] Very-low Triangular [−2.5e+04 0 2.5e+04] Low Triangular [5000 2.5e+04 4.5e+04] Medium-Low Triangular [2.5e+04 4.54e+04 6.5e+04] Output Qa [0 2e+05] Medium Triangular [4.5e+04 8e+04 1.15e+05] High Triangular [8e+04 1.15e+05 1.5e+05] Very-High Triangular [1.15e+05 2e+05 2.85e+05] 173 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 Fig. 7. Time evolution of Qin , SNH,in , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa during one week in summer for CS1 and CS1+PFC_Qa . 3. Control approach 3.1.1. Qa effect at the inlet of the biological treatment On one hand, the SNH value at the inlet of the first reactor is This article applies a new control strategy to manipulate Qa by given by the mixture of SNH from the primary clarifier (SNH,po ) and a fuzzy controller, with the aim of reducing limit violations of SNtot the recirculated SNH , which is equal to SNH in the fifth tank (SNH,5 ), in the effluent (SNtot,e ) and SNH in the effluent (SNH,e ) as well as as can be seen in (21). operational costs. The idea of the work is to add PFC_Qa to other Qin · SNH ,po + Qa · SNH ,5 already tested and published operation strategies, replacing only SNH ,0 = (21) Qin + Qa the Qa manipulation. The effects of Qa on biological treatment, As due to the nitrification process the SNH,5 value is lower than the design of PFC_Qa and the operation strategies on which it is SNH,po , Qa increases causes a dilution of SNH at the input of the first tested are detailed below. reactor (SNH,0 ) and, on the contrary, Qa reductions result in SNH,0 increases. On the other hand, since there is no SNO in the influent 3.1. Qa effects on the biological treatment and all SNO at the inlet of the first tank comes from Qa , which is equal to SNO in the fifth tank (SNO,5 ), Qa increases cause SNO at the The Qa variation influences both the denitrification and the input of the first reactor (SNO,0 ) increases (22). nitrification processes, as well as the dilution or increase of con- Qin · SNO,po + Qa · SNO,5 centrations at the biological treatment input. Due to this fact Qa SNO,0 = (22) variations have immediate effects on SNtot,e and SNH,e , but also Qin + Qa other different effects on the same variables after some time. This The SNH,0 and SNO,0 values affect SNH,e and SNtot,e values after complexity makes necessary an in-depth knowledge of the plant a period of time that depends on HRT and therefore on the flow behavior for the Qa manipulation and justify the use of a fuzzy rate. controller. A more detailed explanation of the Qa influence on the biolog- 3.1.2. Qa effect on the denitrification process ical treatment, specifically on SNtot and SNH , is carried out in Fig. 2, In the denitrification process that takes place in anoxic re- the equations of the observed conversion rates and mass balance actors, SNO is reduced to molecular nitrogen, which is harmless. of the biological reactors described in Section 2 and the mixture The active heterotrophic biomass (XB,H ) consume SS using oxygen of concentrations at the inlet of the biological treatment. from SNO (due to the absence of SO ). Thus, as it can be seen in the 174 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 Fig. 8. Time evolution of Qin , SNH,in , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa during one week in winter for CS1 and CS1+PFC_Qa . rSNO Eqs. (2), (5), the greater the amount of SS , the greater the SNO 3.2. Fuzzy controller design reduction. Due to the fact that SS is reduced during the biological treatment, an increase in Qa reduces SNO in the anoxic reactors, Fuzzy logic can be defined as a control based on human worsening denitrification. expertise. Fuzzy controller adapts the input and output variables A more important effect of Qa on the denitrification process into suitable linguistic values by membership functions. Rules is its influence on HRT, since when the flow is higher, HRT de- between input and output variables are established by words. creases and vice versa. As can been observed in the mass balance Non-expert readers can found further information about fuzzy equation (11), an increase in Qa diminishes the effect of rZ and control in standard references such as Klir and Yuan [31]. The FIS2 therefore worsens the denitrification process, increasing SNO and Editor from Matlab is used in this work for the implementation consequently SNtot,e . of PFC_Qa . As explained in Section 3.1, to assess the Qa effects on the biological treatment requires an exhaustive knowledge of the plant behavior. Due to this reason, a fuzzy controller has been 3.1.3. Qa effect on the nitrification process proposed for the Qa manipulation. The nitrification process takes place in aerobic reactors, where PFC_Qa has been initially tuned based on the knowledge of the active autotrophic biomass (XB,A ) oxidize SNH into SNO . In the the biological processes described by the extended ASM1 and on same way as in the denitrification process, Qa increases attenuate a specific analysis of the evolution over time of the fuzzy con- the effect of rZ (11), worsening in this case the nitrification troller inputs. After that, the range of values of the membership process, which causes SNH increase and SNO decrease. However, functions have been adjusted by trial and error to optimize the SO is often regulated in the aerobic reactors based on SNH . In results. PFC_Qa is conceived here with 6 inputs, 1 output and this case, Qa increases can result in an SO increase to improve 30 rules. As shown in Fig. 4, the inputs are SNH in the influent the nitrification process, which reduces SNH and increases SNO . In (SNH,in ), SNH,0 , SNH,5 , SNO,5 , Tas and influent flow rate (Qin ) and the conclusion, the best way to reduce SNH is to reduce Qa . Regarding output is Qa . Mamdani (Mamdani [32]) is the method of inference SNtot , as its main components are SNH and SNO , a trade-off solution must be found between both to reduce SNtot . 2 FIS: Fuzzy Inference System. 175 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 Fig. 9. Time evolution of Qin , SNH,in , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa of day 384 for CS2 and CS2+PFC_Qa . Table A.8 Rules of PFC_Qa . Rule number SNH,in SNH,0 SNH,5 SNO,5 Tas Qin Qa 1 If is Low and is not High – – and is Low and is Low Then is Low 2 If is Low and is not High – – and is High and is Low Then is Very-Low 3 If is Low – and is not High and is Low – and is Medium Then is High 4 If is Low – and is not High and is Low – and is High Then is High 5 If is Low – and is not High and is Medium – and is Medium Then is Medium 6 If is Low – and is not High and is Medium – and is High Then is Medium 7 If is Low – and is not High and is High and is High – Then is Very-Low 8 If is Low – and is not High and is High and is Low – Then is Low 9 If is Medium and is not High and is not High and is Low and is High and is not High Then is Low 10 If is Medium and is not High and is not High and is Medium and is High and is not High Then is Very-Low 11 If is Medium – and is not High and is High and is High and is not High Then is Very-Low 12 If is Medium and is Low and is not High and is Low and is Low and is not High Then is Medium 13 If is Medium and is Low and is not High and is Medium and is Low and is not High Then is Medium-Low 14 If is Medium – and is not High and is High and is Low and is not High Then is Low 15 If is Medium – and is not High and is Low – and is High Then is Very-High 16 If is Medium – and is not High and is Medium – and is High Then is Very-High 17 If is Medium – and is not High and is High – and is High Then is Medium-Low 18 If is High and is not High and is not High and is Low and is High and is not High Then is Medium-Low 19 If is High and is not High and is not High and is Medium and is High and is not High Then is Medium-Low 20 If is High – and is not High and is High and is High and is not High Then is Very-Low 21 If is High and is Low and is not High and is Low and is Low and is not High Then is High 22 If is High and is Low and is not High and is Medium and is Low and is not High Then is High 23 If is High – and is not High and is High and is Low and is not High Then is Medium-Low 24 If is High – and is not High and is Low – and is High Then is Very-High 25 If is High – and is not High and is Medium – and is High Then is Very-High 26 If is High – and is not High and is High – and is High Then is Medium-Low 27 – – If is High – and is Low – Then is Low 28 – – If is High – and is High – Then is Very-Low 29 – If is not Low and is not High and is not High and is Low and is not High Then is High 30 – If is High and is not High and is not High and is High and is not High Then is High 176 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 Fig. 10. Time evolution of Qin , SNH,in , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa of day 435 for CS2 and CS2+PFC_Qa . Table A.9 Parameters of PFC_Qa that affects the computational complexity. Number of inputs Number of input fuzzy sets Number of rules Number of output fuzzy sets 6 17 30 6 Table A.10 CPU time and elapsed time in the 609-day simulation of all the operation strategies with and without PFC_Qa . Indicators CS1 CS1+PFC_Qa Difference CS2 CS2+PFC_Qa Difference CS3 CS3+PFC_Qa Difference CS4 CS4+PFC_Qa Difference CS5 CS5+PFC_Qa Difference CPU time (hours) 1.218 1.529 25.534% 10.239 9.372 −8.467% 7.982 7.591 −4.898% 7.819 8.074 3.258% 8.084 7.911 −2.131% Elapsed time (hours) 1.214 1.512 24.547% 10.095 9.175 −9.117% 7.945 7.469 −5.982% 7.671 7.924 3.291% 7.955 7.757 −2.490% used in this paper. The range, parameter values and types of all The rules are based on the effects of Qa on the biological the membership functions of the inputs and output of the fuzzy treatment explained in Section 3.1 and are detailed below. Some controller are shown in Table A.7 and the rules in Table A.8. In of them are also shown in the surface graphs (Fig. 3). addition the fuzzy controller code is listed in the appendix. In dry weather, the ratio of Qin to SNH,in remains stable, and In the Simulink model, Qa variations are limited to a rising and consequently when there is an increase in this ratio due to an falling slew rates of 2,500,000 and −2,500,000 respectively, with increase in Qin it is considered that a rain event is taking place. flow rate units in m3 /s and time units in days. During dry weather, when SNH,in is low, Qa is decreased to reduce The sample time of the controller applied in a real scenario pumping energy costs and improve nitrification and denitrifica- could take any fixed value that was considered the most suitable tion processes, and if SNH,in increases, Qa is also increased in order to meet the plants’ requirements. The lowest possible discretiza- to dilute SNH,0 . In the case that a rain event is detected, Qa is tion could also be adopted, but other requirements might make increased to dilute SNH,0 , as long as there is no risk of SNH,5 or SNO,5 larger values convenient. Applying a sample time based on the increase. Fig. 3a shows the relationship between Qin and SNH,in . maximum response time of the sensors could be an option. Fol- During both dry and rainy weather (except when SNH,in is low lowing the BSM2 recommendations on the type of sensors to be in dry weather), Qa values are inversely based on the SNO,5 values, applied, Qin and Tas sensors have a one-minute response time, so the higher SNO,5 , the lower Qa (Fig. 3b). This is because PFC_Qa while SNH and SNO sensors have a 10-minute response time. Thus, is applied with control strategies that regulate SO set-point based an option in a real scenario could be to apply a sample time of on SNH , since they give better results than keeping SO set-point 10 min (0.0069 days). fixed (Santín et al. [14]). So, decreasing Qa , SNH,5 is reduced and 177 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 Fig. 11. Time evolution of Qin , SNH,in , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa during one week in summer for CS2 and CS2+PFC_Qa . Fig. 12. Time evolution of Qin , SNH,in , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa during one week in winter for CS2 and CS2+PFC_Qa . consequently also SO and SNO,0 . It should be noted that this fact of SO,5 reaches its maximum value defined by the controller that does not happen in the case that SNH,5 is so high that the value regulates it, even if Qa is reduced. In the case of control strategies 178 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 Fig. 13. Time evolution of Qin , SNH,in , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa of day 368 for CS3 and CS3+PFC_Qa . Fig. 14. Time evolution of Qin , SNH,in , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa during one week in summer for CS3 and CS3+PFC_Qa . 179 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 Fig. 15. Time evolution of Qin , SNH,in , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa during one week in winter for CS3 and CS3+PFC_Qa . Fig. 16. Time evolution of Qin , SNH,in , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa of day 341 for CS4 and CS4+PFC_Qa . 180 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 Fig. 17. Time evolution of SNH,in , qEC,1 , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa during one week in summer for CS4 and CS4+PFC_Qa . Fig. 18. Time evolution of SNH,in , qEC,1 , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa during one week in winter for CS4 and CS4+PFC_Qa . 181 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 Fig. 19. Time evolution of Qin , SNH,in , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa of days 558, 559 and 560 for CS5 and CS5+PFC_Qa . Fig. 20. Time evolution of SNH,in , qEC,1 , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa during one week in summer for CS5 and CS5+PFC_Qa . 182 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 Fig. 21. Time evolution of SNH,in , qEC,1 , SNH,0 , SNO,5 , SNH,5 , SNtot,e and Qa during one week in winter for CS5 and CS5+PFC_Qa . with fixed SO set-point, the fuzzy controller design should be • SNH,5 input: modified by adding SO as input. Qa values depend on Tas , with both dry and rainy weather, – During dry weather, when SNH,in ‘‘is Low’’, while SNH,0 because Tas affects the denitrification and nitrification processes. ‘‘is not High’’ Qa is defined as ‘‘Low’’ or ‘‘Very Low’’ When Tas decreases, these processes worsen, as shown in the (depending on Tas ) and the SNH,5 input is not taken equations of observed conversion rates ((2), (1), (5), (6), (4) and into account because it is restrictive when its value is (7)). Therefore, Qa is higher when Tas is lower with the aim of ‘‘High’’ and when that happens Qa must be ‘‘Low’’ or diluting more SNH,0 (Fig. 3b). ‘‘Very Low’’ (depending also on Tas ). Qa reduction is always limited by SNH,0 . When it is not nec- – When Qa is assigned a higher value than ‘‘Low’’ or ‘‘Very essary to dilute SNH , Qa is reduced to reduce pumping costs and Low’’, it is restricted to SNH,5 ‘‘is not High’’. to improve nitrification and denitrification processes. The SNH,0 • SNO,5 input: value limits the Qa reduction, since there must be a minimum SNH dilution in order to make possible to reduce it in the nitrification – For the same reason as SNH,5 input explained above, process to levels below the established limits (Fig. 3c). during dry weather, when SNH,in ‘‘is Low’’, while SNH,0 Finally, SNH,5 always plays a priority role in the rules, so that ‘‘is not High’’, the SNO,5 input is not taken into account. the Qa increase is always limited by it, because when SNH,5 is high, – The SNO,5 input is neither taken into account when Qa is low or very low (depending on Tas ) (Fig. 3d). SNH,5 ‘‘is High’’, and then Qa is ‘‘Low’’ or ‘‘Very Low’’. In the case of taking into account all the inputs in all the rules – When SNH,0 ‘‘is not Low’’, Qa is increased with the with the condition ‘‘is’’, the minimum number of rules should be restriction of SNO,5 ‘‘is not High’’. 486 to always assign a value to the output. However, due to the priorities of different situations, there are rules where the value • SNH,0 input: given to the output does not depend on some inputs and there – SNH,0 restriction is given when it increases to dilute SNH . are cases where the input condition is ‘‘is not’’ instead of ‘‘is’’. Then, if Qa is increased due to a rain event, SNH,0 does This fact results in a reduction of the computational complexity, not need to be taken into account. and a value is always assigned to the output with only 30 rules. – SNH,5 and SNO,5 are more restrictive than SNH,0 . There- The cases where some inputs are not included in the rules or the fore, if some of them are ‘‘High’’, Qa is decreased with- condition ‘‘is not’’ is established are explained below: out taken into account SNH,0 183 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 – During dry weather, when Tas is ‘‘High’’ and the situa- on time of the year: from 0 to 180 days and from 364 to 454 days tion is not of SNH,5 or SNO,5 ‘‘High’’, the decrease of Qa Qw is set to 300m3 /d; and for the remaining time periods Qw is is restricted to the condition of SNH,0 ‘‘is not High’’. set to 450m3 /d. Finally, Qa is kept fixed to 61,944 m3 /d. As explained in Section 3.2, PFC_Qa is designed for control • SNH,0 input: strategies with regulated SO set-point. For this reason, a hierar- – When Qa is increased due to a SNH,0 increase, SNH,in chical control for SO,4 set-point manipulation is added to DCS input is not taken into account by means of a fuzzy controller designed and tested in Santín – When Qa is decreased because SNH,5 ‘‘is High’’, SNH,in et al. [14] for BSM1 and adapted to the BSM2 characteristics input is neither taken into account in Santín et al. [22]. This referred paper shows that better results are obtained by regulating SO based on SNH , instead of trying to • Qin input: keep SO at a fixed set-point. For testing PFC_Qa , it has been added to this control strategy, – If SNH,in ‘‘is Low’’ and SNO,5 ‘‘is High’’ Qa is ‘‘Low’’ or to regulate Qa , instead of keeping it fixed (CS1+PFC_Qa ) (Fig. 4a). ‘‘Very Low’’ (depending on Tas ) without taking into account Qin input 3.3.2. Higher level fuzzy controller in Santín et al. [14] (CS2) – When Qa is decreased because SNH,5 ‘‘is High’’, Qin input The control strategy applied in Santín et al. [14] is based on is neither taken into account three Model Predictive Control (MPC) controllers and a fuzzy – When SNH,in is ‘‘Medium’’ or High‘‘, Qa value depends controller. A MPC controls the SO,5 set-point by manipulating on SNO,5 and Tas inputs and restricted to Qin ’’is not KLa5 and another MPC controls the SO,4 set-point by manipulating High’’. KL a3 , and KL a4 . The fuzzy controller is the same as the one applied • Tas input: in CS1, which manipulates the SO,4 and SO,5 set-points (with SO,5 set-point set to half of the value of SO,4 set-point). As in CS1, the – If a rain event is considered, the Qa value does not hierarchical fuzzy controller configuration is the one established depend on Tas input in Santín et al. [22] because it is adapted to BSM2. The third MPC Regarding the computational complexity of PFC_Qa , the pa- introduces the greatest difference with respect to CS1, controlling rameters that most influence it are shown in Table A.9. As spec- SNO at the output of the second reactor (SNO,2 ) at a set-point of ified in Kim et al. [33], the number of rules greatly affect the 2mg/l by manipulating Qa , instead of keeping Qa constant. The number of operations. Therefore, the reduction of the number of values of Qw and qEC,1 are the same as in DCS. rules to 30 instead of 486 has an important effect on reducing PFC_Qa is applied replacing the MPC that controls SNO,2 the number of operations and consequently on computational (CS2+PFC_Qa ) (Fig. 4b). complexity. The rest of the parameters in Table A.9 do not excessively 3.3.3. Control strategy WL-S2 in Barbu et al. [4] (CS3) affect the fuzzy controller complexity and not cause any compu- The WL-S2 control strategy of Barbu et al. [4] applies three PI tation time problem, which is confirmed by the simulation times, controllers. As in DCS, one PI controller controls SO,4 by manip- shown in Section 4. ulating KL a3 , KL a4 and KL a5 , with KL a5 set to half of the value of KL a3 and KL a4 . Another PI controller tries to keep SNH,5 at a set- 3.3. Operation strategies where PFC_Qa is tested point of 1mg/l by manipulating the SO,4 set-point and the last PI controller controls SNO,2 at a set-point of 1mg/l by manipulating PFC_Qa is applied in five already tested and published opera- Qa . The Qw and qEC,1 values are the same as in DCS. tion strategies. The objective is to modify only the Qa manipula- PFC_Qa is tested by replacing the SNO,2 control (CS3+PFC_Qa ) tion and compare the results obtained in different scenarios, as (Fig. 4c). shown in Fig. 4. The operation strategies with which the fuzzy controller has been tested are detailed below. 3.3.4. Control strategy WL-S3 in Barbu et al. [4] (CS4) As mentioned in Section 1, Serralta et al. [6], Sadeghassadi The WL-S3 control strategy of Barbu et al. [4] consists of three et al. [18], Qiao et al. [17], Caraman et al. [20], Revollar et al. [16] PI controllers. One PI controller controls SO,4 at a fixed set-point and Zhang et al. [19] also apply operation strategies that regulate of 2 mg/l by manipulating KL a3 and KL a4 . Another PI controller Qa , among other control approaches. However, none of them use controls SNH,5 at a fixed set-point of 1 mg/l by manipulating KL a5 . BSM2 as working scenario and the controllers should be adapted Finally, the third PI controller aims to maintain SNO,2 at a fixed to the new plant’s requirements. In addition, although Serralta set-point of 1mg/l by manipulating qEC,1 . Qa and Qw maintain the et al. [6], Sadeghassadi et al. [18], Qiao et al. [17] and Caraman same values as in DCS. et al. [20] apply different control techniques, the control approach PFC_Qa is tested with this control strategy by replacing the Qa to manipulate Qa is the SNO control, which is already applied fixed value of 61944 m3 /d (CS4+PFC_Qa ) (Fig. 4d). in three operation strategies where PFC_Qa is tested. In Revollar et al. [16] and Zhang et al. [19], MPC is applied to regulate 3.3.5. Control strategy WL-S4 in Barbu et al. [4] (CS5) both KL a and Qa , and it is not possible to replace only the Qa The WL-S4 control strategy of Barbu et al. [4] applies the same manipulation without modifying the controller. control loops as in CS3 and adds another PI controller to control SNO,5 at a set-point of 7 mg/l by manipulating qEC,1 . Qw maintains 3.3.1. Default control strategy with SO hierarchical control (CS1) the same values as in DCS. The original BSM2 definition (Jeppsson et al. [28]) proposes As in CS3, PFC_Qa is tested by replacing the SNO,2 control a Default Control Strategy (DCS). The closed-loop control con- (CS5+PFC_Qa ) (Fig. 4e). figuration consists of a Proportional-Integral (PI) controller that controls the SO in the fourth reactor (SO,4 ) at a set-point of 2 mg/l 4. Simulation results and discussion by KL a in the third tank (KL a3 ), KL a in the fourth tank (KL a4 ) and KL a in the fifth tank (KL a5 ) with KL a5 set to the half value of KL a3 Table A.11 shows the results obtained with the original opera- and KL a4 . qEC in the first reactor (qEC,1 ) is added at a constant flow tion strategies explained in Section 3.3 and also those obtained by rate of 2 m3 /d. Two different Qw values are imposed depending 184 I. Santín, R. Vilanova, C. Pedret et al. Table A.11 Simulation results of CS1, CS2, CS3, CS4 and CS5 and the same operation strategies adding PFC_Qa . Evaluation CS1 CS1+PFC_Qa % of im- CS2 CS2+PFC_Qa % of im- CS3 CS3+PFC_Qa % of im- CS4 CS4+PFC_Qa % of im- CS5 CS5+PFC_Qa % of im- Criteria provement provement provement provement provement Effluent Quality SNtot,e limits 0.309 0.237 23.301 0.255 0.246 3.529 0.607 0.529 12.850 0.252 0.106 57.937 0.149 0.114 23.392 violations (% of time) SNH,e limits 0.229 0.0715 68.777 0.134 0.06 55.224 0.335 0.069 79.493 0.338 0.080 76.293 0.352 0.071 79.687 violations (% of time) COD limits 0.057 0.057 0 0.057 0.057 0 0.057 0.057 0 0.057 0.054 4.999 0.054 0.054 0 violations (% of time) 185 TSS limits 0.343 0.343 0 0.349 0.343 1.638 0.352 0.343 2.438 0.386 0.381 1.380 0.352 0.349 0.849 violations (% of time) BOD5 limits 0.226 0.226 0 0.226 0.226 0 0.226 0.226 0 0.226 0.226 0 0.226 0.226 0 violations (% of time) Operational Costs PE (kWh/day) 445.454 427.899 3.941 692.241 428.803 38.056 492.031 439.319 10.713 445.457 441.700 0.843 491.873 445.064 9.516 SP (kg SS/day) 2707.477 2708.854 −0.051 2709.218 2708.909 0.011 2707.572 2708.867 −0.048 2708.759 2701.251 0.277 2687.241 2698.786 −0.430 AE (kWh/day) 3601.86 3593.732 0.226 3596.126 3591.647 0.125 3672.740 3663.750 0.245 3989.417 3961.181 0.708 3818.602 3632.194 −0.376 EC (kg COD/day) 2400 2400 0 2400 2400 0 2400 2400 0 2441.519 2293.758 6.052 1989.907 2219.619 −11.544 ME (kWh/day) 769.113 768.464 0.084 770.524 768.773 0.227 776.798 778.426 −0.210 970.036 967.605 0.251 778.694 779.425 −0.094 HEnet (kWh/day) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 METprod (kg 1086.239 1085.851 0.036 1085.659 1085.849 −0.018 1086.164 1085.963 0.019 1086.911 1085.214 0.156 1082.418 1084.545 −0.197 CH4/day) OCI 8821.425 8.801.551 0.225 9072.589 8800.853 2.995 8947.298 8892.318 0.614 9451.240 9256.709 2.058 8446.291 8665.387 −2.594 ISA Transactions 120 (2022) 167–189 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 replacing in these strategies the Qa manipulation by PFC_Qa . Thus, The greatest difference between applying PFC_Qa and keeping the improvements provided by this controller can be observed. Qa fixed (CS1 and CS4) is the SNH,0 dilution when SNH,in increases. Regarding the effluent quality, improvements in the reduc- Fig. 6 corresponds to day 368 with CS1 and with CS1+ PFC_Qa . tion of SNH,e and SNtot,e limit violations are achieved in all the In this day, there is an increase in the Qin to SNH,in ratio that is operation strategies explained in Section 3.3 (from CS1 to CS5) representative of a rain event and causes a Qa increase, which using PFC_Qa . The greatest improvements are obtained in the takes place earlier in CS1+PFC_Qa . The subsequent SNH,5 increase reduction of SNH,e limit violations, from 55.22% in CS2+ PFC_Qa results in a Qa decrease in CS1+PFC_Qa , which is reduced to even to 79.69% in CS5+PFC_Qa . The reductions in SNtot,e limit violations lower levels than in CS1. are lower than in SNH,e with a maximum reduction of 57.94% in Fig. 18 shows a winter week with CS4 and with CS4+PFC_Qa . CS4+PFC_Qa and a minimum reduction of 3.53% in CS2+PFC_Qa . The worsening of the nitrification process with low Tas results in The percentages of time of limit violations of COD, TSS and BOD5 SNH,e limit violations on days 462, 463 and 466 with CS4. There is remain the same, except minor variations in TSS limit violations no rain event during this period, but the SNH,in increase produces in CS2, CS3 and CS4. The number of times of limit violations a Qa increase in CS4+PFC_Qa , which is higher due to low Tas . As are also the same. This is understable given that the proposed happens in 6 by CS1+PFC_Qa , the previous SNH,0 dilution and the fuzzy controller is designed only to reduce limit violations of SNH,e subsequent Qa reduction when SNH,5 increases allows to avoid and SNtot,e . It should be mentioned that COD, TSS and BOD5 limit SNH,e limit violations by CS4+PFC_Qa . violations happen when the bypass is active, due to a significant In the case of the operation strategies that manipulate Qa Qin increase that the plant cannot assume. to control SNO,2 at the set-point of 1 mg/l (CS2, CS3 and CS5), By manipulating Qa with PFC_Qa , costs due to PE are reduced when SNO,5 is lower Qa is increased to increase SNO in the anoxic in all the operation strategies described in 3.3. The maximum zone, and, inversely, when SNO,5 is greater Qa is decreased. CS2 reduction of PE is 38.06% in CS2+PFC_Qa , which results in a applies an MPC with a higher gain than the PI controllers of reduction of 96,154 kWh in one year. The smallest reduction of CS3 and CS5, and the Qa variations are greater. Furthermore, in PE is obtained in CS4+PFC_Qa , but in this case there is also a CS3 and CS5 the value of Qa is limited to 103,240 m3 /d, which reduction of EC of 6.05%. In CS5+PFC_Qa , the PE decrease is 9.52%, is less than the maximum allowed (309,720 m3 /d). In Fig. 10, at the expense of an OCI increase of 2.59%, mainly due to an EC it is observed that in CS2, in the period of time when SNO,5 is increase of 11.54%. reduced and Qa is increased, there is a coincidental increase of The reasons for the results obtained are discussed below. Spe- SNH,in , which is diluted thanks to the Qa increase. Although on cific days have been chosen for the analysis of the PFC_Qa effects this day Qa is increased a little more in CS2+PFC_Qa than in CS2, in each one of the operation strategies, where there are SNH,e limit this is not the main difference between both, but the subsequent violations (Figs. 6, 10 and 13), SNtot,e limit violations (Figs. 5, 9, 16 Qa decrease when SNH,5 increases. In CS2 Qa is decreased later and 19), one summer week (Figs. 7, 11, 14 and 17) and one week than in CS2+PFC_Qa because it is caused by the SNO,5 increase and in winter (Figs. 8, 12, 15, 18 and 21). The comparison between not by the SNH,5 increase. Finally, the SNH,e limit violation that summer and winter weeks allows to observe the Tas effects on take place on day 435 with CS2 are avoided with CS2+PFC_Qa . the nitrification and denitrification processes and analyze how It should be noted that CS2 does not aim to dilute SNH,0 when the Qa manipulation can affect the pumping energy costs. In some SNH,in increases, but the Qa increase, due to a SNO,5 decrease, operation strategies, the winter week has also been used for the coincides with the SNH,in increase due to the influent dynamics. analysis of SNH,e or SNtot,e limit violations. In Fig. 13 and Fig. 19, it is observed how violations in the SNH,e To illustrate the computational burden of the PFC_Qa applica- limits on day 368 with CS3 and on days 559 and 560 with CS5 tion, Table A.10 shows the CPU time used and the elapsed time are avoided with CS3+PFC_Qa and CS5+PFC_Qa , respectively. In in the 609-day simulation of all the operation strategies with and CS3 and CS5 the Qa variations are lower than in CS2. In these without PFC_Qa , using a 7 GHz. Intel Core i7 processor. These operation strategies, there is an important difference in the SNH,0 values have been obtained with ‘‘cputime’’ and ‘‘tic/toc’’ functions dilution with the Qa increase with respect to CS3+PFC_Qa and of Matlab, respectively. As can be seen, in the operation strategies CS5+PFC_Qa , respectively. As in CS2, Qa is reduced later in CS3 in which PFC_Qa replaces a fixed Qa value (CS1 and CS4), PFC_Qa and CS5 than in CS3+PFC_Qa and CS5+PFC_Qa , respectively, and is results in an increase in elapsed time and CPU time of between caused by the increase of SNO,5 instead of by the increase of SNH,5 . approximately 15 and 19 min in the 609-day simulation. In the case of CS1, as it is a less complex operation strategy, the simula- 4.2. SNtot,e limit violations tion time is lower, and the PFC_Qa application results in a higher percentage of increase, of 24.547% in elapsed time and 25.534% in As explained in the previous section, when there is a SNH,in CPU time. In CS4, the percentages of increase are smaller, 3.258% increase, Qa is increased to dilute SNH,0 . When SNO,5 increases, Qa and 3.291% in elapsed time and CPU time, respectively. However, is slightly reduced, which improves the denitrification process, in the operation strategies where PFC_Qa replaces the nitrate which results in a SNO,5 reduction in a first period of time. How- control (CS2, CS3 and CS5), the application of PFC_Qa results in ever, the reduction of Qa also improves the nitrification process, a decrease in elapsed time and CPU time. In CS2, the percentage whose effect in SNO,5 depends on the SO required. It should be of decrease is higher (9.117% and 8.437% in elapsed time and CPU noted that an excessive Qa reduction would probably cause a time, respectively) because PFC_Qa replaces an MPC. In CS3 and subsequent SNO,5 increase by improving the nitrification process. CS5, PFC_Qa replaces PI controllers, but even so, elapsed time and As previously discussed, there is a reduction of SNtot,e limit CPU time are reduced, showing that the proposed method does violations by applying PFC_Qa in all tested operation strategies, not result in a large computational burden. but these reductions are lower than the reductions of SNH,e limit violations. The reason for this is that when there is a simultaneous increase in SNtot,e and SNH,5 , the SNH,5 increase requires a stronger 4.1. SNH,e limit violations and earlier Qa reduction, which is detrimental to reduce the SNO,5 peak. The best option is to reduce Qa when SNO,5 is greater, With PFC_Qa , when there is a SNH,in increase, Qa is increased to and thus to reduce the SNO,5 peak to improve the denitrification dilute SNH,0 . On the other hand, Qa is reduced when SNH,5 is high, process without an excessive generation of SNO,5 by improving to improve the nitrification process. nitrification. 186 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 In Fig. 5 and in Fig. 16, the effects on SNtot,e by applying PFC_Qa time to reduce PE costs because the values of SNtot,e and SNH,e are can be compared to those obtained by keeping Qa fixed. As with far from the established limits. However, in CS5+PFC_Qa , when SNH,e limit violation reduction, the main difference in this case is SNO,5 is greater than 7 mg/l, there is a higher qEC,1 increase than the Qa increase, when SNH,in increases, to dilute SNH,0 . Although in CS5, although SNO,5 values are not considered dangerous for a the SNH,5 increase results in Qa decrease before SNO,5 reaches high possible SNtot,e limit violation, as can be observed in Fig. 20. values, Fig. 5 and Fig. 16 show how CS1+PFC_Qa and CS4+PFC_Qa In CS4, there is also a qEC,1 regulation, but in this case to avoid SNtot,e limit violation on day 341 unlike CS1 and CS4. control SNO,2 , instead of SNO,5 , at the set-point of 1 mg/l. As in The Qa effect in CS3 and in CS5 is similar to that obtained in CS4+PFC_Qa Qa is usually lower than in CS4, SNO,2 is also lower CS1 and CS4. As explained in Section 4.1, although there is a Qa and therefore less qEC,1 is added, as can be seen in Fig. 17. Thus, regulation to control SNO,2 , the low gain of the PI controllers in EC costs are reduced by CS4+PFC_Qa compared to CS4. CS1 and CS4 results in a smaller and slower Qa increase when It must be taken into account that the PFC_Qa application SNO,5 decreases, which in turn results in a lower dilution of SNH,0 . requires the addition of sensors for the SNH,in , SNH,0 , SNO,5 , Tas and This fact is observed in Fig. 15 where SNtot,e limit violations with Qin measurements to the operation strategies, in which PFC_Qa CS3 on days 463, 464 and 466 are avoided with CS3+PFC_Qa . is tested, except in CS5 that already uses a SNO,5 sensor. These In addition, controlling SNO,2 by manipulating Qa in CS2, CS3, sensors are commonly used in WWTPs and do not require ex- and CS5 has another detrimental effect on SNtot,e limit violations cessive investment. With only the reduction of pumping energy when there is a long rain period. In these cases, the denitrification costs, the investment would be recovered in less than a year in process worsens due to a HRT decrease, and the SNO level in- CS2 and a little more time in the rest. If the reduction of fines creases. The SNO,2 control excessively reduces Qa , which improves due to the reduction of nutrient limit violations is taken into the denitrification process, but also improves the nitrification account, the return on investment would be in a shorter time. In process, generating more SNO . Qa decrease affects especially SNH,0 addition, regardless of the PFC_Qa application, the added sensors that is increased. This effect can be seen, for instance, in Fig. 9 provide important information to the plant. Specifically, the Tas , and in Fig. 19. Qin and SNH,in measurements are quite essential, and it is very In the case of CS2+PFC_Qa , the reduction of SNtot,e limit viola- common to have these sensors, even though they are not used tions with respect to CS2 is lower than in the other operation in the operation strategy. strategies because CS2 dilutes SNH,0 when there is a SNH,in in- crease. In addition, the subsequent reduction of Qa is performed 5. Conclusions when SNO,5 is greater since it does not take into account SNH,5 . However, CS2 has an increase in SNtot,e limit violations mainly due This article has presented a new control strategy to manipulate to long rain periods. Qa taking into account its effects in the different areas of the biological treatment of a wastewater treatment plant, by applying 4.3. Operational costs a fuzzy controller. PFC_Qa has been tested in five already tested and published operation strategies, replacing the original Qa ma- The cost reduction is mainly due to the saving in pumping nipulation and comparing results. The PFC_Qa application has energy thanks to a lower average Qa . It occurs mainly in sum- reduced SNH,e and SNtot,e limit violations and PE costs in all tested mer when Tas is high, nitrification and denitrification processes operation strategies. The only exception is CS5, where there is improve and therefore the SNH,0 dilution to keep both SNtot,e an OCI increase due to a qEC,1 increase. The graphs of evolution and SNH,e below the established limits is less necessary. The Qa over time of the most important concentrations show the effects regulation has the objective of reducing the SNH,e and SNtot,e peaks of Qa , corroborating that the objectives of PFC_Qa are met . The although the SNH,0 dilution is lower. main conclusions of the PFC_Qa application and its comparison Figs. 7, 11, 14, 17 and 20 show how most of the time Qa is with the original control strategies are: lower with the PFC_Qa than with the original control strategies. This difference is greater in CS2, CS3 and CS5, which manipulate • The Qa increase to dilute SNH,0 , when SNH,in or Qin increases, Qa to control SNO,2 , coinciding with the PE costs in Table A.11. has an important effect in reducing SNtot,e and SNH,e peaks to In these control strategies, Qa is increased more in summer than avoid limit violations in winter because SNO,5 is lower and it is necessary to recirculate • The Qa decrease, when it is not necessary to dilute SNH,0 due more SNO to maintain SNO,2 at the set-point of 1 mg/l. However, in to low SNH,in levels and especially in summer, reduces PE summer, this Qa increase is unnecessary to keep SNH,e and SNtot,e costs. below the limits. The Qa increase is greater in CS2 than in CS3 • The Qa reduction, when SNH,5 increases, generates a HRT and CS5 because the maximum Qa limit is greater. This fact also increase that improves the nitrification process, reducing results in higher PE costs, shown in Table A.11. the SNH,e peaks and avoiding limit violations Figs. 8, 12, 15, 18 and 21 show a week in which Tas is low. As • The Qa reduction, when SNO,5 increases, reduces it in a first in this case the nitrification and denitrification processes worsen, period of time due to the denitrification process improve- PFC_Qa increases more Qa in order to dilute SNH,0 when SNH,in ment, which allows to avoid SNtot,e limit violations. However, increases. The SNtot,e and SNH,e peaks are higher than in summer a large and/or too premature Qa reduction can generate a and closer to the established limits. In fact, there are SNH,e limit subsequent increase of SNO,5 . A fact that happens in the violations in CS1, CS3, CS4 and CS5 and SNtot,e limit violations PFC_Qa application if there is a large increase in SNH,5 and in CS3, while with the application of PFC_ Qa they are avoided. SNO,5 on the same day. In all tested operation strategies, except in CS2, the Qa average • Keeping Qa fixed, as in CS1 and CS4, results in a poor SNH,0 in winter is higher with the application of PFC_Qa , but the Qa dilution when SNH,in or Qin increase and does not improve reduction in summer, explained above, results in a reduction of the nitrification process when the SNH,5 increase requires PE annual costs. it. The average value of Qa in summer is excessively high, In CS5+PFC_Qa compared to CS5, although there is a decrease which increases PE costs. of PE costs, there is an OCI increase mainly due to an increase of • The Qa manipulation to control SNO,2 , as in CS2, CS3 and EC costs. CS5 manipulates qEC,1 to control SNO,5 at a set-point of 7 CS5, excessively increases Qa in summer, when less dilution mg/l. The application of PFC_Qa reduces Qa in summer most of the is required, to try to keep SNO,2 at the set-point of 1 mg/l, 187 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 generating an increase of PE costs. When there is an increase NumMFs=3 in SNH,5 , Qa is not reduced, and during long rain periods Qa MF1= ’ High ’ : ’ smf ’ , [ 1 9 21] is excessively reduced. MF2= ’Low ’ : ’ zmf ’ , [ 1 4 1 6 . 5 ] • The combination of the PFC_Qa application with the SNO,5 MF3= ’Medium ’ : ’ trimf ’ , [ 1 4 17.5 21] control by manipulating qEC,1 can generate increases of EC costs in the summer period, especially with low SNO,5 set- [ Input3 ] points. Name= ’SNH5 ’ • The combination of the PFC_Qa application with the SNO,5 Range = [ 0 . 4 3 . 5 ] control by manipulating qEC,1 can generate increases of EC NumMFs=3 costs in the summer period, especially with low SNO,5 set- MF1= ’Low ’ : ’ zmf ’ , [ 0 . 4 1 . 8 4 ] points. MF2= ’Medium ’ : ’ trimf ’ , [ 0 . 7 1 1.95 3 . 1 9 ] MF3= ’ High ’ : ’ smf ’ , [ 2 . 0 6 3 . 5 ] It is worth mentioning that Qa has effects on the amount of SO in the aerobic zone and therefore also on nitrous oxide emissions. [ Input4 ] However, the current PFC_Qa has not been designed to take into Name= ’SNO5 ’ account nitrous oxide emissions or any other greenhouse gas. Range =[5 20] Updating the approach of the Qa regulation to take this effect into NumMFs=3 account is planned as future work. MF1= ’Low ’ : ’ zmf ’ , [ 5 11.25] Also, in the case of WWTPs that carry out the biological phos- MF2= ’Medium ’ : ’ trimf ’ , [ 8 . 5 12 1 5 . 5 ] phorus removal, the effects of PFC_Qa application must be ana- MF3= ’ High ’ : ’ smf ’ , [ 1 3 20] lyzed. Finally, the present work constitutes the first step of the study [ Input5 ] to be completed by further tests in pilot or real plants. Name= ’ Tas ’ Range=[10 20] Declaration of competing interest NumMFs=2 MF1= ’Low ’ : ’ zmf ’ , [ 1 3 1 7 . 5 ] The authors declare that they have no known competing finan- MF2= ’ High ’ : ’ smf ’ , [ 1 3 . 5 17] cial interests or personal relationships that could have appeared to influence the work reported in this paper. [ Input6 ] Name= ’ Qin ’ Acknowledgments Range=[10000 50000] NumMFs=3 This work was partially supported by the Spanish MICINN pro- MF1= ’Low ’ : ’ zmf ’ , [ 1 0 0 0 0 22500] gram under grants DPI-2016-77271-R and PID2019-105434RB- MF2= ’Medium ’ : ’ trimf ’ , [ 1 7 0 0 0 27500 37500] C33. MF3= ’ High ’ : ’ smf ’ , [ 2 7 5 0 0 42000] Marian Barbu acknowledge the support of the project ‘‘EX- PERT’’, Contract no. 14PFE/17.10.2018. [ Output1 ] Name= ’Qa ’ Appendix Range =[0 200000] NumMFs=6 MF1= ’Low ’ : ’ trimf ’ , [ 5 0 0 0 25000 45000] MF2= ’Medium−low ’ : ’ trimf ’ , [ 2 5 0 0 0 45400 65000] [ System ] MF3= ’Medium ’ : ’ trimf ’ , [ 4 5 0 0 0 80000 115000] Name= ’ PFC_Qa ’ MF4= ’ Very−High ’ : ’ trimf ’ , [1 1 5 00 0 200000 2.67 e +55] Type = ’mamdani ’ MF5= ’ Very−low ’ : ’ trimf ’ ,[ − 10000000 0 25000] Version =2.0 MF6= ’ High ’ : ’ trimf ’ , [ 8 0 0 0 0 115000 150000] NumInputs=6 NumOutputs=1 [ Rules ] NumRules=30 1 −1 0 0 1 1 , 1 ( 1 ) : 1 AndMethod= ’min ’ 1 −1 0 0 2 1 , 5 ( 1 ) : 1 OrMethod = ’max ’ 1 0 −3 1 0 2 , 6 ( 1 ) : 1 ImpMethod = ’min ’ 1 0 −3 1 0 3 , 6 ( 1 ) : 1 AggMethod = ’max ’ 1 0 −3 2 0 2 , 3 ( 1 ) : 1 DefuzzMethod = ’ centroid ’ 1 0 −3 2 0 3 , 3 ( 1 ) : 1 1 0 −3 3 2 0 , 5 ( 1 ) : 1 [ Input1 ] 1 0 −3 3 1 0 , 1 ( 1 ) : 1 Name= ’ SNHin ’ 2 −1 −3 1 2 −3, 1 ( 1 ) : 1 Range=[12 40] 2 −1 −3 2 2 −3, 5 ( 1 ) : 1 NumMFs=3 2 0 −3 3 2 −3, 5 ( 1 ) : 1 MF1= ’Low ’ : ’ zmf ’ , [ 1 2 2 4 . 2 ] 2 2 −3 1 1 −3, 3 ( 1 ) : 1 MF2= ’Medium ’ : ’ trimf ’ , [ 1 8 25 32] 2 2 −3 2 1 −3, 2 ( 1 ) : 1 MF3= ’ High ’ : ’ smf ’ , [ 2 6 40] 2 0 −3 3 1 −3, 1 ( 1 ) : 1 2 0 −3 1 0 3 , 4 ( 1 ) : 1 [ Input2 ] 2 0 −3 2 0 3 , 4 ( 1 ) : 1 Name= ’SNH0 ’ 2 0 −3 3 0 3 , 2 ( 1 ) : 1 Range=[10 21] 3 −1 −3 1 2 −3, 2 ( 1 ) : 1 188 I. Santín, R. Vilanova, C. Pedret et al. ISA Transactions 120 (2022) 167–189 3 −1 −3 2 2 −3, 2 ( 1 ) : 1 [13] Błaszkiewicz K, Piotrowski R, Duzinkiewicz K. A model-based improved 3 0 −3 3 2 −3, 5 ( 1 ) : 1 control of dissolved oxygen concentration in sequencing wastewater batch reactor. Stud Inform Control 2014;23(4):323–32. 3 2 −3 1 1 −3, 6 ( 1 ) : 1 [14] Santín I, Pedret C, Vilanova R. Applying variable dissolved oxygen set point 3 2 −3 2 1 −3, 6 ( 1 ) : 1 in a two level hierarchical control structure to a wastewater treatment 3 0 −3 3 1 −3, 2 ( 1 ) : 1 process. J Process Control 2015;28:40–55. 3 0 −3 1 0 3 , 4 ( 1 ) : 1 [15] Li F, Qiao J, Han H, Yang C. A self-organizing cascade neural network 3 0 −3 2 0 3 , 4 ( 1 ) : 1 with random weights for nonlinear system modeling. Appl Soft Comput 2016;42:184–93. 3 0 −3 3 0 3 , 2 ( 1 ) : 1 [16] Revollar S, Vega P, Vilanova R, Francisco M. Optimal control of wastew- 0 0 3 0 1 0 , 1 (1) : 1 ater treatment plants using economic-oriented model predictive dynamic 0 0 3 0 2 0 , 5 (1) : 1 strategies. Appl Sci 2017;7(8):813. 0 −2 −3 −3 1 −3, 6 ( 1 ) : 1 [17] Qiao J-F, Hou Y, Zhang L, Han H-G. Adaptive fuzzy neural network control of wastewater treatment process with multiobjective operation. 0 1 −3 −3 2 −3, 6 ( 1 ) : 1 Neurocomputing 2018;275:383–93. [18] Sadeghassadi M, Macnab CJ, Gopaluni B, Westwick D. Application of neural networks for optimal-setpoint design and MPC control in biological wastewater treatment. Comput Chem Eng 2018;115:150–60. References [19] Zhang A, Yin X, Liu S, Zeng J, Liu J. Distributed economic model predictive control of wastewater treatment plants. Chem Eng Res Des [1] Katebi R, Johnson MA, Wilkie J. Control and instrumentation for 2019;141:144–55. wastewater treatment plants. Springer Science & Business Media; 2012. [20] Caraman S, Luca L, Vasiliev I, Barbu M. Optimal-setpoint-based control [2] Santín I, Pedret C, Vilanova R. Control and decision strategies in wastew- strategy of a wastewater treatment process. Processes 2020;8(10):1203. ater treatment plants for operation improvement, vol. 86. Springer; [21] Karches T. Effect of internal recirculation on reactor models in wastewater 2016. treatment. WIT Trans Ecol Environ 2018;228:145–53. [3] i Arbós RV, López IS, Pedret C. Control and operation of wastewater [22] Santín I, Pedret C, Vilanova R, Meneses M. Advanced decision control treatment plants: Challenges and state of the art. Rev Iberoam Autom system for effluent violations removal in wastewater treatment plants. Inform Ind (RIAI) 2017;14(4):329–45. Control Eng Pract 2016;279:207–19. [4] Barbu M, Santin I, Vilanova R. Applying control actions for water line and [23] Camilleri F, Katebi R. Fuzzy logic control of integrated wastewater systems. sludge line to increase wastewater treatment plant performance. Ind Eng IFAC Proc Vol 2005;38(1):161–6. Chem Res 2018;57(16):5630–8. [24] Boiocchi R, Gernaey KV, Sin G. Understanding N2 O formation mechanisms [5] Santín I, Vilanova R, Barbu M, Pedret C. Manipulating the sludge flow through sensitivity analyses using a plant-wide benchmark simulation to increase methane production and to reduce effluent pollution in model. Chem Eng J 2017;317:935–51. wastewater treatment plants. In: 2016 24th Mediterranean conference on [25] Gernaey K, Jeppsson U, Vanrolleghem P, Copp J. Benchmarking of control control and automation. IEEE; 2016, p. 877–82. strategies for wastewater treatment plants. Scientific and Technical report [6] Serralta J, Ribes J, Seco A, Ferrer J. A supervisory control system for opti- No. 23, London, UK: IWA Publishing; 2014. mising nitrogen removal and aeration energy consumption in wastewater [26] Alex J, Beteau J, Copp J, Hellinga C, Jeppsson U, Marsili-Libelli S, et treatment plants. Water Sci Technol 2002;45(4–5):309–16. al. Benchmark for evaluating control strategies in wastewater treatment [7] Belchior CAC, Araújo RAM, Landeck JAC. Dissolved oxygen control of the plants. In: Control conference, 1999 European. IEEE; 1999, p. 3746–51. activated sludge wastewater treatment process using stable adaptive fuzzy [27] Copp JB. The COST simulation benchmark: Description and simulator control. Comput Chem Eng 2012;37:152–62. manual: a product of COST action 624 and COST action 682. EUR-OP; 2002. [8] Yang T, Qiu W, Ma Y, Chadli M, Zhang L. Fuzzy model-based predictive [28] Jeppsson U, Pons M-N, Nopens I, Alex J, Copp J, Gernaey K, et al. Benchmark control of dissolved oxygen in activated sludge processes. Neurocomputing Simulation Model No 2: general protocol and exploratory case studies. 2014;136:88–95. Water Sci Technol 2007;56(8):67–78. [9] Harja G, Nascu I, Muresan C, Nascu I. Improvements in dissolved oxygen [29] Nopens I, Benedetti L, Jeppsson U, Pons M-N, Alex J, Copp JB, et al. control of an activated sludge wastewater treatment process. Circuits Benchmark Simulation Model No 2: finalisation of plant layout and default Systems Signal Process 2016;35(6):2259–81. control strategy. Water Sci Technol 2010;62(9):1967–74. [10] Du X, Wang J, Jegatheesan V, Shi G. Dissolved oxygen control in activated [30] Henze M, Grady C, Gujer W, Marais G, Matsuo T. Activated sludge model sludge process using a neural network-based adaptive pid algorithm. Appl 1. Scientific and Technical report No. 1, London, UK: IAWQ; 1987. Sci 2018;8(2):261. [31] Klir G, Yuan B. Fuzzy sets and fuzzy logic, vol. 4. Prentice Hall New Jersey; [11] Santín I, Barbu M, Pedret C, Vilanova R. Dissolved oxygen control in 1995. biological wastewater treatments with non-ideal sensors and actuators. [32] Mamdani E. Application of fuzzy algorithms for control of simple dynamic Ind Eng Chem Res 2019;58(45):20639–54. plant. Proc Inst Electr Eng 1976;121(12):1585–8. [12] Vega P, Revollar S, Francisco M, Martín J. Integration of set point opti- [33] Kim YH, Ahn SC, Kwon WH. Computational complexity of general fuzzy mization techniques into nonlinear MPC for improving the operation of logic control and its simplification for a loop controller. Fuzzy Sets and WWTPs. Comput Chem Eng 2014;68:78–95. Systems 2000;111(2):215–24. 189