Next Article in Journal
Investigation into the Effects of the Variable Displacement Mechanism on Swash Plate Oscillation in High-Speed Piston Pumps
Previous Article in Journal
Analytical Point-Cloud Based Geometric Modeling for Additive Manufacturing and Its Application to Cultural Heritage Preservation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

One Layer Nonlinear Economic Closed-Loop Generalized Predictive Control for a Wastewater Treatment Plant

1
Department of Automatic and Computer Science, University of Salamanca, 37008 Salamanca, Spain
2
Higher Technical School of Engineering, Bejar, University of Salamanca, 37008 Salamanca, Spain
*
Author to whom correspondence should be addressed.
Appl. Sci. 2018, 8(5), 657; https://doi.org/10.3390/app8050657
Submission received: 21 February 2018 / Revised: 15 April 2018 / Accepted: 18 April 2018 / Published: 24 April 2018

Abstract

:
The main scope of this paper is the proposal of a new single layer Nonlinear Economic Closed-Loop Generalized Predictive Control (NECLGPC) as an efficient advanced control technique for improving economics in the operation of nonlinear plants. Instead of the classic dual-mode MPC (model predictive controller) schemes, where the terminal control law defined in the terminal region is obtained offline solving a linear quadratic regulator problem, here the terminal control law in the NECLGPC is determined online by an unconstrained Nonlinear Generalized Predictive Control (NGPC). In order to make the optimization problem more tractable two considerations have been made in the present work. Firstly, the prediction model consisting of a nonlinear phenomenological model of the plant is 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. These assumptions allow us to design an economic unconstrained nonlinear GPC analytically and to state the NECLGPC allow for the design of an economic problem as a QP (Quadratic Programing) problem each sampling time. Four controllers based on GPC that differ in designs and structures are compared with the proposed control technique in terms of process performance and energy costs. Particularly, the methodology is implemented in the N-Removal process of a Wastewater Treatment Plant (WWTP) and the results prove the efficiency of the method and that it can be used profitably in practical cases.

1. Introduction

Industry requires optimal operation procedures and advanced control systems to cope with the different factors that affect plant economics and process performance. The two-layer real time optimization strategy (RTO) has been successfully and widely applied in chemical processes for the economic optimization of plant operation. This process control architecture consists of the steady state real time optimization (RTO) of the trajectories for the regulated variables in terms of costs, in an upper level, followed by a model predictive controller (MPC) that executes the direct control actions on shorter time-scales, in a lower level [1,2,3].
Nevertheless, the steady state RTO approach may not be satisfactory in some cases leading to sub-optimal economic plant performance [4,5,6,7,8]. An important weakness of this approach is the inconsistency between the nonlinear steady-state models used in the RTO layer and the usual linear dynamic models used in the regulatory MPC layer. Another drawback is the delay in the optimization associated with the steady-state assumption in the RTO layer; because, it can produce an incorrect prediction of the operational point in the presence of frequent disturbances. The Dynamic Real Time Optimization (D-RTO) has been proposed to overcome the limitations of the stationary RTO for the dynamic nonlinear behavior of processes [9,10].
In this context, the integration of RTO into model predictive controllers (MPCs) is an interesting alternative. The Model Predictive Control (MPC) technique has been successfully used in advanced control of chemical processes. The MPC algorithm translates the control problem into an optimization one. At each sampling time, the MPC algorithm calculates the appropriated sequence of future manipulated variable adjustments, carrying out an on-line optimization of the future plant behavior [11,12]. An explicit process model is used to estimate the future response of the plant within a specific time horizon. A standard quadratic regulatory cost function is typically used, but it can be modified to quantify economic and/or operational objectives within the dynamic optimization problem [4,13,14,15]. Moreover, constraints can be imposed not only on the admissible range of the inputs and control variables, but also, on decisions related to product quality, economic efficiency and general operating requirements. These particular characteristics of MPCs algorithm allow for the consideration of cost effectiveness criteria and optimal operation policies in the control problem formulation, leading to economic oriented MPCs [9].
The optimization of plant economic performance based on the integration of RTO and MPC has been addressed by in single level and two level strategies [7,10]. In the single level strategies the economic optimization and control objectives are included in a single MPC algorithm in order to improve both economic and control performance in a cohesive manner. In Zanin [15], an optimizing MPC is defined to achieve both tasks by adding an economic objective term to the standard MPC objective function, observing that the one-layer procedure could react to frequent disturbances faster than the multilayer approach. However, a disadvantage of this procedure is that the incorporation of the economic objective turns the optimization problem, into a Nonlinear Programming (NLP) problem, where the objective function is nonlinear and there are nonlinear constraints corresponding to the steady-state model of the process system. Consequently, the expected computational effort required to compute the control sequence can be much higher than in the conventional MPC. As a solution, De Souza et al. [16] proposed a simplified version of the one-layer optimizing MPC. In their approach, the objective function of the MPC controller is also modified to include a term related to the economic objective, but the economic information is restricted to an estimation of the gradient of the economic objective. In Teodoro [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 Δ u instead of u. In Silvana [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. Moreover, they are nonlinear systems involving very complex time varying biological processes with a strong interaction between the state variables dealing with large disturbances at the input flow and load, together with variations in the composition of the incoming wastewater. The controllers proposed in this work use an approximated non-linear phenomenological model of the process for predictions. The use of the simplified model reduces the computing effort for the controller execution, but produces plant-model mismatch problems while capturing its non-linear behavior. Here, the measurements of the constrained and the controlled variables are used to update the constraints and the cost function in the optimization problem, which is a technique commonly used to address plant-model mismatch problems [27]. All these characteristics make the processes involved in the water treatment very difficult to control and to operate, especially if the operating costs (pumping and aeration energy) have to be minimized fulfilling all the quality specifications and operational constraints [28,29,30,31].
The organization of the paper is as follows: The general control formulation is detailed in Section 1. The Section 2 is devoted to the presentation of nonlinear closed loop GPC controller. In Section 3, the modeling of the process together with the associated operational costs is developed. The simulation results are discussed and interpreted in Section 4. Finally, in Section 5 the general conclusions are drawn.

2. Problem Statement

In this work, we consider the class of nonlinear systems described by the following state-space model:
x ˙ ( t ) = f ( x ( t ) , u ( t ) ) y ( t ) = g ( x ( t ) )
where x ( t ) R n is the state vector, u ( t ) R m is the manipulate input vector and y ( t ) R p is the output.
In order to solve the problem of control in the same way as the linear quadratic regulator, first the continuous nonlinear model of the process ( 1 ) is discretized using the Euler integration method and re-arranged into the state-dependent coefficient form [12] as:
x ( k + 1 ) = A ( x ( k ) ) x ( k ) + B ( x ( k ) ) u ( k ) y ( k ) = C ( x ( k ) ) x ( k )
where x ( k ) R n , y ( k ) R p and u ( k ) R m are the state , the output and the input vectors respectively at the kth sampling instant.
The general formulation of the problem (Equations (3)–(8)) consists of the optimization of a cost function that represents the control and economic objectives, subject to a set of constraints. The objective function includes the penalization of control error, the penalization of control efforts and a term ( f e c o ) that accounts for the economic objectives:
J = i = 1 n y | | w 1 ( r ( k + i | k ) ) y ( k + i | k ) | | 2 2 + i = 0 n u 1 | | w 2 Δ u ( k + i | k ) | | 2 2 + i = 1 n y w 3 f e c o ( u ( k + i | k ) , y ( k + i | k ) )
and the minimization of J at each sampling time is subject to the following constraints:
u m i n u ( k + i | k ) u m a x , i = 0 , , n u 1
y m i n y ( k + i | k ) y m a x , i = 1 , , n y
Δ u m i n Δ u ( k + i | k ) Δ u m a x , i = 0 , , n u 1
x ( k + i | k ) = A ( x ( k + i | k ) ) x ( k + i | k ) + B ( x ( k + i | k ) ) u ( k + i | k ) , k 1
y ( k + i | k ) = C ( x ( k + i | k ) ) x ( k + i | k ) , k 1
where n y and n u are the output and input horizon, respectively; u ( k + i | k ) is the control input computed at time k to be predicted at time step k + i ; y ( k + i | k ) is the output prediction at time step k + i ; r is the desired value of the output; Δ u ( k + i | k ) = u ( k + i | k ) u ( k + i 1 | k ) ; w 1 , w 2 and w 3 are positive definite matrices. Note that the different terms of the cost function must be weighted such that the economic criterion and the dynamic compensation of the output error have a similar influence on the values of the overall cost. It is assumed that the state variables are measurable.
The control strategy proposed in this paper is described schematically in Figure 1, This controller is achieved by using a new closed loop nonlinear predictive control paradigm that combines an unconstrained economic nonlinear Generalized Predictive Control law F ( x ( k ) ) with the parameterization c ( k ) , associated with the closed loop paradigm that allows taking into account the process constraints and improving the performance of the controller.
Some specific characteristics of this control strategy are:
  • The optimizer shown in the control scheme (Figure 1) constitutes the economic nonlinear closed loop paradigm. The predicted control moves are centered around an unconstrained stabilizing control law, u ( k ) = F ( x ( k ) ) x ( k ) , over the whole prediction horizon, and some additive degrees of freedom, c ( k ) , are added over a finite horizon to handle constraints. The resulting control u ( k ) = F ( x ( k ) ) x ( k ) + c ( k ) is applied to the plant.
  • In the objective function the nonlinear economic term is replaced by its gradient making this function a quadratic one.
  • The prediction model, a nonlinear phenomenological model of the plant, is written as a state dependent coefficient model, also called extended linearization, which consists of factorizing the nonlinear system in a linear structure with state dependent matrices.
  • The above assumptions allow us to design an economic unconstrained nonlinear GPC analytically, and its stabilizing control law, u ( k ) = F ( x ( k ) ) x ( k ) , and to state the NLCLGPC problem as a QP problem each sampling time.

3. Controller Design

In this section, the Closed Loop Model Predictive Control (CLMPC) that is the basis of the one layer economic controller proposed is presented, starting with the open loop MPC, the predictions using state dependent coefficient matrices and the optimization.
The predictions are obtained using a discrete time varying prediction model of the process along the prediction horizon n y of the form:
x ( k + i + 1 | k ) = A ( k + i | k ) x ( k + i | k ) + B ( k + i | k ) u ( k + i | k ) , i = 0 , 1 , , n y 1
With initial condition established by:
x ( k | k ) = x ( k )
The predicted input sequences are often stacked into the matrices u ̲ defined by:
u ̲ = u ( k | k ) u ( k + 1 | k ) u ( k + n u 1 | k )
Clearly J ( k ) is a function of u ( k ) , and the optimal input sequence for the problem minimizing J ( k ) is denoted u ̲ * ( k ) :
u ̲ * = a r g min u ̲ ( k ) J ( k ) Subject to ( 3 ) , ( 4 ) and ( 5 )
In order to improve the numerical conditioning of the optimization and the controller performance, a closed loop MPC has been considered by defining the predicted input sequence along the control horizon specified by n c as:
u ̲ = [       F ( k ) x ( k ) + c ( k ) F ( k + 1 ) x ( k + 1 ) + c ( k + 1 ) F ( k + n u 1 ) x ( k + n u 1 ) + c ( k + n u 1 )     } Mode   1 F ( k + n u ) x ( k + n u ) F ( k + n u + 1 ) x ( k + n u + 1 ) F ( k + n u + n y ) Φ ( k + n u + n y 1 ) Φ ( k + n u ) x ( k + n u ) } Mode   2 ]
where, F ( x ( k ) ) R m × n is a nonlinear stabilizing state feedback and Φ ( k ) = A ( k ) + B ( k ) F ( x ( k ) ) .
Then, the predictions considering the closed loop control law are:
x ( k + i | k ) = A ( x ( k + i 1 | k ) ) x ( k + i 1 | k ) + B ( x ( k + i 1 | k ) ) u ( k + i 1 | k ) ; u ( k + i | k ) = F ( x ( k + i | k ) ) x ( k + i | k ) + c ( k + i | k ) , i = 0 , , n u 1 . u ( k + i | k ) = F ( x ( k + i | k ) ) x ( k + i | k ) , i n u .
The system model becomes
x ( k + 1 ) = ( A ( x ( k ) ) + B ( x ( k ) ) F ( x ( k ) ) ) x ( k ) + B ( x ( k ) ) c ( k ) y ( k ) = C ( x ( k ) ) x ( k )
Where c ( k ) R m is the new manipulated input.
Thus the problem to be minimized at each sampling time is:
c ̲ * = a r g min c ̲ ( k ) J ( k ) subjet to         Constraints ( 4 ) , ( 5 ) and ( 6 ) x ( k + i + 1 | k ) = Φ ( k + i | k ) x ( k + i | k ) + B ( k + i | k ) c ( k + i | k ) for i = 0 , , n u 1 . x ( k + i + 1 | k ) = Φ ( k + i | k ) x ( k + 1 | k ) , for i n u
where, c ̲ ( k ) = [ c T ( k | k ) c T ( k + n u 1 | k ) ] T and c ̲ * ( k ) is the first element of c ̲ ( k ) .
The closed loop nonlinear GPC controller is implemented in a moving horizon framework. At current time step k, the plant state x ( k ) is used as the initial condition and the economic optimization problem is solved on a horizon n y , however, only the first calculated control action is implemented ( u ( k ) = F ( x ( k ) ) x ( k ) + c * ( k ) ) . At the next time step k + 1 , we move the time frame one step ahead and the problem is solved with the new plant state x ( k + 1 ) as the initial condition.
Remark. 
1.
Due to the non uniqueness of A ( x ( k ) ) different choices may produce different controllability matrices and one can always find a stabilizable pair ( A ( x ( k ) ) , B ( x ( k ) ) ) . However, although this may be quite easy for lower order systems is becomes laborious for hight order systems.
2.
There are numerous ways to choose A ( x ( k ) ) and the choice of A ( x ( k ) ) can affect the performance of the controller. Therefore, the non uniqueness of this matrix leads to that the controller developed here is suboptimal rather than optimal.
In the next section, the procedure for obtaining the controller proposed in this work is detailed. First, the analytical solution of the unconstrained economic NLGPC law is computed through the modification of the economic function, later, this law is used to predict the outputs over a prediction horizon with a Nonlinear closed loop Model Predictive Control.
With the aim to integrate RTO with NGPC in one single layer, the inclusion of the gradient of the economic function as an additional term in the cost function is proposed. This approach incorporates the economic objective into the NGPC controller such that the RTO and NGPC are solved in a single optimization routine.

3.1. The Nonlinear GPC with Economic Objective

The objective of this section is to design a nonlinear GPC controller that directly accounts for economic objectives. This is achieved designing a one-layer RTO-GPC controller. To derive the non-linear predictive control algorithm the future trajectory of the system is assumed to be known. State-space model (2) matrices may be re-calculated for the future using the future trajectory. The resulting state-space model may be seen as a time-varying linear model and for this model the controller is designed. In the proposed strategy, due to the presence of f e c o , the objective function Equation (3) is not a quadratic function of the manipulated variables of the optimization problem that defines the controller. Thus, the control problem turns into an NLP, which may result difficult to solve.
Then, assuming that the vector of the control action is changed to u + Δ u , the first order approximation of the gradient of the economic function
F e c o = f e c o ( u , y ^ )
can be represented as follows:
ξ u + Δ u = D + G Δ u ¯
D = F e c o y K P + F e c o u
G = K P T 2 F e c o y 2 K P + F e c o y ( 2 F e c o y u ) + 2 F e c o u 2
where K P = y u corresponds to the process gain.
In the Equation ( 17 ) , Δ u ¯ = u ( k + m 1 | k ) u ( k 1 | k ) is the total move of the input vector, D is the gradient vector at the present time and G is the Hessian of the economic function with respect to the inputs. The gradient vector ξ ( u + Δ u ) T can be considered as a deviation vector, which is equivalent to considering that the gradient of the economic function is zero at the optimum. Thus, f e c o can be approximated by a quadratic function as
f e c o = ξ ( u + Δ u ) T ξ ( u + Δ u ) .
Remark. 
In the unconstrained economic optimization, the operating point where the gradient ξ is equal to zero corresponds to a local maximum (when G < 0 ) or local minimum (when G > 0 ) of the economic function. However, when the constraints of the control problem are active, the optimum corresponds to the point where the reduced gradient of the economic function is equal to zero. The reduced gradient is obtained through the projection of the gradient on the tangent space of the active constraints.

3.2. NECLGPC Terminal Control Law F ( k )

In this work, the terminal control law in the NECLGPC is determined online by an unconstrained NGPC Control with finite control and predictions horizons minimizing a cost function constituted by two important terms, the first one for set point tracking and the second for taking into account the economic cost that is approximated by means of its gradient.
The state dependent coefficient form of the model ( 2 ) , in state space format, is stated as in the conventional GPC formulation, allowing for inherent integral action within the model, including the control increment as system input to the state space model. Consequently, an extra system state is incorporated.
χ ( k + 1 ) = A ˜ ( k ) χ ( k ) + B ˜ ( k ) Δ u ( k ) y ( k ) = C ˜ ( k ) χ ( k )
where:
A ˜ ( k ) = A ( x ( k ) ) B ( x ( k ) ) 0 I , B ˜ ( k ) = B ( x ( k ) ) I ,
C ˜ ( k ) = C ( x ( k ) ) 0 , χ ( k ) = x ( k ) u ( k 1 )
Considering that the future trajectory of the state of the system is known, the state-space model ( 11 ) matrices may be re-calculated for the future. The resulting state-space model may be seen as a time-varying linear model and the controller is designed using this model. The future trajectory of the system can be determined using this model.
In order to obtain the NGPC control law, the predictive control techniques address calculation of the vector of current and future controls by solving the following optimization problem:
min u ( k ) = min ( i = 1 n y | | w 1 ( r ( k + i | k ) y ( k + i | k ) ) | | 2 2 + i = 0 n u 1 | | w 2 Δ u ( k + i 1 | k ) | | 2 2 + | | w 3 ξ u + Δ u T | | 2 2 )
Next the following vectors containing current and future values are introduced:
χ ̲ ( k ) = χ T ( k ) χ T ( k + n y ) T , Δ u ̲ ( k ) = Δ u T ( k ) Δ u T ( k + n u 1 ) T , y ̲ ( k ) = y T ( k ) y T ( k + n y ) T r ̲ ( k ) = r T ( k ) r T ( k + n y ) T
Then, the cost function ( 22 ) may be written in the vector form:
J ( k ) = ( r ̲ ( k ) y ̲ ( k ) ) T w 1 ( r ̲ ( k ) y ̲ ( k ) ) + Δ u ̲ T ( k ) w 2 Δ u ̲ ( k ) + ( D + G Δ u ̲ ( k ) ) T w 3 ( D + G Δ u ̲ ( k ) )
with w 1 = d i a g ( w 1 1 , , w 1 p ) and w 2 = d i a g ( w 2 1 , , w 2 m ) .
Now, it is possible to determine the future state prediction:
χ ( k + i ) = A ˜ ( k + i 1 ) A ˜ ( k + i 2 ) A ˜ ( k ) χ ( k ) + A ˜ ( k + i 1 ) A ˜ ( k + i 2 ) A ˜ ( k + 1 ) B ˜ ( k ) Δ u ( k ) + A ˜ ( k + i 1 ) A ˜ ( k + i 2 ) A ˜ ( k + 2 ) B ˜ ( k + 1 ) Δ u ( k + 1 ) + + A ˜ ( k + i 1 ) A ˜ ( k + i 2 ) A ˜ ( k + n u ) B ˜ ( k 1 + min ( i , n u ) ) Δ u ( k 1 + min ( i , n u ) ) F o r i = 1 , , n y
Note that to obtain the state prediction at time instance k + i the knowledge of matrix predictions A ˜ ( k ) A ˜ ( k + j l ) and B ˜ ( k ) B ˜ ( k l + min ( i , n u ) ) is required. The control increments after the control horizon are assumed to be zero.
Next, the following notation has been introduced:
i = l n u A ˜ ( k + i ) = A ˜ ( k + n u ) A ˜ ( k + n u 1 ) A ˜ ( k + l ) i f l n u I i f l n u
where I denotes the identity matrix of appropriate size.
Then ( 25 ) may represented as:
χ ( k + i ) = [ i = 0 i 1 A ˜ ( k + i ) ] χ ( k ) + [ i = 1 i 1 A ˜ ( k + i ) ] B ˜ ( k ) Δ u ( k ) + [ i = 2 i 1 A ˜ ( k + i ) ] B ˜ ( k + 1 ) Δ u ( k + 1 ) + + [ i = n u i 1 A ˜ ( k + i ) ] B ˜ ( k 1 + min ( i , n u ) Δ u ( k 1 + min ( i , n u ) ) )
Now using ( 26 ) the following equation for the future state predictions vector χ ̲ ( k ) is obtained:
χ ̲ ( k ) = Ω ( k ) A ˜ ( k ) χ ( k ) + Ψ ( k ) Δ u ̲ ( k )
where
Ω ( k ) = [ i = 1 0 A ˜ ( k + i ) ] T [ i = 1 n y 1 A ˜ ( k + i ) ] T
Ψ ( k ) = [ i = 1 0 A ˜ ( k + i ) ] B ˜ ( k ) ] 0 0 i = 1 1 A ˜ ( k + i ) ] B ˜ ( k ) ] [ i = 2 0 A ˜ ( k + i ) ] B ˜ ( k + 1 ) i = 1 n y 1 A ˜ ( k + i ) ] B ˜ ( k ) [ i = n u n y 1 A ˜ ( k + i ) ] B ˜ ( k + n u 1 )
From the output Equation ( 21 ) it is clear that
y ( k + i ) = C ( k + i ) χ ( k + i )
Combining the outputs in ( 29 ) and ( 27 ) the following relationship between vectors x ̲ ( k ) and y ̲ ( k ) is obtained:
y ̲ ( k ) = θ ( k ) χ ̲ ( k )
where θ ( k ) = d i a g ( C ( k + 1 ) , C ( k + 2 ) , , C ( k + n y ) )
Finally substituting in ( 30 ) χ ̲ ( k ) by ( 27 ) the following equation for output prediction is obtained:
y ̲ ( k ) = ϕ ( k ) A ˜ ( k ) χ ( k ) + S ( k ) Δ u ̲ ( k )
where
ϕ ( k ) = θ ( k ) Ω ( k ) , S ( k ) = θ ( k ) Ψ ( k )
Substituting y ̲ ( k ) in the cost function ( 24 ) by the Equation ( 31 ) and performing the analytical minimization, Δ u ̲ is obtained by deriving the cost function:
Δ u ̲ = ( S T ( k ) w 1 S ( k ) + w 2 + G T w 3 G ) 1 [ S ( k ) w 1 ( r ̲ ( k ) ϕ ( k ) A ˜ ( k ) χ ( k ) ) G T w 3 D ]
By denoting:
F ( χ ( k ) ) = ( S T ( k ) w 1 S ( k ) + w 2 + G T w 3 G ) 1 S ( k ) w 1 Φ ( k ) A ˜ ( k ) d ( k ) = ( S T ( k ) w 1 S ( k ) + w 2 + G T w 3 G ) 1 [ S ( k ) w 1 r ̲ ( k ) G T w 3 D ]
The Equation ( 32 ) becomes:
Δ u ̲ ( k ) = F ( χ ( k ) ) χ ( k ) + d ( k )

3.3. Closed-Loop Paradigm

The dual mode controller proposed in this work differs from others proposed in the literature by three important points. First of all, usually in the classical dual mode MPC schemes, the terminal control law defined in the terminal region is obtained offline by solving a linear quadratic regulator problem, but in this paper the terminal control law is determined online by solving an unconstrained nonlinear GPC problem as presented in the previous paragraph. Secondly, the terminal controller takes into account the economic costs by including the gradient of the economic function as an additional term in the objective function of the NGPC. Finally, here, even though the parameters of NGPC are tuned to assure a good performance and stability if there are not constraints, the dual mode approach is adopted in order to handle constraints when necessary and to the performance of the closed loop system respecting them while maintaining stability.
Remark. 
It must be stressed that the switching between the modes 1 and 2 in (13) is in the predictions only. The closed loop control law has a single mode, but uses dual mode predictions in the optimization.
A common choice is u ( k ) = F x ( k ) + c ( k ) as in El bahja, H. [25] where F is a unchanging feedback gain computed offline and c ( k ) is the new manipulated variable. From results of Section 3.2 and particularly on Equation ( 34 ) , the control parameterization proposed for the CLGPC is based on affine function disturbances as follows, making the controller less conservative.
Δ u ( k ) = F ( χ ( k ) ) χ ( k ) + d ( k ) + c ( k )
At each step time k, we assume that the feedback F ( χ ( k ) ) and d ( k ) are constant and c ( k ) is the new decision variable.
The degrees of freedom are the disturbance c ( k ) as it is described in Figure 1. It is conventional to define these as:
c ̲ ( k ) = [ c T ( k ) c T ( k + n u 1 ) ] T ; c ( k + i + n u ) = 0 for i > 0
That is, suppose a limited number n u of nonzero values for c ̲ ( k ) . After n u the disturbances are zero and the loop acts in a linear fashion and is equivalent to mode 2 of the dual mode predictions. Then the performance index in ( 3 ) and constraints ( 4 , 5 and 6 ) , must be formulated in function of c ( k ) .
min u ( k ) = min ( i = 1 n y | | w 1 ( r ( k + i | k ) ) y ( k + i | k ) | | 2 2       + i = 0 n u 1 | | w 2 Δ u ( k + i 1 | k ) | | 2 2       + | | w 3 ξ u + Δ u T | | 2 2 ) subject to ( 4 ) , ( 5 ) and ( 6 )
In order to obtain the prediction equations considering the control parameterization ( 35 ) , those equations are rewritten here:
Δ u ( k ) = F ( χ ( k ) ) χ ( k ) + d ( k ) + c ( k ) F ( χ ( k ) ) = ( S T ( k ) w 1 S ( k ) + w 2 + G T w 3 G ) 1 S ( k ) w 1 Φ ( k ) A ˜ ( k ) χ ( k ) d ( k ) = ( S T ( k ) w 1 S ( k ) + w 2 + G T w 3 G ) 1 [ S ( k ) w 1 r ̲ ( k ) G T w 3 D ]
The predictions with the new control parameterization are:
χ ( k + i + 1 ) = A ˜ ( k ) χ ( k + i ) + B ˜ ( k ) Δ u ( k + i ) ; Δ u ( k + i ) = F ( χ ( k ) ) χ ( k ) + c t ( k + i )
With i = 0 , , n u 1 and c t ( k + i ) = d ( k ) + c ( k + i ) .
Eliminating the dependent variable Δ u ( k + i ) one makes:
χ ( k + i + 1 ) = ( A ˜ ( k ) B ˜ ( k ) F ( χ ( k ) ) ) χ ( k + i ) + B ˜ ( k ) c t ( k + i )
Predicting onward in time with Φ ( k ) = A ˜ ( k ) B ˜ ( k ) F ( χ ( k ) ) one gets;
χ ̲ ( k ) = Φ Φ 2 Φ 3 χ ( k ) + B ˜ ( k ) 0 0 Φ B ˜ ( k ) B ˜ ( k ) 0 Φ 2 B ˜ ( k ) Φ B ˜ ( k ) B ˜ ( k ) c t ( k )
with
χ ̲ ( k ) = [ χ T ( k + 1 ) χ T ( k + 2 ) χ T ( k + n y ) ] T c ̲ t ( k ) = [ c t T ( k + 1 ) c t T ( k + 2 ) c t T ( k + n u ) ] T
Or in more compact structure we can redact the Equation ( 41 ) as
χ ̲ ( k ) = P c l χ ( k ) + H c c ̲ t ( k )
The related input predictions can expressed as
Δ u ̲ ( k ) = F ( χ ( k ) ) F ( χ ( k ) ) Φ F ( χ ( k ) ) Φ 2 χ ( k ) + I 0 0 F ( χ ( k ) ) B ˜ ( k ) I 0 F ( χ ( k ) ) Φ B ˜ ( k ) F ( k ) B ˜ ( k ) I c t ( k )
with
Δ u ̲ ( k ) = [ Δ u T ( k + 1 ) Δ u T ( k + 2 ) Δ u T ( k + n u ) ] T
or
Δ u ̲ ( k ) = P c l u χ ( k ) + H c u c ̲ t ( k )
The state beyond n u steps will be denoted as
χ ( k + n u ) = P c l 2 χ ( k ) + H c 2 c ̲ t ( k )
where P c l 2 and H c 2 are the n y t h block rows of P c l and H c respectively.

3.4. The Algorithm

Steps to follow for design of such controller are summarized in the algorithm below:
Step 1.
Measure current state vector χ ( k ) of the plant (or estimate its value).
Step 2.
Take the vector Δ u ̲ ( k 1 ) = Δ u T ( k 1 ) Δ u T ( k + n u 2 ) T calculated in previous iteration and remove the first element Δ u T ( k 1 ) , which has already been used in previous iteration for control. Using this vector get the future state predictions χ ̲ ( k ) = χ T ( k ) χ T ( k + n y ) T .
Step 3.
Using the predictions χ ̲ ( k ) and known χ ( k ) calculate the future matrix predictions A ˜ ( k + i ) , B ˜ ( k + i ) and C ˜ ( k + i ) for i = 0 , . . . , n y 1 and finally obtain ϕ ( k ) , S ( k ) matrices.
Step 4.
From ( 32 ) calculate Δ u ̲ ( k ) and control u ( k ) = u ( k 1 ) + Δ u ̲ ( k ) .
Step 5.
From ( 34 ) calculate F ( x ( k ) ) and d ( k ) .
Step 6.
Using the parameterization in ( 35 ) and calculate the future vector predictions χ ̲ ( k ) and Δ u ̲ ( k ) by ( 41 ) , ( 44 ) and ( 47 ) .
Step 7.
Perform the minimization ( 15 ) using the future vector predictions obtained in Step 6 and implement u ( k ) = F ( x ( k ) ) x ( k ) + c ̲ * ( k ) , and move on to the next time step.

4. Application to WWTP

Wastewater treatment plants (WWTP) are large nonlinear systems characterized by the complexity of the biological and biochemical phenomena involved. The nonlinear dynamics of the system, the large range of time constants (from a few minutes to several days) observed in the different biological processes and the significant perturbations in the flow and load of the influent make the WWTPs a really challenging case study from the control point of view. The WWTPs have to be operated efficiently, minimizing the energy and recourses consumption while meeting the strict environmental regulations. Therefore, the advanced control strategies as the NLGPC proposed in this paper are a promising alternative for improving their performance and economics.

4.1. Process Model

This application focuses specifically on the N-Removal process, which occurs in the biological treatment of the WWTP. The model that represents the N-Removal process is taken from the Benchmark Simulation Protocol (BSM1) [32]. The Benchmark Simulation Model (BSM1) is widely accepted by the scientific community and it has been broadly applied to test control approaches for the Activated Sludge Process (ASP). In order to represent the N-Removal process, the BSM1 is reduced to one anoxic and one aerated reactor, as shown in Figure 2. The volumes of the tanks are 2000 m 3 and 3999 m 3 respectively, to make them equivalent to total volumes of the anoxic and the aerobic compartments in the BSM1.
The following equations represent the dynamic behavior of the plant:
  • Anoxic reactor:
    S ˙ N H 1 = 1 V 1 Q i n S N H i n + Q a S N H 2 ( Q i n + Q a ) S N H 1 i x b ρ 11 i x b ρ 21 ( i x b + 1 Y A ) ρ 31 S ˙ N O 1 = 1 V 1 Q a S N O 2 ( Q i n + Q a ) S N O 1 1 Y H 2 . 86 Y H ρ 21 + 1 Y A ρ 31 S ˙ S 1 = 1 V 1 Q i n S S i n + Q a S S 2 ( Q i n + Q a ) S S 1 1 Y H ρ 11 1 Y H ρ 21 S ˙ O 1 = 1 V 1 Q a S O 2 ( Q i n + Q a ) S O 1 1 Y H Y H ρ 11 ( 4 . 57 Y A + 1 ) ρ 31
  • Aerobic reactor:
    S ˙ N H 2 = 1 V 2 ( Q i n + Q a ) ( S N H 1 S N H 2 ) i x b ρ 12 ( i x b + 1 Y A ) ρ 32 S ˙ N O 2 = 1 V 2 ( Q i n + Q a ) ( S N O 1 S N O 2 ) 1 Y H 2 . 86 Y A ρ 22 + 1 Y A ρ 32 S ˙ S 2 = 1 V 2 ( Q i n + Q a ) ( S S 1 S S 2 ) 1 Y H ρ 12 1 Y H ρ 22 S ˙ O 2 = 1 V 2 ( Q i n + Q a ) ( S O 1 S O 2 ) 1 Y H Y H ρ 12 4 . 57 Y A Y A ρ 32 + K L a ( S O , S a t S O 2 )
In the first reactor, the anoxic growth of heterotrophic biomass is the main biological process, related to denitrification:
ρ 21 = μ H . ( S S 1 K S + S S 1 ) . ( K O , H K O , H + S O 1 ) . ( S N O 1 K N O + S S 1 ) η g X B , H
In the second reactor, where there is a higher concentration of oxygen, the aerobic growths of heterotrophic and autotrophic biomass are considered, related to nitrification:
ρ 12 = μ H . ( S S 2 K S + S S 2 ) . ( S O 2 K O , H + S O 2 ) . X B , H ρ 32 = μ A . ( S N H 2 K N H + S N H 2 ) . ( S O 2 K O , A + S O 2 ) . X B , A
The rest of processes ρ are assumed to be zero in Equations ( 46 ) and ( 47 ) .
The definitions of the state variables are given in Table 1. The definitions of kinetic and physical parameters are presented in Table 2 and Table 3, their values are the same as for BSM1 [32].

4.2. Operating Conditions

The BSM1 defines the operational requirements of the plant as well as some performance criteria to characterize the effluent quality and the energy consumption [32]:
  • Influent load and disturbances: In order to test the performance of control strategy in different situations, the BSM1 provides standardized influent data considering different weather situations. In this work, data for 336 h, corresponding to 2 weeks starting at time 168 h are considered, with a sampling period of 0.25 h (=15 min) in this work. Figure 3, Figure 4 and Figure 5 present the profiles for stormy weather.
  • Bounds: The limits on the effluent - ammonium ( S N H ) concentration, total nitrogen ( N t o t ) concentration, suspended solid ( S S , e ) concentration, biological oxygen demand over a 5-day period ( B O D 5 ) and ( C O D ) are given Table 4.
  • Inputs: The two manipulated variables are the internal recycle flow rate Q a and the mass transfer coefficients K l a . The bounds for the input variables are Q a < 3850 m 3 / d and K l a < 200 d 1 . The mass transfer coefficient corresponds to the efficiency of the aeration in the aerated tank.
  • Outputs: The controlled variables are the S O in the second bioreactor and nitrate S N O levels in the first unit of the bioreactor. Five effluent variables - the ammonium concentration, the concentration of suspended solids, the B O D 5 , the C O D and the total nitrogen - are used to demonstrate the performance of the control system.

4.3. Control problem

The basic control strategy proposed in the B S M 1 is the feedback control of the dissolved oxygen S O 2 level in the reactor by manipulation of the oxygen transfer coefficient K L a and the control of the nitrites and nitrates concentration in the last anoxic compartment by manipulation of the internal recycle flow rate Q a .
In this work the NECLGPC algorithm is applied for controlling the oxygen S O 2 in the aerobic reactor and nitrate levels S N O 1 in the anoxic reactor. A multivariable control strategy is used where the controlled variables are S N O 1 and S O 2 , the manipulated variables are oxygen transfer coefficient K L a and the internal recycle flow rate Q a . The considered measurable disturbances are the influent flow ( Q i n ) (Figure 2), the organic matter concentration ( S s i n ) (Figure 3) and the ammonium concentration ( S N H i n ) (Figure 4) in the influent.

4.4. Performance Indices

The measures used to characterize the effluent quality and energy usage during the N-removal process are the standard performance indices recommended in the BSM1 platform for the evaluation of control strategies applied to WWTPs. The Effluent Quality Index ( E Q ) that integrates the total amount of pollutants in the process with different weights depending on their severity, the Aeration Energy ( A E ) and the Pumping Energy ( P E ) are applied in this work.
First of all, E Q (kg pollution/d) is considered as a direct and important indicator of the performance of the control systems as well as the entire wastewater treatment plant. For the BSM1, it is defined as a daily average of a weighted summation of the concentration of different compounds in the effluent over a certain time period as follow:
E Q = 1 1000 T t 0 t 0 + T ( 2 T S S e ( t ) + C O D e ( t ) + 30 N t o t , e ( t ) + 10 S N O ( t ) + 2 B O D e ( t ) ) Q e ( t ) d t
Where for the model described in Section 4.1:
C O D e = ( S S , e + X B , A e + X B , H e ) g / m 3 B O D e = 0 . 25 ( ( 1 0 . 08 ) + ( 1 0 . 08 ) ( X B , A + X B , H ) ) g / m 3 N t o t , e = S N O e + S N H e + i x b ( X B , H e + X B , A e ) g / m 3 T S S e = 0 . 75 ( X B , A e + X B , H e ) g / m 3
In the above equation, T S S denotes total suspended solids and N t o t e is the nitrogen total concentration in the effluent. The subscript ’e’ indicates that those concentrations are associated with the effluent of the settler. The weighting factors of T S S e , C O D e and N t o t e , and B O D e are adopted from [32]. The detailed expressions of these variables can be found in [33]. For the model considered in this work, it is assumed that the separation in the settler produces: X B , A e = 0 . 0038 . X B , A and X B , H e = 0 . 0038 . X B , H .
As for the energy consumption, the total average pumping energy expressed in kWh / d ( P E ) over a certain period of time, T, depends directly on the internal recirculation flaw rate Q a and it is calculated as [34]:
P E = 0 . 04 T t 0 t 0 + T ( Q r ( t ) + Q a ( t ) + Q w ( t ) ) d t
where Q r denotes the return sludge flow rate and Q w the excess sludge flow rate, both in units of m 3 / d .
The aeration energy ( A E ) in kWh/d required to aerate the last three comportments can in turn be written as:
A E = 24 T t 0 t 0 + T ( 0 . 4032 K L a ( t ) 2 + 7 . 8408 K L a ( t ) ) d t
where K L a k is the oxygen transfer function in the kth aerated tank in units of h 1 .
The overall cost index ( O C I ) includes the pumping energy ( P E ) and the aeration energy ( A E ) denoted by f e c o :
f e c o = A E + P E
In the current work, it has been preferred to not work directly with the overall effluent quality index as part of the cost function, because it involves several concentrations not available for measurement. Instead, here, it has been preferred to keep the two main variables of interest (oxygen and nitrate) around desired values, while attempting to keep effluent ammonia under the established limits.

5. Simulations Results

Different advanced control strategies based on nonlinear model predictive control are tested in the WWTP. The idea is to compare the proposed nonlinear GPC proposed in this paper, including the economic term and considering the closed loop paradigm to account for restrictions with other controllers based on GPC that differ in designs and structures.

5.1. Case Studies

Several simulations are carried out to study the process behavior with the different controllers and their effect on process economics and removal efficiency. The performance indices provided by the BSM1 platform are used to evaluate the process performance, with the different controllers in the operating period under characteristic storm weather influent variations. In total five case studies are contemplated in this paper for comparing the control and the performance of the proposed one layer optimizing control strategy. First we present four case studies and then we present another case called case 5 to address the lack of the degree of freedom.
  • Case 1 (NGPC): Unconstrained Nonlinear Generalized Predictive Control (NGPC) that minimize the following cost function that takes into account only the control objectives, without considering closed loop predictions:
    J ( k ) = i = 1 n y | | w 1 ( r ( k + i | k ) y ( k + i | k ) ) | | 2 2 + i = 0 n u 1 | | w 2 Δ u ( k + i 1 | k ) | | 2 2
  • Case 2 (NEGPC): Unconstrained Nonlinear Economic Generalized predictive control (NEGPC) that minimize the following cost function which accounts for economics, but without considering closed loop predictions:
    J ( k ) = i = 1 n y | | w 1 ( r ( k + i | k ) ) y ( k + i | k ) | | 2 2 + i = 0 n u 1 | | w 2 Δ u ( k + i 1 | k ) | | 2 2 + | | w 3 ξ u + Δ u T | | 2 2
  • Case 3 (NCLGPC): The one layer optimization and control based on nonlinear closed-loop GPC presented in this work that minimize the following cost function without economics.
    J ( k ) = i = 1 n y | | w 1 ( r ( k + i | k ) ) y ( k + i | k ) | | 2 2 + i = 0 n u 1 | | w 2 Δ u ( k + i 1 | k ) | | 2 2 subject to ( 4 ) ( 8 )
  • Case 4 (NECLGPC): The one layer economic optimization and control based on nonlinear closed-loop GPC presented in this work that minimize the following cost function which accounts for economics.
    J ( k ) = i = 1 n y | | w 1 ( r ( k + i | k ) ) y ( k + i | k ) | | 2 2 + i = 0 n u 1 | | w 2 Δ u ( k + i 1 | k ) | | 2 2 + | | w 3 ξ u + Δ u T | | 2 2 subject to ( 4 ) ( 8 )
Those controllers are summarized in the following Table 5:
Those control strategies are evaluated and compared by means of simulations of the process model (Equations (35)–(42)) implemented in Matlab. The simulations have been carried out considering the influent profile described in Figure 3, Figure 4 and Figure 5 (storm weather scenario), and analogous influents for rain and dry weather described in the BSM1 specifications.

5.2. Tuning Parameters and Operating Conditions

The performance of the plant strongly depends on the selected controller set points due to the plant nonlinearities. The set point selected for the performance evaluation correspond to the economically optimal steady state condition found considering the average values of the inputs in one operating period. The variable D O ( S O 2 ) in the second tank is controlled at a set point 2 . 09 g / m 3 and the variable S N O in the first compartment is controlled at a set point of 1 . 66 g / m 3 . The influent considered has been described in Figure 3, Figure 4 and Figure 5. The plant responses and the corresponding performance indices for 168 (One week) operating hours are compared.
The NECLGPC weights, as well as the prediction and control horizons, affect the closed loop behavior of the plant, so a proper tuning is required. In this work, the tuning has been performed evaluating the plant behavior by means of simulations. The selected tuning parameters for the controllers described in cases 1, 2, 3 and 4 are: control horizon n u = 2 ; prediction horizon n y = 4 ; output weight w 1 = d i a g ( 0 . 155 , 0 . 01 ) ; input weight w 2 = d i a g ( 0 . 01 , 0 . 01 ) , the weight of the economic term w 3 = 0 . 01 and sampling period of 15 minutes.
The control variables and its rates are bounded as shown in Equations (6) and (9) and therefore, the optimization problem ( 3 ) is a nonlinear and constrained. The bounds for the input variables and its rate are Q a < 3850 m 3 / d , K l a < 200 d 1 , 100 < Δ Q a < 100 and 24 < Δ K L a < 24 .

5.3. Results

The controller performance evaluation includes the analysis of the temporal responses and the corresponding performance indices. The first comparison is presented in Figure 6, Figure 7, Figure 8 and Figure 9, where the NGPC (Case 1) is compared to the NEGPC (Case 2), for stormy weather disturbances. For both controllers, the set point tracking is particularly good for the S O 2 , and the S N H concentration satisfies the legal constraint (Table 4). The responses are very similar, and the only remarkable difference is that for S O 2 tracking the NEGPC shows a small offset due to the incorporation of the economic term. The O C I values (Table 6) are smaller for NEGPC as expected.
Secondly, in Figure 10, Figure 11, Figure 12, Figure 13, Figure 14, Figure 15 and Figure 16 a comparison of the proposed NECLGPC (Case 4) with a NCLGPC (case 3) is presented, also for stormy weather. The responses are again very similar, only showing a small decrease of the manipulated variables for the Case 4 controller, due to the inclusion of the economic term. This is also seen in the O C I values of Table 6. For these controllers the tracking for S N O improves achieving a better balance between S O 2 and S N O tracking. The two manipulated variables are shown in Figure 12 and Figure 13 which indicate that suitable control signals Q a and K L a drive the process to follow the set point, while satisfying the constraints (Equations (4)–(8)) imposed. The rest of constraints for the effluent (Table 4) are also satisfied (Figure 14), ensuring a proper quality of the effluent. Figure 15 and Figure 16 show the evolution of the parameters c 1 and c 2 , where can be seen larger variations in c 1 due to the larger variations in Q a .
In Table 6, a comparison of different performance indices is shown. Comparing the O C I for the different case studies, it is possible to observe that the introduction of the economic term in the NECLGPC (case 2) and NEGPC (case 4) improves the economics reducing the O C I index. For instance, for the storm weather influent it reduces the O C I from 1292 EUR / d (Case 1) to 1261 . 1 EUR / d (Case 2) and from 1274 . 8 EUR / d (Case 3) to 1244 EUR / d (Case 4). This is observed also for different scenarios, especially when dry weather influent profile is tested where a reduction of 16 % of the O C I is achieved. In order to maintain the controlled variables at the desired reference value, it is necessary to consume energy, which increases the operating costs. Then, the minimization of the pumping energy (PE) and the aeration energy (AE) produce a deviation respect to the desired set point, since not enough freedom degrees are available to meet both requirements at the same time. This deviation is tolerated while the constraints required for the effluent quality are fulfilled.
As general remark, note that there is a small tracking offset in the dissolved oxygen in cases 2 and 3, because of the lack of degree of freedom to minimize costs and perform good tracking simultaneously. In this process there are only two manipulated variables to control two variables and optimize costs.To overcome this problem, either additional degree of freedom could be added by incorporating extra manipulated variables, or a tracking objective can be eliminated, allowing to that variable a free evolution between lower and upper limits.
The Figure 17, Figure 18 and Figure 19 presents the case study named case 5, where tracking of NO has been eliminated to leave an additional degree of freedom. A good tracking and disturbance rejection for dissolved oxygen can be seen, while NO has increased its daily variations because Q a keeps rather constant to decrease costs.
Finally, in Table 7 a comparison of performance indices is shown, where can be seen that the controller (case 5) provides smaller operating costs than the NCLGPC (case 3), as expected due to the inclusion of a economic cost function in the controller and the new degree of freedom added to allow for cost decrement. As for the EQ index, for both controllers have similar performance, depending on the influent conditions.

6. Conclusions

This study presents a nonlinear closed loop generalized predictive control scheme that uses a nonlinear model for predictions and includes the economic term in the controller cost function. The reduced gradient of the economic objective function is included as an additional term of the cost function of the nonlinear G P C controller. The proposed strategy allows the simultaneous optimization and control of the plant operation in one layer approach. The objective of the study is to ensure the appropriate operation of the plant, while minimizing the energy consumption. A non-linear reduced model of the activated sludge process is used for predictions to obtain a reasonable computing effort. The non-linearity is handled by converting the state-dependent state-space representation into the linear time-varying representation. Different designs and structures are compared in terms of process performance and energy costs, which show that the implementation of the proposed control technique can produce significant economic and environmental benefits, depending on the desired performance criteria.

Acknowledgments

The authors gratefully acknowledge the support of the Spanish Government through the MINECO project DPI2015-67341-C2-1-R, and the Fundación Samuel Solórzano project: FS/21-2015.

Author Contributions

Hicham El bahja and Pastora Vega conceived and designed the experiments; Hicham El bahja performed the experiments; Silvana Revollar and Mario Francisco analyzed the data; all the authors have contributed to write the paper.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
GPCGeneralized Predictive Control
NGPCNonlinear Generalized Predictive Control
NCLGPCNonlinear Closed Loop Generalized Predictive Control
NECLGPCNonlinear Economic Closed Loop GPC
MPCModel Predictive Control
QPQuadratic Programming
NLPNonlinear Programming
RTOReal Time Optimization
D-RTODynamic Real Time Optimization
CLMPCClosed Loop Model Predictive Control
WWTPWastewater Treatment Plant
BSM1Benchmark Simulation Model 1
ASPActivated Sludge Process

References

  1. Tatjewski, P. Advanced control and on-line process optimization in multilayer structures. Ann. Rev. Control 2008, 32, 71–85. [Google Scholar] [CrossRef]
  2. Würth, L.; Hannemann, R.; Marquardt, W. A two-layer architecture for economically optimal process control and operation. J. Process Control 2011, 21, 311–321. [Google Scholar] [CrossRef]
  3. Bozkurt, H.; Mark, C.M.; Gernaey, V.; Gurkan, S. Optimal WWTP process selection for treatment of domestic wastewater—A realistic full-scale retrofitting study. Chem. Eng. J. 2016, 286, 447–458. [Google Scholar] [CrossRef]
  4. Engell, S. Feedback control for optimal process operation. J. Process Control 2007, 17, 203–219. [Google Scholar] [CrossRef]
  5. Adetola, V.; Guay, M. Integration of real-time optimization and model predictive control. J. Process Control 2010, 20, 125–133. [Google Scholar] [CrossRef]
  6. Lawryńczuk, M.; Marusak, P.; Tatjewski, P. Cooperation of model predictive control with steady-state economic optimisation. Control Cybern. 2008, 37, 133–158. [Google Scholar]
  7. Marchetti, A.G.; Ferramosca, A.; González, A.H. Steady-state target optimization designs for integrating real-time optimization and model predictive control. J. Process 2014, 24, 129–145. [Google Scholar] [CrossRef]
  8. Ellis, M.; Panagliotis, C. Integrating dynamic economic optimization and model predictive control for optimal operation of nonlinear process systems. Control Eng. Pract. 2014, 22, 242–251. [Google Scholar] [CrossRef]
  9. Vega, P.; Revollar, S.; Francisco, M.; Martin, J.M. Integration of set point optimization techniques into nonlinear MPC for improving the operation of WWTPs. Comp. Chem. Eng. 2014, 68, 78–95. [Google Scholar] [CrossRef]
  10. Qin, S.; Badgwell, T. A survey of industrial model predictive control technology. Control Eng. Pract. 2003, 11, 733–764. [Google Scholar] [CrossRef]
  11. Han, H.G.; Wu, X.L.; Qiao, J.F. Nonlinear model-predictive control for industrial processes: An application to wastewater treatment process. IEEE Trans. Ind. Electron. 2014, 61, 1970–1980. [Google Scholar] [CrossRef]
  12. Manenti, F. Considerations on nonlinear model predictive control techniques. Comput. Chem. Eng. 2011, 35, 2491–2509. [Google Scholar] [CrossRef]
  13. Muller, M.A.; Angeli, D.; Allgower, F. On the performance of economic model predictive control with self-tuning terminal cost. J. Process Control 2014, 24, 1179–1186. [Google Scholar] [CrossRef]
  14. Liu, S.; Zhang, J.; Liu, J. Economic MPC with terminal cost for nonlinear processes and application to an oilsand primary separation vessel Chem. Eng. Sci. 2015. [Google Scholar] [CrossRef]
  15. Zanin, A.C.; Tvrzska de Gouveia, M.; Odloak, D. Integrating real time optimization into the model predictive controller of the FCC system. Contr. Eng. Pract. 2002, 10, 819–831. [Google Scholar] [CrossRef]
  16. De Souza, G.; Odloak, D.; Zanin, A.C. Real time optimization (RTO) with model predictive control (MPC). Comput. Chem. Eng. 2010, 34, 1999–2006. [Google Scholar] [CrossRef]
  17. Alamo, T.; Ferramosca, A.; Alejandro; González, H.; Limon, D.; Odloak, D. A gradient-based strategy for the one-layer RTO + MPC controller. J. Process Control 2014, 24, 435–447. [Google Scholar] [CrossRef]
  18. Revollar, S.; Vega, P.; Vilanova, R.; Francisco, M. Optimal Control of Wastewater Treatment Plants Using Economic-Oriented Model Predictive Dynamic Strategies. Appl. Sci. 2017, 7, 813. [Google Scholar] [CrossRef]
  19. Kouvaritakis, B.; Rossiter, J.A.; Schuurmans, J. Efficient robust predictive control. IEEE Trans. Autom. Control 2000, 45, 1545–1549. [Google Scholar] [CrossRef]
  20. Rossiter, J.A.; Rice, M.J.; Kouvaritakis, B. A numerically robust state-space approach to stable predictive control strategies. Automatica 1998, 34, 65–73. [Google Scholar] [CrossRef]
  21. Rossiter, J.A.; Rice, M.J.; Kouvaritakis, B. Youla parameter and robust predictive control with constraint handling. In Workshop Nonlinear Predictive Control; WNPC: Ascona, Switzerland, 1998. [Google Scholar]
  22. Rossiter, J.A.; Kouvaritakis, B.; Gossner, J.R. Feasibility and stability results for constrained stable generalized predictive contro. Proc. IEEE 1994, 3, 154–162. [Google Scholar]
  23. Rossiter, J.A.; Kouvaritakis, B.; Gossner, J.R. Numerical robustness and efficiency of generalized predictive control algorithms with stability. In Proceedings of the 3rd IEEE Conference on Control Applications, Coventry, UK, 21–24 March 1994. [Google Scholar]
  24. Imsland, L.; Rossiter, J.A.; Pluymers, B.; Suykens, J. Robust triple mode MPC. Int. J. Control 2008, 81, 679–689. [Google Scholar] [CrossRef]
  25. El bahja, H.; Vega, P. Closed loop paradigm control based on positive invariance for a wastewater treatment plant. In Proceedings of the 3rd IEEE International Conference on Systems and Control (ICSC), Algiers, Algeria, 29–31 October 2013; pp. 314–319. [Google Scholar]
  26. Rossiter, J.A. Model-Based Predictive Control: A Practical Approach; CRC Press: Boca Raton, FL, USA, 2013. [Google Scholar]
  27. Forbes, J.F.; Marlin, T.E. Model accuracy for economic optimizing controllers: The bias update case. Ind. Eng. Chem. Res. 1994, 33, 1919–1929. [Google Scholar] [CrossRef]
  28. El bahja, H.; Bakka, O.; Vega, P. Investigation of Different Control Strategies for the Wastewater Treatment Plant. In Progress in Biomass and Bioenergy Production; InTech: London, UK, 2011; pp. 179–194. ISBN 978-953-307-491-7. [Google Scholar]
  29. El bahja, H.; Vega, P. Nonlinear Feedback Control Based on Positive Invariance for a Nutrient Removal Biological Plant. Int. J. Innov. Comput. Inf. Control 2014, 10, 1229–1246. [Google Scholar]
  30. El bahja, H.; Vega, P.; Revollar, S. Economic optimization based on nonlinear parametric GPC for a wastewater treatment plant. In Proceedings of the IEEE 53rd Annual Conference on In Decision and Control (CDC), Los Angeles, CA, USA, 15–17 December 2014; pp. 3815–3820. [Google Scholar]
  31. Zang, J.; Liu, J. Economic model predictive control of wastewater treatment processes. Ind. Eng. Chem. Res. 2015, 54, 5710–5721. [Google Scholar] [CrossRef]
  32. Alex, J.; Benedetti, L.; Copp, J.; Gernaey, K.; Jeppsson, U.; Nopens, I.; Pons, M.; Rieger, L.; Rosen, C.; Steyer, J.; et al. Benchmark Simulation Model No. 1 (BSM1); Cod: LUTEDX-TEIE 7229. 1-62; Lund University: Lund, Sweden, 2008. [Google Scholar]
  33. El bahja, H.; Vega, P.; Revollar, S. A Closed Loop Paradigm for Nlgpc With Constraints on Control Variables; World Automation Congress (WAC): Puerto Vallarta, Mexico, 2012. [Google Scholar]
  34. Vanrolleghem, P.; GILLOT, S. The COST Simulation Benchmark: Description and Simulator Manual. Office for Official Publications of the European Community. Luxembourg, 2001; 123–133. [Google Scholar]
Figure 1. Nonlinear Closed Loop Generalized Predictive Control.
Figure 1. Nonlinear Closed Loop Generalized Predictive Control.
Applsci 08 00657 g001
Figure 2. Schematic representation of the plant.
Figure 2. Schematic representation of the plant.
Applsci 08 00657 g002
Figure 3. Influent flow Q i n for stormy weather.
Figure 3. Influent flow Q i n for stormy weather.
Applsci 08 00657 g003
Figure 4. Concentration of organic matter in the influent S s i n for stormy weather.
Figure 4. Concentration of organic matter in the influent S s i n for stormy weather.
Applsci 08 00657 g004
Figure 5. Concentration of ammonium compounds in the influent S N H i n for stormy weather.
Figure 5. Concentration of ammonium compounds in the influent S N H i n for stormy weather.
Applsci 08 00657 g005
Figure 6. Evolution of S O 2 : (left) case1; (right) case 2.
Figure 6. Evolution of S O 2 : (left) case1; (right) case 2.
Applsci 08 00657 g006
Figure 7. Evolution of S N O : (left) case1; (right) case 2.
Figure 7. Evolution of S N O : (left) case1; (right) case 2.
Applsci 08 00657 g007
Figure 8. Evolution of S N H : (left) case1; (right) case 2.
Figure 8. Evolution of S N H : (left) case1; (right) case 2.
Applsci 08 00657 g008
Figure 9. Evolution of N t o t a l : (left) case1; (right) case 2.
Figure 9. Evolution of N t o t a l : (left) case1; (right) case 2.
Applsci 08 00657 g009
Figure 10. Evolution of S O 2 : (left) case 3; (right) case 4.
Figure 10. Evolution of S O 2 : (left) case 3; (right) case 4.
Applsci 08 00657 g010
Figure 11. Evolution of S N O : (left) case 3; (right) case 4.
Figure 11. Evolution of S N O : (left) case 3; (right) case 4.
Applsci 08 00657 g011
Figure 12. Profile of K L a : (left) case3; (right) case 4.
Figure 12. Profile of K L a : (left) case3; (right) case 4.
Applsci 08 00657 g012
Figure 13. Profile of Q a : (left) case 3; (right) case 4.
Figure 13. Profile of Q a : (left) case 3; (right) case 4.
Applsci 08 00657 g013
Figure 14. Evolution of S N H : (left) case 3; (right) case 4.
Figure 14. Evolution of S N H : (left) case 3; (right) case 4.
Applsci 08 00657 g014
Figure 15. Evolution of the degree of freedom c 1 : (left) case3; (right) case 4.
Figure 15. Evolution of the degree of freedom c 1 : (left) case3; (right) case 4.
Applsci 08 00657 g015
Figure 16. Evolution of the degree of freedom c 2 : (left) case3; (right) case 4.
Figure 16. Evolution of the degree of freedom c 2 : (left) case3; (right) case 4.
Applsci 08 00657 g016
Figure 17. Responses of S O 2 and S N O for the case 5.
Figure 17. Responses of S O 2 and S N O for the case 5.
Applsci 08 00657 g017
Figure 18. Profiles of K L a and Q a for the case 5.
Figure 18. Profiles of K L a and Q a for the case 5.
Applsci 08 00657 g018
Figure 19. Evolution of the degrees of freedom c 1 and c 2 for the case 5.
Figure 19. Evolution of the degrees of freedom c 1 and c 2 for the case 5.
Applsci 08 00657 g019
Table 1. List of state variables of the model.
Table 1. List of state variables of the model.
NotationDefinitionUnit
S NH NH 4 + NH 3 concentration grN / m 3
S NO Nitrate and nitrite concentration grN / m 3
S S Readily biodegradable substrate concentration grCOD / m 3
S O Dissolved oxygen concentration gr / m 3
Table 2. Process characteristics.
Table 2. Process characteristics.
NotationDefinition
Q in Influent flow rate
S S , in Influent organic matter concentration
S NH , in Influent ammonium compounds concentration
Q a Internal recycle flow
K La oxygen transfer coefficient
V 1 Anoxic reactor volume
V 2 Aerobic reactor volume
Table 3. Kinetic parameters and stoichiometric coefficient characteristics.
Table 3. Kinetic parameters and stoichiometric coefficient characteristics.
NotationDefinition
S O , sat Oxygen saturation concentration
μ H Heterotrophic max. specific growth rate
K S Half saturation coefficient for heterotrophs
K O , H Oxygen saturation coefficient for heterotrophs
K NH Ammonia saturation coefficient for heterotrophs
K O , A Oxygen saturation coefficient for autotrophs
Y H Heterotrophic yield
Y A Autotrophic yield
i xb Nitrogen fraction in biomass
Table 4. Bounds of the effluent concentrations.
Table 4. Bounds of the effluent concentrations.
Effluent QualitiesUpper BoundUnit
S N H 4 mg / L
S N O 10 mg / L
N t o t 18 mg / L
T S S 30 mg / L
C O D 100 mg / L
K L a 200 d 1
Q a 3850 m 3 / d
Table 5. Controllers characteristics.
Table 5. Controllers characteristics.
ControlEconomic FunctionConstraintsType of PredictionsPredictions Model
Case 1:NoneNoneOpen loopState dependent coefficient
Case 2:Quadratic Gradient basedNoneOpen loopState dependent coefficient
Case 3:NoneYesClosed loopState dependent coefficient
Case 4:Quadratic Gradient basedYesClosed loopState dependent coefficient
Table 6. Comparison of performance indices for case 1 to 4 controllers.
Table 6. Comparison of performance indices for case 1 to 4 controllers.
WeatherCasesControllerAEPEOCIEQ
kWh/dkWh/dEUR/dkg/d
-Storm:Case 1NGPC1292285.71577.76027.3
Case 2NEGPC1261.1286.91547.276022.7
Case 3NCLGPC1274.8286.171560.976025.8
Case 4NECLGPC1244287.281531.286022.2
-Rain:Case 1NGPC1023.9230.41254.36026.9
Case 2NEGPC1005.3231.041236.346022.1
Case 3NCLGPC996.37231.471227.846022.2
Case 4NECLGPC986.27231.471217.76022.2
-Dry:Case 1NGPC1488.8329.181817.986026.9
Case 2NEGPC1444330.981774.986022.1
Case 3NCLGPC1474329.451803.456025.8
Case 4NECLGPC1430331.051761.056022.2
Table 7. Comparison of performance indices for cases 3 and 5 controllers
Table 7. Comparison of performance indices for cases 3 and 5 controllers
WeatherCasesControllerAEPEOCIEQ
kWh/dkWh/dEUR/dkg/d
-Storm:Case 3NCLGPC1274.8286.171560.976025.8
Case 5NECLGPC1393.3411.91805.26026.5
-Rain:Case 3NCLGPC996.37231.471227.846022.2
Case 5NECLGPC1206.8411.91618.76026.5
-Dry:Case 3NCLGPC1474329.451803.456025.8
Case 5NECLGPC1540.8411.91952.76026.5

Share and Cite

MDPI and ACS Style

El bahja, H.; Vega, P.; Revollar, S.; Francisco, M. One Layer Nonlinear Economic Closed-Loop Generalized Predictive Control for a Wastewater Treatment Plant. Appl. Sci. 2018, 8, 657. https://doi.org/10.3390/app8050657

AMA Style

El bahja H, Vega P, Revollar S, Francisco M. One Layer Nonlinear Economic Closed-Loop Generalized Predictive Control for a Wastewater Treatment Plant. Applied Sciences. 2018; 8(5):657. https://doi.org/10.3390/app8050657

Chicago/Turabian Style

El bahja, Hicham, Pastora Vega, Silvana Revollar, and Mario Francisco. 2018. "One Layer Nonlinear Economic Closed-Loop Generalized Predictive Control for a Wastewater Treatment Plant" Applied Sciences 8, no. 5: 657. https://doi.org/10.3390/app8050657

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop