Efﬂuent Quality-Aware Event-Triggered Model Predictive Control for Wastewater Treatment Plants

: Wastewater treatment plants (WWTPs) are large-scale and nonlinear processes with tightly integrated operating units. The application of online optimization-based control strategies, such as model predictive control (MPC), to WWTPs generally faces high computational complexity. This paper proposes an event-triggered approach to address this issue. The model predictive controller updates information and solves the optimization problem only when the corresponding triggered logic is satisﬁed. The triggered logic sets the maximum allowable deviation for the tracking variables. Moreover, to ensure system performance, the design of the event-triggered logic incorporates the efﬂuent quality. By obtaining the optimal sequence for the efﬂuent quality within the receding horizon of the MPC, the cumulative deviation between the predicted and desired efﬂuent quality is analyzed to evaluate the performance within that horizon. Based on these two conditions, the need for adjusting control actions is determined. Even if the maximum allowable range for the tracking variables in the triggered logic design is set unreasonably, the consideration of efﬂuent quality factors in the triggered conditions ensures good performance. Simulation results demonstrate an average reduction in computational effort of 25.49% under different weather conditions while simultaneously ensuring minimal impact on the efﬂuent quality and total cost index and compliance with efﬂuent discharge regulations. Furthermore, this method can be combined with other approaches to guarantee efﬂuent quality while further reducing computation time and complexity.


Introduction
WWTPs are vital infrastructure for converting wastewater from urban and industrial areas into safe effluent for discharge.They play an essential role in protecting the environment, public health, and socio-economic development.Effective control of WWTPs is essential to ensure their efficient and reliable operation.However, due to the use of different benchmark models in previous studies, it is difficult to evaluate and compare the performance of these control strategies.To address this issue, J. Alex et al. proposed the benchmark simulation model no. 1 (BSM1) [1] to simulate WWTPs, which has been widely used in many subsequent studies.In [2], linear quadratic dynamic matrix control was applied to the BSM1 with the addition of a feedforward action to improve performance in the presence of disturbances.In [3], a tracking MPC scheme was applied and compared with the method proposed in [2], and the results showed that the MPC control strategy performed better.Similarly, in [4], a comparison was made between MPC and the proportional integral derivative (PID) controller, and a similar conclusion was drawn.In [5], the application of economic MPC (EMPC) to WWTPs resulted in improved performance.However, since implementing MPC (EMPC) for the BSM1 requires online construction and the solving of large-scale optimization problems, it often needs significant computation time.Therefore, the aim of this study was to reduce the computational burden without compromising performance.There are various approaches to reduce the computational complexity of MPC (EMPC) for WWTPs.These include using distributed design [6], model reduction [7,8], and variable-horizon MPC, as proposed in [9].In this work, we also consider event-triggered control (ETC) [10].The proposed approach can be combined with these approaches to further reduce the computational complexity.
In recent years, ETC has gained more attention due to its ability to achieve highperformance control while minimizing communication and computation overhead.The sampling time in networked control systems is determined by the occurrence of events rather than the passage of time.The impact of this idea was analyzed in [11].It was pointed out that a communication network connects system components, such as sensors, controllers and actuators, and that the event-triggered approach can also save communication costs significantly in a networked control system, as shown in [12,13].One of the challenges in ETC-based control is the design of triggering conditions.Tabuaba [14] defined a trigger condition for nonlinear systems to ensure input-state stability (ISS).This is necessary because non-periodic control event intervals may lead to error accumulation.In [15], event-triggered strategies for control of discrete-time systems were proposed and analyzed.The control law is updated once the control target violates the triggering condition involving the measurement error norm.This also means that, when the trigger condition is not satisfied, the controller will maintain the previous control action, thereby reducing the computational load.Eqtami extended this approach to a distributed model predictive control model in [16].In [17], for continuous-time nonlinear systems, an event-triggering logic was defined by using the error between the optimal prediction and system state measurement, and it was proved that, if the design of the prediction horizon is reasonable and the disturbance is small enough, the feasibility of the event-triggered MPC algorithm can be guaranteed.In [18], an event-triggered PID controller was proposed specifically for WWTPs; adjustable auxiliary variables were introduced, and the deviation between the tracking error and auxiliary variable was used to design the trigger logic.More recently, the authors of [19] designed a triggering logic using the output error and predicted horizon.While successful in reducing computation, the results presented did not consider the most important factor; i.e., effluent quality indicators.In [20], Boruah N. employed the threshold range and first derivative of the controlled variable to develop an event-triggered tracking MPC that is well suited for practical applications.However, the paper did not provide a method for determining the appropriate threshold value to use.Therefore, the operator might induce hazardous outcomes as a consequence of excessively large threshold settings.Additionally, even when employing a minute threshold setting under nominal conditions, the resulting control pattern could continually oscillate between triggering and non-triggering, introducing significant uncertainty in effluent quality performance.
In this paper, effluent quality is further integrated into the design of the event-triggered logic and evaluated using a receding horizon approach.This integration empowers the model predictive controller to proactively determine whether to engage in solving the optimization problem, as driven by performance metrics.The primary goal is to mitigate the computational burden on the controller while safeguarding the effluent quality performance from significant compromise.This method effectively sidesteps the limitations inherent in single-threshold logic, particularly the uncertainty resulting from the oscillating pattern of meeting trigger conditions and subsequently failing to meet them.Moreover, effluent quality-aware event-triggered control ensures robust effluent quality protection, even when operating within relaxed threshold settings.Through simulation, our results indicated a significant average reduction of 25.9% in computational workload under threshold settings with moderately relaxed tracking outputs.This reduction was achieved without compromising the continuous operation of the controller with poorer performance, ensuring optimal setpoint tracking during this period.Additionally, when adopting narrower threshold settings, we observed a minor decrease in trigger occurrences while maintaining effluent quality performance comparable to traditional MPC.This paper is organized as follows: Section 2 provides a brief description of the BSM1 and outlines the performance evaluation criteria.Section 3 presents a brief description of the control system structure and a scheme is provided.Subsequently, the design of an event-triggered model predictive controller is described, which includes the triggered logic and implementation algorithm.Section 4 presents simulation results for three different types of weather and demonstrates the effectiveness of the algorithm.Finally, Section 5 summarizes the conclusions of this paper and suggests ideas for future research.

WWTP Process Description and Modeling
A simplified schematic of a WWTP is shown in Figure 1.This section gives a brief introduction to the BSM1.
The BSM1 is a combination of 13 components and 8 reaction processes from the ASM1 [21,22] and a double-exponential settling dynamics model for the secondary clarifier [23].The main goal of wastewater treatment is to remove nitrogen and phosphorus, which can cause eutrophication of water bodies, excessive algal growth, and deterioration of water quality and ecosystems.Another goal is to reduce ammonia and oxygen-consuming nitrogen, which can lower the dissolved oxygen concentration in water and cause black odor and the death of aquatic organisms.As shown in Figure 1, the first two biochemical reaction chambers are anoxic zones, where nitrates are reduced to nitrogen gas by denitrifying bacteria, and the last three are aeration zones, where oxygen is supplied to support aerobic bacteria that remove organic matter and ammonia.The last aerobic chamber recycles a portion of its effluent (inner recycling) back to the first chamber with a flow rate of Q a and a concentration of Z a .The remaining effluent goes into the settler with a flow rate of Q f and a concentration of Z f .The settler has 10 nonreactive layers and the feed layer is the 6th one.The settler has three outlets: (a) the overflow with purified water that leaves through the first layer at a flow rate of Q e ; (b) the underflow that goes back to the first chamber (outer recycling) at a flow rate of Qr; and (c) the underflow that exits the settler at a flow rate of Q w .The schematic of the wastewater treatment plant consists of a biological reactor and secondary clarifier, with the biological reaction zone further divided into an anoxic area (white) and an aerated area (blue).The entire system is controlled using a model predictive controller.
The 13 components involved in the reaction are listed in Table 1 and can be divided into four categories, except for dissolved oxygen and alkalinity.Indexes 1 to 4 are organic matter, 5 and 6 are microorganisms, 7 is a microbial decay product, and 9 to 12 represent nitrogen components.In each reaction chamber, a dynamic model can be built for these 13 components.For the first biological reaction chamber (k = 1): For the second to fifth biological reaction chambers (k = 2,. . .,5): for which the conversion rate r k of each component is shown in [1].Since the concentration of dissolved oxygen varies with the aeration of the aerobic reaction chamber, the equilibrium equation for dissolved oxygen is special and is set to S * O = 8 g.m −3 .The expressions are as follows: The following are some concentration and flow relationships in the process: A model of the secondary settler is proposed in the BSM1 that uses a double-exponential settling velocity equation that reflects the behavior of the solids in it.The model is divided into 10 layers.The treated effluent from the bio-chemical reaction tank flows into the sixth layer of the secondary clarifier, which is the feed layer.Solids settlement occurs on all layers, so it is generally said that the solids concentration in the secondary clarifier decreases with the number of layers.The settler is modeled based on the mass balance of the sludge, and by default, no chemical reactions occur in the settler.Therefore, the downward solids flux in the settling tank is generated by its own gravity and the liquid flow.The solid-state dynamic model based on mass balance can be expressed by the following equation.For the bottom layer (m = 1): For the second to fifth layers (m = 2,. . ., 5): For the feed layer (m = 6): For layers 7 to 9 (m = 7,. . ., 9): For the top layer (m = 10): where X m represents the solid concentration in the mth layer.The solid flux J s generated by gravity is a function of the total sludge concentration X and the double-exponential settling rate v s (X), which can be calculated as J s = v s (X)X.The settling velocity v s (X) is calculated based on the double-exponential settling rate function, as shown below: X f = 0.75(X S,5 + X P,5 The values for parameters v 0 , r h , r p , and f ns are equal to 474, 0.000576, 0.00286, and 0.00228, respectively.X f is the total solid concentration from the biological reactor.

Compact Form of the System Model
A total of 145 ordinary differential equations are used to described the dynamics of the entire plant.Specifically, the dynamics of each compartment in the biological reactor can be described by 13 ordinary differential equations according to the 13 state variables, and the dynamics of each layer in the secondary settler can be described by 8 ordinary differential equations with the total sludge concentration.The BSM1 can be written in the following compact form: where x ∈ R 145 is the vector of process states and u ∈ R 2 represents a manipulated vector.We chose the internal circulation flow rate (i.e., Q a ) and the oxygen transfer rate in the fifth compartment of the biological reactor (i.e., K L a 5 ) as the manipulated variables.The parameter p ∈ R 14 is the known input vector containing the influent information comprising the inlet flow rate Q 0 and concentration Z 0 .The output vector

Performance Evaluation Criteria
In our study, effluent quality (EQ) is the main performance indicator, which reflects the overall treatment effectiveness of the WWTP.It is defined as the daily average of the weighted sum of the concentrations of different compounds in the effluent over a certain period of time: where t f − t 0 is the time range for evaluating effluent quality; TSS represents the total suspended solids concentration; COD represents chemical oxygen demand; BOD represents biological oxygen demand; S NKj is the Kjeldahl nitrogen concentration; and the subscript e indicates that the concentration is related to the effluent from the settler.
The cost of wastewater treatment is also a significant consideration in evaluating performance.Factors that have a major impact on operating costs include: (a) the amount of sludge to be treated, (b) the energy required for aeration and pumping, (c) external carbon consumption, and (d) mixing energy.
Sludge production (SP) is the average amount of solids (in kg/day) generated by a process during a specific time period T.This includes the solids discharged from the secondary clarifier through Q e and the solids deposited in the WWTP.The total solids collected in the system over a period of seven days can be calculated using the following equation: the w in the equation stands for the effluent from the secondary clarifier.
The aeration energy (AE) is dependent on the characteristics of the plant, such as the diffuser type, submergence depth, bubble size, and so on.AE is calculated based on the oxygen transfer rate (K L a i , i = 1,. . ., 5), and the submergence depth is assumed to be 4 m.The formula for calculating AE is as follows: where S sat O is the oxygen saturation concentration, which is 8 g/m 3 .Pumping energy (PE) is the energy used by the pump for internal and external circulation.It can be calculated as follows: Mixing energy (ME) (kWh/day) is the energy needed to mix the compounds in the anoxic chamber to prevent settling.ME is determined by the volume of each reaction chamber and the oxygen transfer rate: The total cost index (OCI) is an estimate of the total cost of operating the wastewater treatment plant and is calculated as the sum of the main factors listed below: 3. Effluent Quality-Aware Event-Triggered MPC

Brief Introduction
As numerical optimization techniques and the computing capabilities of computers continue to advance, MPC is gradually maturing.In MPC, control actions are obtained by online solving of a finite-time optimal control problem at each sampling instant, where the initial state is the current state of the plant.Optimization yields a finite control sequence, with the first control action applied to the plants.Thus, MPC differs from traditional control, where control laws are pre-computed.MPC implements an implicit control policy.The construction of an MPC problem typically involves these main components: (a) a mathematical model for predicting the system's evolution over a certain time horizon; (b) mapping the system's trajectory within the prediction horizon to a real-valued cost function, where real numbers represent performance evaluations, such as tracking performance or economic performance; (c) consideration of constraints on system states, control inputs, and other relevant factors; (d) a receding horizon implementation.
As previously mentioned, the implementation of MPC involves building and solving optimization problems online, as well as selecting appropriate control and prediction horizons.However, this process can be time-consuming and challenging, even when the existence of a solution is guaranteed, especially for large-scale models such as BSM1.In this work, we propose event-triggered MPC to reduce computational complexity in WWTPs.The structure consists of the WWTP system, model predictive controller, and eventtriggered logic, along with the actuator.The event-triggered logic is designed based on the deviation of the output variables from the setpoints and the effluent quality performance.The structure diagram of the event-triggered control system is shown in Figure 2. At each sampling time t k , the event-triggered logic is evaluated to determine if it is satisfied.If the logic is satisfied, the model predictive controller can calculate the optimal control action for the current time and send it to the actuator.If the logic is not satisfied, the model predictive controller cannot obtain the optimal solution at the current sampling time.In this case, the actuator maintains the control action from the previous time when the triggered condition was satisfied.

Design of Effluent Quality-Aware Event-Triggered Logic
At the initial sampling time t k , k = 0, the MPC strategy is implemented to initialize the system.At subsequent sampling times k > 1, the need for control action updates is determined based on trigger conditions.The evaluation of trigger conditions mainly involves two aspects.Firstly, the tracking performance of the outputs with respect to the optimal setpoints is considered.If the outputs' error relative to the optimal setpoints exceeds a predefined maximum allowable deviation, the triggered logic is satisfied.The model predictive controller calculates the optimal control action to drive the output state towards the allowable state set.The expression is as follows: The first triggered logic is satisfied when E 1 (y) > 0. Here, γ represents the maximum allowable tracking error.The value of γ is often determined based on experience.If it is set too small, it may result in a less significant improvement in computation.On the other hand, if it is set too large, it may result in poor performance.In other words, relying solely on threshold values for logical judgments is not reliable.Therefore, the second aspect is considered, which incorporates effluent quality into the logic design.By intuitively setting the desired effluent quality, performance can be ensured.This allows for further analysis of whether control action updates are necessary, even with an unreasonable γ setting.
Instead of comparing the actual effluent quality with the desired quality at each sampling time step, it is preferable to detect changes in effluent quality earlier in order to make judgments sooner.Therefore, this paper combines effluent quality evaluation with MPC receding horizon optimization.This method can detect deviations from the desired effluent quality over a certain period of time.At sampling time t k , if the MPC has satisfied the trigger condition at time t k−1 , the optimal control sequence u * (i|t k ) is solved for i = t k−1 , t k , . . ., t k+N−2 , as well as the corresponding state sequence x * (j|t k−1 ) for j = t k , t k+1 , . . .t k+N−1 .Additionally, the optimal effluent quality sequence EQ * (x * ) is obtained based on Equation (20).The triggered logic is defined based on the cumulative error between the N optimal effluent qualities and the desired qualities.The expression is as follows: here, σ represents the maximum allowable effluent quality deviation within the horizon.If the trigger logic is not satisfied at time t k−1 , the MPC does not take action and, thus, the sequence information cannot be obtained.In this case, E 2 (x) = (EQ(x(t k )) − EQ set ) − σ N .The effluent quality deviation is evaluated based on the average value of the maximum allowable deviation within the horizon.When E 2 (x) > 0, the second trigger condition is satisfied.If both trigger conditions are met simultaneously, the event triggers the model predictive controller to calculate the optimal control action.Otherwise, the previous optimal control action is maintained until the triggered logic is satisfied.

Design of Event-Triggered MPC and Algorithm
Whether to perform new calculations for the MPC depends on the satisfaction of the triggered logic; specifically, the evaluation of whether E 1 and E 2 are greater than zero.If this condition is met, the MPC acquires the latest state updates at the current sampling instance.Event-triggered MPC employs a conventional dual-layer control structure.In this structure, the upper real-time optimization (RTO) layer is responsible for executing steady-state economic optimization to ascertain the optimal setpoint.This setpoint is then transmitted to the lower-layer MPC, where nonlinear output feedback tracking MPC is implemented to track the optimal setpoint from the RTO layer.The MPC problem can be formulated at sampling time t k as shown below: y min ≤ y(t) ≤ y max (28e) where N p and N u denote the prediction and control horizon, respectively; y set represents the setpoints; and δu = u(t k ) − u(t k−1 ) represents the change in control action.Q and R are weighting matrices that determine the importance of the process states and control inputs throughout the horizon.A larger weight on Q favors sacrificing control effort to ensure state tracking, while a larger weight on R places greater emphasis on control changes.Equation (28a) represents the cost function of the MPC optimization problem.Equations (28b) and (28c) describe the plant model, where x represents the predicted state trajectory of the system for the input trajectory calculated by the MPC optimization problem and f (•) is defined in Equation (18).In this study, it is as-sumed that there is no model error or measurement disturbance, which means that the predicted value x is equal to the measured value x.Equation (28d) denotes the initial condition at time t k .Equations (28e) and (28f) represent output constraints and physical constraints for safety reasons, respectively.After solving for the optimal control sequence {u * (t k ), u * (t k+1 ), . . .u * (t k+N−1 )} at time t k , the first item u * (t k ) is applied to the system.The symbol * denotes the optimal solution.At the next sampling time that satisfies the triggering logic, the model predictive controller updates the initial state and repeats the process until the end time is reached.Algorithm 1 summarizes the proposed event-triggered MPC implementation strategy.
Algorithm 1: Effluent quality-aware event-triggered algorithm As can be seen from Equations (28b) and (28c), we have not taken into account the influence of the model error.In this paper, we emphasize an event-triggered approach for WWTPs that aims to conserve computational resources without compromising performance.For addressing the model error, please see reference [24].

Simulation Results
In this section, we evaluate the performance of the effluent quality-aware eventtriggered MPC strategy under three different weather conditions: dry, rainy, and stormy.We compare the results obtained with the event-triggered MPC with those obtained with a PI controller and the traditional MPC strategy.Additionally, we investigate the effectiveness of effluent quality-aware event-triggered control.

Simulation Settings 4.1.1. Relevant Plant Simulation Settings
The influent data used in this study were obtained from the International Water Association (IWA) website and cover a period of 14 days with a sampling time interval of 15 min.The weather data for the first 7 days remain consistent, while the data for the following days reflect the corresponding weather conditions.Therefore, in the evaluation of the results, t 0 = 8 d, t f = 14 d, and T = 7 d.The initial conditions for the five bioreactors are shown in Table 2, and the initial conditions for the secondary settler are shown in Table 3.In the MPC simulation, both the control horizon and prediction horizon were set to 8; i.e., N p = N u = 8.The setpoints for the outputs were defined as S NO,2 = 1 gN/m 3 and S O,5 = 2 g(−COD)/m 3 .The maximum allowable deviation for the tracking variables, denoted as γ, was set to [0.5,0.5].The desired effluent quality under the three weather conditions was set to 5 × 10 3 kg.poll.units.day−1 .The maximum allowable cumulative deviation for the effluent quality within the horizon, denoted σ, was set to 10 3 kg.poll.units.day−1 .The weight matrices in Equation (28a) were defined as follows: The input constraints were defined as follows: where Q 0,stable = 18,446 m 3 /d.In addition, two operating regions were defined for the two outputs: All simulations were conducted using Casadi with the Ipopt solver.The parameters of the two PI controllers can be found in Table 4.

Simulation in Dry Weather
In this simulation, we initially compared the performance of traditional model predictive and PI controllers under dry weather conditions.The upper plots in Figures 3 and 4 depict the trajectories of the outputs S NO,2 and S O,5 .The blue solid line represents the traditional model predictive control strategy, while the black dashed line represents the PI control strategy.From the figures, it is evident that the output trajectories under the traditional model predictive controller quickly converged to the setpoints after minor fluctuations, whereas the PI controller exhibited larger oscillations and slower response time.Therefore, the traditional model predictive controller demonstrated superior performance in terms of setpoint tracking compared to the PI controller.Under the MPC strategy, the relative variation ranges of S NO,2 and S O,5 with respect to their setpoints were ±0.02 gN/m 3 (±2%) and ±0.02 gN/m 3 (±1%), respectively.However, under the PI controller, the relative variation ranges of the two outputs with respect to their setpoints were ±0.79 gN/m 3 (±79.2%)and ±1.207 gN/m 3 (±60.35%).The lower plots in Figures 3 and 4 present the corresponding control input trajectories Q a and K L a 5 .The blue dashed lines in the figures represent the upper limits of the control inputs, and it can be observed that all control actions remained within their constraint ranges.This was because MPC inherently addresses the interactions between controlled variables, handles system constraints, and utilizes future behavior trajectories to compute control actions.However, it is important to note that this process may involve unnecessary computational steps, hence the application of the algorithm proposed in Section 3 to the WWTP.
Under dry weather conditions, the effluent quality-aware event-triggered MPC was implemented in the system.The output and input trajectories under event-triggered control are represented by orange dotted lines in Figures 3 and 4.After applying Algorithm 1, the present control action is not optimized when the event-triggered condition is not satisfied.Instead, the optimal control action from the previous triggered time is retained.The optimal control action is only updated and applied when the triggered condition is satisfied at some future time.As a result, the performance in terms of setpoint tracking is not as good as traditional MPC.However, it is important to note that the control of the BSM1 in wastewater treatment differs from trajectory optimization models that primarily focus on parameter tracking.Good tracking performance only reflects the capability of the controller and does not necessarily indicate the overall effectiveness of the control system.Therefore, the main considerations should be the effluent quality (EQ) and the operational cost index (OCI).The EQ result obtained using the proposed event-triggered MPC in this study was 5970.88 kg.poll.units.day−1 , with an OCI of 16,386.08.On the other hand, under traditional MPC, the EQ was 5966.71kg.poll.units.day−1 , with an OCI of 16,382.68.The difference between the two is relatively small, but the event-triggered control reduced the computational effort by 27.06%.
Within a period of 14 days, there were a total of 1345 sampling instances (every 15 min).Figure 5 presents an evaluation of the triggering events for the last seven days.The yaxis values in the figure represent whether the triggered logic was satisfied.A value of "0" represents no triggering of control actions or update information, while a value of "1" indicates that the controller received new states and recalculated control actions.To provide a clearer view of the simulation results, the triggered events for days 10 to 11 are magnified in the figure.The purple line represents the effluent quality (normalized).From the figure, it can be observed that long periods of continuous triggering often occurred during times when the effluent water quality was relatively poor.This indicates that the controller was able to maintain operation and track the steady-state optimal setpoint even under conditions of poor effluent quality.Table 5 compiles an overview of the performance exhibited by the three control strategies during dry weather conditions.Additionally, it presents results for γ set at 0.01, with these outcomes closely mirroring the performance observed under traditional MPC.
Furthermore, the table offers delineations of the limits for the variables S NH,e , N tot,e , TSS e , COD e , and BOD e .The simulation results indicated that all these variables were within the corresponding limits specified for wastewater discharge regulations.In this section, we evaluated the performance of the three control strategies under rainy and stormy weather conditions.The rainy weather file consisted of one week of dynamic dry weather data followed by long-term rainfall data for the second week.Similarly, the stormy file included one week of dynamic dry weather data followed by the addition of storm event data to the dry weather data for the second week.
Figures 6 and 7 display the trajectories of the outputs S NO,2 and S O,5 with these three strategies, as well as the corresponding control input trajectories, under the rainy weather condition.Similarly, Figures 8 and 9 show the output and control input trajectories of the three control strategies under stormy weather conditions.
Figures 10 and 11 illustrate the triggering behavior and effluent quality curves under event-triggered MPC for each weather condition.Similar to what was observed under dry weather conditions, continuous triggering occurred when the effluent quality was relatively poor.Under rainy weather conditions, the EQ with the PI controller was 8339.92 kg.poll.units.day−1 ; with MPC, it was 8108.55 kg.poll.units.day−1 ; and with event-triggered MPC, it was 8108.79 kg.poll.units.day−1 .Under stormy weather conditions, the EQ with the PI controller was 7288.69 kg.poll.units.day−1 ; with MPC, it was 7098.53 kg.poll.units.day−1 ; and with event-triggered MPC, it was 7099.11kg.poll.units.day−1 .The effluent quality performance under event-triggered MPC was almost the same as that under traditional MPC.However, the triggered times were reduced by 24% and 25.4%, respectively, indicating that this approach can avoid unnecessary computations based on performance indicators.Table 6 summarizes the performance of the three control strategies under rainy and stormy weather conditions.The table also provides the limits for the variables S NH,e , N tot,e , TSS e , COD e , and BOD e .The simulation results indicate that all these variables were within the corresponding limits specified by wastewater discharge regulations.The table additionally presents results for γ = 0.01 under two different weather conditions, and these outcomes were largely consistent with the performance achieved under traditional MPC.This observation highlights the efficacy of effluent quality-aware event-triggered control with smaller threshold settings in mitigating the occurrence of the alternating trigger and non-trigger patterns inherent in single-threshold logic.Furthermore, even with larger threshold values, this approach maintains the ability to track optimal setpoints during periods of poorer effluent quality.

Comparative Experiment
In this section, we compare the event-triggered control algorithm proposed in this paper with the algorithm presented in [20] under stormy weather conditions.The triggered logic designed in [20] is defined as follows: where µ represents the maximum allowable deviation of the one-step-ahead predicted output from the desired setpoint.It is also stipulated that the maximum time interval for situations not meeting the triggered logical is N∆, where ∆ represents the sampling time interval.The event-triggered behavior when applying this triggered logic to a WWTP in stormy weather conditions is depicted in Figure 12.From the figure, it is clear that, even during sampling intervals with poor effluent quality, the controller was permitted to remain inactive.While this triggered logic did help reduce computational load, effluent quality performance exhibited uncertainty, which was closely related to the values of γ and µ.Finding the appropriate threshold to balance the relationship between computational load and performance may be challenging for operators.
The comparative data for the two different event-triggered logic methods are summarized in Table 7, where O EMPC corresponds to the results obtained using the event-triggered logic from Equation (32) and N EMPC corresponds to the results obtained using the eventtriggered from Equations ( 26) and (27).It can be observed that the effluent quality achieved using the trigger logic from Equation (32) was 7154.09kg.poll.units.day−1 , which was unsatisfactory compared to the effluent quality of 7098.53 kg.poll.units.day−1 achieved under traditional MPC.However, the effluent quality obtained by applying the trigger logic from Equations ( 26) and (27) was 7099.11kg.poll.units.day−1 , aligning with the performance of traditional MPC.Operators can intuitively set the desired effluent quality to strike a balance between computational load and performance.In other words, the event-triggered logic proposed in this paper for WWTPs has the capability to conserve computational resources without compromising performance.

Conclusions and Future Work
In this paper, an effluent quality-aware event-triggered model predictive control strategy was proposed for the BSM1 to reduce the computational burden of the controller.Simulation results demonstrated that both the traditional MPC and the event-triggered MPC outperformed the PI control strategy in terms of controlling the wastewater treatment process.However, the event-triggered MPC strategy, which is based on the deviation of effluent quality performance and tracking variables, seeks a balance between computational time and performance requirements.Therefore, it can shorten the computation time while achieving performance comparable to traditional MPC.On average, this algorithm can reduce the computational load by 25.49%, with almost no impact on performance.
For future work, we will consider the problem of model error to enhance the robustness of event-triggered control.The proposed method may also be combined with other schemes to ensure effluent quality and further reduce computational burden.For example, by applying a variable horizon strategy based on the event-triggered control, the horizon can be incorporated into the decision variables of the optimization problem to minimize the single-step computation time.In simple terms, the event-triggered control strategy determines "whether to do", while the variable horizon control strategy determines "how to do".Therefore, effluent quality-aware event-triggered control represents a promising approach that can greatly enhance wastewater treatment efficiency.

Figure 1 .
Figure 1.The schematic of the wastewater treatment plant consists of a biological reactor and secondary clarifier, with the biological reaction zone further divided into an anoxic area (white) and an aerated area (blue).The entire system is controlled using a model predictive controller.

Figure 3 .
Figure 3. Trajectories of S NO,2 and Q a with the PI control (black lines), MPC (blue lines), and MPC with ET (orange lines, γ = 0.5) in dry weather conditions.

Figure 4 .
Figure 4. Trajectories of S O,5 and K L a 5 with the PI control (black lines), MPC (blue lines), and MPC with ET (orange lines, γ = 0.5) in dry weather conditions.

Figure 5 .
Figure 5. Triggering effect (blue line connecting the red and green dots) and effluent quality (purple line) in dry weather.

Figure 6 .
Figure 6.Trajectories of S NO,2 and Q a with the PI control (black lines), MPC (blue lines), and MPC with ET (orange lines, γ = 0.5) in rainy weather conditions.

Figure 7 .
Figure 7. Trajectories of S O,5 and K L a 5 with the PI control (black lines), MPC (blue lines), and MPC with ET (orange lines, γ = 0.5) in rainy weather conditions.

Figure 8 .
Figure 8. Trajectories of S NO,2 and Q a with the PI control (black lines), MPC (blue lines), and MPC with ET (orange lines, γ = 0.5) in stormy weather conditions.

Figure 9 .
Figure 9. Trajectories of S O,5 and K L a 5 with the PI control (black lines), MPC (blue lines), and MPC with ET (orange lines, γ = 0.5) in stormy weather conditions.

Figure 10 .
Figure 10.Triggering effect (blue line connecting the red and green dots) and effluent quality (purple line) in rainy weather.

Figure 11 .
Figure 11.Triggering effect (blue line connecting the red and green dots) and effluent quality (purple line) in stormy weather.

Figure 12 .
Figure 12.Triggering effect (blue line connecting the red and green dots) and effluent quality (purple line) in stormy weather using the triggered logic from Equation (32).

Table 1 .
Definition of and notation for the process variables for WWTPs.

Table 2 .
Initial conditions of the biological reactor.

Table 3 .
Initial conditions of the secondary settler.

Table 4 .
Parameters of PI controllers.

Table 5 .
Performance in dry weather.

Table 6 .
Performance in rainy and stormy weather.

Table 7 .
Performance with different types of event-triggered logic.