Economic model predictive control of wastewater treatment plants based on BSM1 using linear prediction models Rub´ en Moliner-Heredia 1 , Ignacio Pe˜ narrocha-Al´ os 1 & Roberto Sanchis-Llopis 1 Abstract—In this paper, we have developed an Economical Model Predictive Control (EMPC) for a Wastewater Treat- ment Plant (WWTP) with the use of a standard semidefinite programming solver. In this case, the objective has been to keep the ammonium concentration in the effluent under limits manipulating the air insufflation pumps at the biological reactor and an internal recycle valve. The minimized cost function consists of the product of the energy consumed by the air insufflator and the cost of the electricity, taking into account the variations of the tariffs over the day. We have simulated the behaviour of the WWTP using the Benchmark Model Simulation n o 1 (BSM1), and we have developed a linear prediction model in order to apply the EMPC method. Keywords: BSM1, Wastewater Treatment Plants, Economic Model Predictive Control, Electricity Tariffs, Linear Prediction Models, Hammerstein-Wiener Models. I. INTRODUCTION Wastewater is one of the results of human activity. This polluted water must be treated before returning it to the environment. Wastewater Treatment Plants (WWTPs) are industrial facilities whose aim is to treat and cleanse wastew- ater in order to return it in acceptable conditions. Thus, WWTPs are crucial agents in an environment-friendly so- ciety, so an appropriate control of their behaviour is essen- tial. Unfortunately, WWTPs are complex nonlinear dynamic systems subjected to large disturbances and uncertainties. This is due to the fact that these systems must face wide variations of the influent wastewater, and the biochemical and physical processes that happen in their inside feature limits and saturations. Therefore, controlling WWTP can be an intricate task. In the literature, different control strategies have been proposed. Most of those papers are based on the model that the Benchmark Model Simulation n o 1 offers [1], which also has developed a control strategy that consists of two proportional-integral controllers (PI). Another paper [2], also takes into account this control method, and compares its performance with a Model Predictive Control (MPC) and with an Economic Model Predictive Control (EMPC) they have proposed. Other papers, such as refs [3]–[5], have also developed EMPC methods. While all of them use Performance Indexes (which are linear combinations of inner states of the WWTP utilized to check its performance assessment) or weighted variations of those indexes in order to minimize a cost function proposed by the BSM1, none of them take into consideration the electricity tariff variation, 1 Departamento de Ingenier´ ıa de Sistemas Industriales y Dise˜ no, Univer- sitat Jaume I, Castell´ on de la Plana, Spain which changes over the day. Besides, more control methods have been proposed, such as fuzzy control in [6]. A more deep dynamic analysis of the WWTPs is also addressed in [7]. On the other hand, some papers (ref [2]–[4]) apply the optimization (which is needed to solve the EMPC problem) directly onto the whole system, so it technically becomes a nonlinear model predictive control method. Actually, papers [3], [4] use a simplification of the BSM1 model, which reduces the calculation time (but it is still a nonlinear MPC). A linear prediction model would significantly reduce the calculation time while using the BSM1 equations, as well as the implementation cost. II. MODEL DESCRIPTION A. Base Model In order to obtain an appropriate model of a WWTP, we have used the Benchmark Simulation Model n o 1 (BSM1) [1]. This model describes the behaviour of a biological reactor with two non-aerated compartments followed by three aerated compartments. The equations that regulate this reactor come from the Activated Sludge Model n o 1 (ASM1). The BSM1 also describes the behaviour of the secondary clarifier. An explanation of these equations can be found in [8]. As it can be seen in Figure 1, influent wastewater (Q i ) enters the bioreactor and crosses all the compartments. In the meanwhile, the bacteria stored in the reactor treats the wastewater, eliminating some components and generating some others. In the last compartment, there is a bifurcation, where some of the flow (Q int ) is recycled back to the first compartment, and the other part flows to the secondary clarifier (Q f ). Here, wastewater is subjected to a settling process, and the flow is yet divided into the effluent (Q e ), which may be dumped directly into the river, and the underflow (Q u ), which is rich in particulate components. This flow is partially purged to eliminate some of these particles, which results in the generation of sludge (Q w ). The rest of the flow (Q r ) is also recycled back to the first compartment of the biological reactor. The differential equations that model the BSM1 use 13 different internal states for each compartment, which cor- respond with 12 components and a measure of alkalinity. In this paper, due to the recent improvements in the field of ammonium sensors, we have chosen the ammonia and ammonium concentration in the effluent flow (S NH,e ) as the measured variable. In correspondence with the BSM1 exam- ple, the oxygen transfer coefficient in the fifth compartment (k L a 5 ) is a controllable input. Besides, we have considered