## 1 Introduction
In [PERSON] [17] a stable MPC controller is presented that efficiently incorporate the stationary-control objectives into a single control formulation considering a velocity model in the input \(\Delta u\) instead of \(u\). In [PERSON] [18] implement a single-layer economic oriented model predictive control approach for the optimization of the operation of WWTP considering two different formulations of the economic MPC cost function. The first allows for a pure economic index in the controller optimization problem and the second uses a combination of a measure of the deviation from the set-point and an economic performance index. The main scope of this paper is the proposal of a new single layer Nonlinear Closed-Loop Generalized Predictive Control (NECLGPC) based on an economic nonlinear GPC, as an efficient advanced control technique for improving economics in the operation of nonlinear plants. It is well known that closed loop predictive control procedure is an effective strategy and has been exploited to decrease computational demand of solving optimization control problems. Traditionally, in this type of control two modes of operation are considered over an infinite prediction horizon at each sampling time, being a reformulation of a classical dual mode predictive control [19]. The predicted control moves are centered around a unconstrained stabilizing control law, \(u(k)=F(x(k))\), over the whole prediction horizon, but some additive degrees of freedom \(u(k)=F(x(k))+c(k)\) are added over a finite horizon to handle constraints and to guarantee feasibility improving performance. Therefore there is an implicit switching between one mode of operation and the other as the process converges to the desired state. Researchers in the MPC field have progressively adopted the closed loop MPC due to its good properties. For instance, it gives better numerical conditioning of the optimization [20; 21] and it makes robustness analysis more straightforward even for the constrained case [22; 23]. The proposed approach, in contrast to classic closed loop MPC schemes, where the terminal control law is computed offline by solving a linear quadratic regulator problem [24; 25; 26], computes analytically the terminal control law online by solving an unconstrained Nonlinear Generalized Predictive Control (NGPC) minimizing a cost function constituted by tracking errors and economic costs. In order to be able to obtain an analytical solution of this non linear optimization problem two considerations have been made in the present work. Firstly, the prediction model consisting of a nonlinear phenomenological model of the plant is written in the extended linearization form or state dependent coefficient form, which actually allows having nonlinear model expressed with linear structure and state dependent matrices. Secondly, instead of including the nonlinear economic cost in the objective function, an approximation of the reduced gradient of the economic function is used. In this way the problem becomes a quadratic one, and can be solved analytically, at each sampling time, as in the linear case to obtain the terminal control law to be used within the closed loop MPC scheme. The above considerations also allow for the evaluation of the extra degrees of freedom \(c(k)\) by solving a Quadratic Programing (QP) problem using the same objective function and the same prediction model that leads to a linear set of constraints, at each sampling time. The resulting control signal \(u(k)=F(x(k))+c(k)\) is then applied to the plant. In the present work the Nonlinear Economic Closed-Loop Generalized Predictive Control (NECLGPC) is also used as an efficient advanced control technique for improving economics in the operation of the N-Removal process of Wastewater Treatment Plant (WWTP). As it is well known, this is an interesting case study because these plants need to operate efficiently in order to meet stricter environmental regulations with minimum costs.