Next Article in Journal
Experimental Determination on the Deactivation Kinetics of Residue Hydroprocessing in a Two-Stage Fixed Bed Loaded with HDM and HDS Catalysts
Previous Article in Journal
Perceptual Quantitative Decision Making and Evaluation of Product Stylable Topology Design
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Integrating Dynamic Economic Optimization and Nonlinear Closed-Loop GPC: Application to a WWTP

1
Department of Automatic and Computer Science, University of Salamanca Plaza de los Caidos S/N, 37008 Salamanca, Spain
2
Industrial Engineering School and Institute for Sustainable Processes, University of Valladolid, Doctor Mergelina S/N, 47005 Valladolid, Spain
*
Author to whom correspondence should be addressed.
Processes 2022, 10(9), 1821; https://doi.org/10.3390/pr10091821
Submission received: 16 March 2022 / Revised: 30 August 2022 / Accepted: 7 September 2022 / Published: 9 September 2022
(This article belongs to the Section Environmental and Green Processes)

Abstract

:
In this paper, a technique that integrates methods of dynamic economic optimization and real-time control by including economic model predictive control and closed-loop predictive control has been developed, using a two-layer structure. The upper layer, which consists of an economic nonlinear MPC (NMPC), makes use of the updated state information to optimize some economic cost indices and calculates in real time the economically optimal trajectories for the process states. The lower layer uses a closed-loop nonlinear GPC (NCLGPC) to calculate the control actions that allow for the outputs of the process to follow the trajectories received from the upper layer. This paper also includes the theoretical demonstration proving that the deviation between the state of the closed-loop system and the economically time varying trajectory provided by the upper layer is bounded, thus guaranteeing stability. The proposed approach is based on the use of nonlinear models to describe all the relevant process dynamics and cover a wide operating range, providing accurate predictions and guaranteeing the performance of the control systems. In particular, the methodology is implemented in the N-Removal process of a WWTP and the results demonstrate that the method is effective and can be used profitably in practical cases such as the chemical, refinery and petrochemical process industries.

1. Introduction

Nowadays, modern industrial processes have become highly integrated with respect to material and energy flows, tightly constrained by high-quality product specifications, and subjected to increasingly strict safety and environmental regulations. These more rigorous operating circumstances have placed new constraints on the operating flexibility of industrial processes and made the performance requirements for process plants increasingly difficult to satisfy. The increased emphasis placed on safe and efficient plant operation dictates the need for continuous monitoring of the operation of a chemical plant and effective external intervention (control) to guarantee satisfaction of the operational objectives. In this light, it is natural that the subject of process control has become increasingly important in both the academic and industrial communities.
Maximizing profit has been and will always be the primary purpose of the optimal control and operation of processes. There are various modern techniques that integrate and seek to guarantee optimization and control simultaneously, and that allow industrial processes to be highly competitive, profitable, operationally safe and beneficial to the environment. Among the most representative techniques are Real-Time Optimization (RTO) and Dynamic Real-Time Optimization (D-RTO). The benefits of RTO are demonstrated by its successful implementation in a number of industrial applications leading to significant economic profits [1]. RTO is suggested when significant changes occur in the operating conditions that closely affect the plant’s profit margin. In large plants, seasonal and day-to-night variations may be sufficient to justify RTO [2]. Within process control, there have been several calls for the integration of MPC and the economic optimization of processes (e.g., refs. [3,4,5]).
In the literature, two-stage MPC structures (refs. [6,7,8]) have been investigated to take into account different slow and fast dynamical of processes using multilayer architectures. There also been also attempts to integrate RTO and nonlinear MPC in a single level [9]. In this approach, the economic optimization and control problems are solved simultaneously in a single layer. In particular model-based predictive control techniques can be formulated to perform both functions by adding economic objective terms to be the standard MPC objective function [9,10]. The resulting problem involves solving a nonlinear optimization problem subject to dynamic and steady-state constraints. The implementation of the extended controller relies on extensive tuning of the weighting factors for stability and performance. Extensive simulations are needed to select appropriate values for the weighting factors [10], unlike in linear MPC where robust tuning techniques are available. The one-layer approach could respond to changes in the plant’s optimal conditions faster than the two-layer approach. However, for large-scale and highly nonlinear processes, this technique may struggle due to computational limitations.
Nevertheless, there is an obvious need for model-based process operation strategies that support the dynamic nonlinear behavior of production plants. More recent techniques, such as dynamic trajectory optimization and nonlinear model predictive control (NMPC), are still subject to research, and, often, the size of the applicable process model is still a limiting factor. In ref. [11], two economically oriented nonlinear MPC formulations were proposed for cyclic processes and the nominal stability of the closed-loop system was established via Lyapunov techniques. In [12], the authors design a Lyapunov-based economic MPC that is capable of optimizing closed-loop performance with respect to general economic considerations for nonlinear systems. The design of this controller is based on uniting receding horizon control with explicit Lyapunov-based nonlinear controller design techniques and allows for an explicit characterization of the stability region of the closed-loop system; such a characterization may be conservative in certain applications and it may be possible for the controller to achieve closed-loop stability for initial conditions outside of the estimated stability region. The MPC schemes in [12] optimize a cost function which is related directly to certain economic considerations and is not necessarily dependent on a steady stat unlike conventional MPC designs. The benefits of two-layer optimization are demonstrated by its successful implementation in a number of industrial applications, leading to significant economical profits. The RTO is recommended when significant changes occur in the operating conditions, strongly affecting the plant profitability. In large plants, seasonal and day-to-night variations may be sufficient to justify RTO. Additionally, the temporal decomposition is a solution for complex multi-scale processes to cope with the different dynamics of the state variables and disturbances. The sampling time and optimization horizon are larger in the upper layers dedicated to the slower process dynamics and disturbances. Thus, beyond the functional hierarchical decomposition carrying out specific tasks at different rates, a temporal decomposition with different time scales within one of the functional layers is recommended to achieve the optimal operation. Although the methods mentioned in our literature review have had varying degrees of success, satisfactory performance still remains an open problem to our knowledge. Here, we propose a technique that integrates methods of dynamic economic optimization and real-time control by including economic model predictive control and closed-loop predictive control, using a two-layer structure. We then analyze the stability of the closed-loop system by demonstrating that the deviation between the state of the closed-loop system and the time-varying trajectory provided by the upper layer is bounded, thus guaranteeing stability.
In recent years, cost minimization has become increasingly important in the control and operation of wastewater treatment plants (WWTP), which are non-productive processes subjected to very high economic penalties for specification discharges and very high operation costs, basically associated with the aeration system and pumping energy. These plants exhibit complex and nonlinear dynamics, making the control and optimization tasks difficult. In this type of processes, frequent and significant changes in the inputs affect the process behavior. In order to run a plant efficiently from the economic point of view, operational costs such as pumping energy, aeration energy and dosage of different chemicals should be minimized. At the same time, the discharges to the recipient should be kept at certain levels specified by law. Conflicting objectives arise naturally in one-layer model predictive control. Trade-offs performance and robustness or economic performance and sustainability. Specific domains where reconciling objectives is critical include chemical and energy systems [13,14]. This problem can be overcome by integrating dynamic economic optimization and a nonlinear closed-loop MPC approach for the optimization of the operation of WWTP, considering two-layer structure. The first layer allows for a pure economic index in the controller optimization problem, while the second layer uses a combination of the penalization of control error and the penalization of control efforts. In [13], advanced control strategies are applied to a hierarchical control structure for dissolved oxygen control in a WWTP with a MIMO robust MPC and other advanced methods in the optimizing layer. Ref. [14] presented a closed-loop model predictive control using invariant sets to give a simple solution to this type of control, ensuring stability and respecting non-symmetrical constraints. Ref. [15] used a hierarchical structure of two PI layers for optimizing the operation of a nutrient removal WWTP. In [16], a PI controller in the lower level follows an ammonia setpoint determined by GA optimization in the higher level. The method in [17] proposes a unique approach that divides the control structure into three layers: the supervisory control layer, the optimizing control layer and, and the low-level control layer. The method utilizes MPC, extended Kalman filters, and greybox parameter estimation.
The prime aim of this paper is the integration of dynamic economics and NLCGPC, within a two-layer framework with guaranteed stability properties. The upper layer, consists of an economic NMPC that receives state feedback and time dependent economic information to economically compute optimal time-varying operating trajectories for the process. It does this by optimizing a quadratic economic cost function over a finite prediction horizon, using a first order approximation of a nonlinear economic function. The lower layer, uses a NLCGPC to compute feedback control actions that force the outputs of the process to track the trajectories received from the upper layer. Instead of the classical dual-mode MPC schemes, where the terminal control is obtained offline; here, the terminal control law is determined online by an unconstrained nonlinear generalized predictive control. The lower feedback control layer may utilize conventional MPC schemes or even classical control to compute feedback control actions that force the process state to track the time-varying operating trajectories computed by the upper layer Economic NMPC. We prove that the deviation between the state of the closed-loop system and the economically time-varying trajectory is bounded.
A wastewater treatment plant is selected as a case study to validate this. Specifications given in the Benchmark Simulation Protocol (BSM1) [18] have been used, as they are widely accepted by the scientific community. Particularly, in this work, the model focuses on the N-Removal process.
The organization of the paper is as follows: the formulation of the problem is detailed in Section 3. In Section 4, the two-layer control framework is introduced. The proof of stability is given in Section 5. The modeling of the process, together with the associated operational costs, are developed in Section 6. The simulation results are also discussed and interpreted in Section 6. Finally, in Section 7, the general conclusions are drawn.

2. Notation

The operator | . | denotes the Euclidean norm of a vector and | . | Q denotes the weighted Euclidean norm of a vector (i.e., | x | Q = x T Q x ). The symbol d i a g ( v ) denotes a square diagonal matrix with diagonal elements v.

3. Problem Statement

Consider a continuous time nonlinear system represented in the state space by:
x ˙ ( t ) = A ( t ) x ( t ) + ψ ( x ( t ) , u ( t ) , w ( t ) )
where x ( t ) n is the state vector, u ( t ) U m is the manipulated input vector and w ( t ) p is the disturbance vector.
It is assumed that the inputs u ( t ) are restricted to a non-empty convex set defined as U : = { u m | | u ( t ) | u i m a x , i = 1 , , m } , that ψ is locally Lipschitz on n × m × p , and that the disturbance vector is bounded by θ + :
| w ( t ) | θ
The objective of this paper is to solve a problem of economic optimization that provides a profile of time-varying set points for a nonlinear plant. More precisely, a hierarchical control in two layers is used, where the time-varying set points are generated in the upper layer by a economic NMPC, satisfying some restrictions; whereas in the lower layer, a NCLGPC is used, as described in [9], in order to follow the references provided by the upper layer while also respecting constraints and rejecting the disturbances.
The trajectory vector is denoted as x r ( t ) Ω n , where Ω is a compact (closed and bounded) set, with the rate of change of x r ( t ) bounded by γ r + :
| x ˙ r ( t ) | γ r
The tracking error is defined as the deviation between the state trajectory x ( t ) and the reference trajectory x r ( t ) as:
e ( t ) = x ( t ) x r ( t )
The dynamics of the error are then:
e ˙ ( t ) = x ˙ ( t ) x ˙ r ( t ) = A ( t ) x ( t ) + ψ ( x ( t ) , u ( t ) , w ( t ) ) A ( t ) x r ( t ) ψ ( x r ( t ) , u r ( t ) , 0 ) = A ( t ) e ( t ) + ψ ( x ( t ) , u ( t ) , w ( t ) ) ψ ( x r ( t ) , u r ( t ) , 0 )
In what follows, we introduce the proposed two-layer control framework and prove the stability of the closed-loop system.

4. Controller Design

The control strategy proposed in this paper is described schematically in Figure 1. In the upper layer, the control is achieved by using an economic NMPC, while the lower layer uses a NCLGPC that combines an unconstrained nonlinear economic feedback control law F ( k ) with the parameterization c ( k ) associated with the closed-loop paradigm that allows the process constraints to be taken into account, thus improving the performance of the controller.

4.1. Upper Layer Problem Formulation

This layer provides the references x r for the lower layer by solving the following economic NMPC optimization:
m i n u r t k t k + N e f e c o ( x ˜ r ( τ ) , u r ( τ ) , τ ) d τ subject to : x ˜ ˙ r ( t ) = A ( t ) x ˜ r ( t ) + ψ ( x ˜ r ( t ) , u r ( t ) , 0 ) , x ˜ r ( t ) = x ( t ) , u r ( t ) U , | x ˜ ˙ r ( t ) | γ r , t [ t k , t k + N e [ , x ˜ r ( t ) Ω
where N e is the prediction horizon, f e c o ( x ˜ r ( τ ) , u r ( τ ) , τ ) is the time-dependent economic cost function, x ˜ r ( t ) is the predicted trajectory of the system with the manipulated input u r ( t ) computed by the economic NMPC, and x ( t ) is the state measurement obtained at time t k .
In (6), the first constraint corresponds to the nominal model of the system, used to predict the future evolution of the states. The second constraint defines the initial condition of the optimization, which is the measurement of the state at instant t k . The third constraint presents the control limitation of all manipulated inputs. The fourth constraint limits the rate of change of the state trajectory. The fifth constraint ensures that the economically optimal state trajectory is maintained in the domain Ω . The last two constraints of the optimization problem of Equation (6) are used to guarantee closed-loop stability under this integrated framework and to ensure that the lower layer can force the system to track the state trajectory. This is a departure from other types of two-layer dynamic economic optimization architectures such as dynamic real-time optimization. The constraint on the rate of change of the economically optimal trajectory does pose a restriction on the feasible set of the optimization problem of Equation (6) and, thus, can affect the closed-loop economic performance of the control framework. However, a system that requires a large rate of change on the trajectory to achieve closed-loop economic performance that is better than steady-state may be undesirable for many applications based on practical considerations such as excessive strain on control actuators as well as the difficulty of forcing the system to track a rapidly changing operating trajectory in the presence of disturbances.
The gradient of the economic objective function is included in the cost function of the controller. Optimal conditions of the process at steady state are searched through the use of a rigorous nonlinear process model. The main advantage of the proposed strategy is that the resulting control/optimization problem can still be solved with a quadratic programming routine at each sampling step. The approach proposed may be comparable to the strategy that solves the full economic optimization problem inside the MPC controller where the resulting control problem becomes a nonlinear programming problem with a much higher computer load.
In general, the function f e c o ( x ˜ r ( τ ) , u r ( τ ) , 0 ) is not a quadratic function of the decision variables of the stated optimization problem. Consequently, the problem becomes a nonlinear programming problem, which may be difficult to solve. To overcome this problem, the function f e c o is approximated by its gradient, as in [9], as follows. Suppose that the stationary prediction of the controller output related to the current input u r is y ^ r . Furthermore, consider that the economic function associated with the operation of the system is a concave function, whose maximum has to be searched and which can be represented as a function of the predicted state [10] as follows:
F = f e c o ( u r , y ^ r )
Then, assuming that the vector of the control action changes to u r + δ u r , the first-order approximation of the gradient of the economic function is:
ξ u r + δ u r = D + G δ u ¯ r
where the calculations of D and G are detailed in [10], and δ u ¯ r = u r ( t k + N e 1 ) u r ( t k 1 ) 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 r + δ u r can be considered as a deviation vector in relation to the reference, which is equivalent to considering that the gradient of the economic function is zero at the optimum. As a result of these assumptions f e c o can be approximated by a quadratic function as f e c o = ξ u + δ u T ξ u r + δ u r , so the optimization problem Equation (6) becomes:
m i n u r t k t k + N e ξ u r ( τ ) + δ u r ( τ ) T ξ u r ( τ ) + δ u r ( τ ) d τ subject to : x ˜ ˙ r ( t ) = A ( t ) x ˜ r ( t ) + ψ ( x ˜ r ( t ) , u r ( t ) , 0 ) , x ˜ r ( t ) = x ( t ) , u r ( t ) U , | x ˜ ˙ r ( t ) | γ r , t [ t k , t k + N e [ , x ˜ r ( t ) Ω

4.2. Lower Layer Problem Formulation

At the lower process control level, we use a nonlinear closed-loop GPC (NCLGPC) to force the process state to track the trajectory x r * ( t ) obtained by recursively solving the nominal model of Equation (1) with the manipulated input u r * ( t ) applied for t [ t k , t k + t + N Δ [ , where t k is the beginning of the operating period, t is the operating period, and N is the prediction horizon of the NCLGPC. We assume that the NCLGPC synchronously recomputes the new manipulated inputs every Δ and j = 0 , 1 , , t / Δ . We define the system of Equation (1) in terms of the deviation from the economically optimal state trajectory e ( t ) = x ( t ) x r * ( t ) ,
The NCLGPC at t j is then formulated as follows:
m i n c t j t j + N ( | e ˜ ( τ ) | Q + | u ( τ ) u r * ( τ ) | R ) d τ subject to : e ˜ ˙ ( t ) = A ( t ) e ˜ ( t ) + ψ ( x ( t ) , u ( t ) , w ( t ) ) ψ ( x r * ( t ) , u r * ( t ) , 0 ) , u ( t ) = K ( t ) x ( t ) + c ( t ) , u ( t ) U , e ( t ) = x ( t ) x r * ( t )
where N is the prediction horizon of NCLGPC, e ˜ ( t ) is the predicted deviation between the state trajectory predicted by the model Equation (1) with the manipulated input u ( t ) , and the economically optimal state trajectory x r * ( t ) . The optimal solution of the optimization Equation (10) is denoted by u * ( t ) , defined for t [ t j , t j + N [ .
The controller in the lower layer is a NCLGPC based on an unconstrained nonlinear GPC, as an efficient advanced control technique for improving 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 for 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, this being a reformulation of a classical dual mode predictive control [9,18,19,20,21]. The predicted control moves are centered around an unconstrained stabilizing control law, u ( k ) = K ( x ( k ) ) as computed in the Appendix A, over the whole prediction horizon, but some additive degrees of freedom, u ( k ) = K ( x ( k ) ) + c ( k ) are added over a finite horizon to handle constraints and guarantee the feasibility of improving performance. Therefore there is an implicit switching between one mode of operation and the other as the process converges to the desired state.
In the optimization problem of Equation (10), the first constraint is the nominal deviation system of Equation (5). The second and third constraints define the structure of the closed-loop controller, where K ( t ) is the terminal control law and the limitations of the manipulated variables u ( t ) , respectively. The last constraint presents the initial condition of the optimization of Equation (10).
The terminal region is obtained offline; here, the terminal control law K ( t ) is calculated (Appendix A) in each iteration as in [9].
The implementation strategy of the proposed two-layer dynamic optimization can be summarized as follows:
  • At time t k the upper layer economic NMPC with a prediction horizon N e receives the system state x ( t k ) from the process.
  • The controller of Equation (6) computes the economically optimal state trajectory x r * ( t ) .
  • The terminal control law K ( t ) is computed.
  • The solution of the optimization of Equation (9) denoted by u * ( t ) = K ( t ) x ( t ) + c * ( t ) is calculated to track the economic state trajectory computed in step 2.
  • Go to step 1, t k = t k + t

5. Stability

5.1. Definitions and Assumptions

We need to make certain definitions and assumptions about the system of Equation (5) to guarantee that the time-varying trajectory x r ( t ) can be tracked. We assume that the nominal system of Equation (1) is stabilizable at each fixed x r Ω .
The scalar comparison functions, K , K and KL , used to characterize the stability properties of a nonlinear systems are now recalled [22].
Definition 1.
A function α : [ 0 , a [ [ 0 , [ is:
  • a K -function if it is continuous, strictly increasing and α ( 0 ) = 0 .
  • a K -function if it is a K -function and a = and α ( r ) as r .
Definition 2.
A function β : [ 0 , a [ × [ 0 , [ [ 0 , [ is a KL -function if:
  • for each fixed t 0 , the function β ( r , t ) is a K -function, and
  • for each fixed r, the mapping β ( r , t ) is decreasing with respect to t and β ( r , t ) 0 as t .
To be of practical interest, the stability conditions should not require Equation (1) so be solved explicitly. The direct method of Lyapunov is used, as it allows the stability properties of an equilibrium point from Equation (5) and its relationship with a positive-definite function V ( e ) to be determined.
Definition 3.
Let G R n be a nonempty open set. Let a function f : G R have, at each point of the set G , all partial derivatives continuous (i.e., function x f x j ( x ) are continuous on G for each j { 1 , . . . , n } ). Then we say that f is of the class C 1 on G . The set of all these functions is denoted by C 1 ( G ) .
Definition 4.
Consider a function V C 1 : n that is positive-definite if V ( 0 ) = 0 and V ( e ) > 0 for all e 0 . Moreover, if V ( e ) as | | e | | , then V is said to be radially unbounded.
Definition 5.
A bounded input u : R + R m is called regularly persistent if
T > 0 ; T 0 0 ; t > t 0 , G ( u , t , t + T ) 0 or equivalently, λ m i n ( G ( u , t , t + T ) ) 0 (where λ m i n ( G ( u , t , t + T ) ) stands for the smallest eigenvalue of the Grammian G.
Assumption 1.
(Weak Controllability): There exists a K function γ ( . ) [23] such that, for every x Ω , there exists u such that ( x , u ) Z and
k = 0 N 1 | u k u r | γ ( | x x r | ) .
where Z is the set of admissible states. Assumption 1 is weaker than a controllability assumption, but it bounds the cost of steering an initial state x to x r . It confines attention to those initial states that can be steered to x r in N steps, while satisfying the control and state constraints.

5.2. Stability Analysis

In this section, we present the stability properties of the proposed two-layer control framework presented in Equations (9) and (10). The following theorem provides sufficient conditions such that the NLCGPC can track the economically time varying trajectory x r * ( t ) .
Theorem 1.
The system of Equation (1) is exponentially stable under the optimizations of Equation (9) and Equation (10) if there exist β 1 > 0 , β 2 > 0 , γ > 0 , L u > 0 , L e > 0 , L w > 0 and matrices P > 0 and Q 0 such that
λ m a x ( Q ) > 2 β 2 ( L e + L u γ )
Then,
| | e ( t ) | | β 2 β 1 e 1 2 α 1 δ t | | e ( 0 ) | |
where λ m a x stands for the biggest eigenvalue and α 1 is:
α 1 = 2 β 2 ( L e + L u γ ) λ m a x ( Q ) β 1
The proof of this theorem requires the following Lemmas.
Lemma 1
([24]). Let u be a regularly persistent input for the system (1). Then, P ( t ) is a symmetric positive definite matrix, and there exist β 1 > 0 and β 2 > 0 such that
t 0 , β 1 I P ( t ) β 2 I
where P ( 0 ) is an arbitrary symmetric definite matrix and I is the identity matrix with dimensions of P ( 0 ) .
Lemma 2
([25]). Let v ( t ) be a positive differentiable function satisfying the inequality
v ˙ ( t ) f ( t ) v ( t ) + g ( t ) v p ( t ) , t I = [ a , b ] ,
where the functions f ( t ) and g ( t ) are continuous in I, and p 0 , p 1 , is a constant. Then
v ( t ) e x p a t f ( s ) d s × v q ( a ) + q a t g ( s ) e x p q a s f ( τ ) d τ d s 1 q
where q = 1 p .
Proof of Theorem 1.
We define a Lyapunov function V ( t ) that verifies the conditions of Definitions 3:
V ( t ) = e T ( t ) P ( t ) e ( t )
where the matrix P ( t ) is the solution of the following Riccati equation:
A T ( t ) P ( t ) + P ( t ) A ( t ) + P ˙ ( t ) = Q ( t )
For t [ t k , t k + 1 ]
V ˙ ( t ) = 2 e T ( t ) P ( t ) e ˙ ( t ) + e T ( t ) P ˙ e ( t ) = 2 e T ( t ) P ( t ) [ A ( t ) e ( t ) + ψ ( x ( t ) , u * ( t ) , w ( t ) ) ψ ( x r * ( t ) , u r * ( t ) , 0 ) ] + e T ( t ) P ˙ ( t ) e ( t )
Using Equation (19) gives
V ˙ ( t ) = 2 e T ( t ) P ( t ) e ˙ ( t ) + e T ( t ) P ˙ e ( t ) = 2 e T ( t ) P ( t ) [ A ( t ) e ( t ) + ψ ( x ( t ) , u * ( t ) , w ( t ) ) ψ ( x r * ( t ) , u r * ( t ) , 0 ) ] + e T ( t ) [ A T ( t ) P ( t ) P ( t ) A ( t ) Q ( t ) ] e ( t ) = e T ( t ) Q ( t ) e ( t ) + 2 e T ( t ) P ( t ) [ ψ ( x ( t ) , u * ( t ) , w ( t ) ) ψ ( x r * ( t ) , u r * ( t ) , 0 ) ] + e T ( t ) P ( t ) A ( t ) e ( t ) e T ( t ) A T ( t ) P ( t ) e ( t ) λ m a x ( Q ( t ) ) | | e ( t ) | | 2 + λ m i n ( P ( t ) A ( t ) ) | | e ( t ) | | 2 λ m i n ( A T ( t ) P ( t ) ) | | e ( t ) | | 2 + 2 | | e ( t ) | | . | | P ( t ) | | × | | ψ ( x ( t ) , u * ( t ) , w ( t ) ) ψ ( x r * ( t ) , u r * ( t ) , 0 ) | |
By the Lipschitz property assumed for the vector ψ and by Assumption 1, there exist positive constants L w , L u and L e such that
| | ψ ( x ( t ) , u * ( t ) , w ( t ) ) ψ ( x r * ( t ) , u r * ( t ) , 0 ) | | L e | x ( t ) x r * ( t ) | + L u | u * ( t ) u r * ( t ) | + L w | w ( t ) | L e | e ( t ) | + L u γ | e ( t ) | + L w θ
Substituting Equation (21) in Equation (20) and using Lemma 1, the derivative of the Lyapunov function becomes
V ˙ ( t ) [ 2 β 2 ( L e + L u γ ) λ m a x ( Q ( t ) ) ] | | e ( t ) | | 2 + 2 β 2 L w θ | | e ( t ) | |
and by Lemma 1
β 1 | | e ( t ) | | 2 e T ( t ) P ( t ) e ( t ) β 2 | | e ( t ) | | 2
| | e ( t ) | | 2 V ( t ) β 1 β 2 β 1 | | e ( t ) | | 2 | | e ( t ) | | V ( t ) β 1 β 2 β 1 | | e ( t ) | |
Equation (22) becomes
V ˙ ( t ) α 1 V ( t ) + α 2 V ( t )
where
α 2 = 2 β 2 L w θ β 1
By Lemma 2, with
f ( t ) = α 1 , g ( t ) = α 2 p = 1 2 , I = [ t k , t k + 1 ]
Gives
V ( t ) e x p ( t k t α 1 d s ) [ V ( t k ) 1 2 t k t α 2 e x p ( 1 2 t k s α 1 ) d s ] 1 q
Replacing q by its value:
V ( t ) e x p ( t k t α 1 d s ) [ V ( t k ) 1 2 t k t α 2 e x p ( 1 2 t k s α 1 ) d s ] 2
That gives:
V ( t ) 1 2 ( e x p ( t k t α 1 d s ) ) 1 2 [ V ( t k ) 1 2 t k t α 2 e x p ( 1 2 t k s α 1 ) d s ]
That gives
V ( t ) e x p ( 1 2 α 1 ( t t k ) ) [ V ( t k ) α 2 α 1 ( 1 e x p ( 1 2 α 1 ( t t k ) ) ) ]
and we have:
0 e x p ( 1 2 α 1 ( t t k ) )
1 e x p ( 1 2 α 1 ( t t k ) ) 1
α 2 α 1 ( 1 e x p ( 1 2 α 1 ( t t k ) ) ) α 2 α 1
α 2 α 1 α 2 α 1 ( 1 e x p ( 1 2 α 1 ( t t k ) ) )
V ( t k ) α 2 α 1 V ( t k ) α 2 α 1 ( 1 e x p ( 1 2 α 1 ( t t k ) ) ) V ( t k )
Equation (26) becomes
V ( t ) e x p ( 1 2 α 1 ( t t k ) ) V ( t k )
Following the same reasoning in the Appendix B, we obtain
V ( t ) e x p ( 1 2 α 1 δ t ) V ( 0 )
Using the second inequality of Equation (24), hence
| | e ( t ) | | β 2 β 1 e x p ( 1 2 α 1 δ t ) | | e ( 0 ) | |
Consequently, the error between the actual system trajectory and the economically optimal trajectory e ( t ) = x ( t ) x r ( t ) is bounded by:
lim t | | e ( t ) | | = 0 .

6. Application to WWTP

WWTPs 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 WWTPs a really challenging case study from the control point of view. WWTPs have to be operated efficiently, minimizing the energy and consumption of resources, while meeting strict environmental regulations. Therefore, the advanced control strategies proposed in this paper are a promising alternative for improving their performance and economics.

6.1. Process Model

The WWTP process selected as a case study follows the specifications given in the Benchmark Simulation Protocol (BSM1) [26] which are widely accepted by the scientific community. However, the model focuses on the N-Removal process. The Benchmark Simulation Model (BSM1) has been widely applied to test control strategies for the Activated Sludge Process (ASP) in wastewater treatment plants. It consists of 5 bioreactors: 2 anoxic and 3 aerobic. In the simplified model considered in this work, only the significant variables of the BSM1 model on a medium time scale are taken into account. The processes with slow variations in time (the growth of autotrophic and heterotrophic microorganisms and hydrolyze processes) are neglected. The BSM1 representation is reduced to one anoxic and one aerated reactor as shown in Figure 2. The volumes of the two tanks are 2000 m 3 and 3999 m 3 , 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 the processes ρ are assumed to be zero in Equations (32) and (33).
The definitions of the state variables are given in Table 1. The definitions of the kinetic and physical parameters are presented in Table 2 and Table 3, and their values are the same as for BSM1 [24].

6.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 [26]:
  • Influent load and disturbances: In order to test the performance of the 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). 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 in Table 4.

6.3. 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.
In BSM1, the total average pumping energy (PE) over a certain period of time, T, depends directly on the internal recirculation flow rate Q a , according to [24], calculated as:
P E = 0.04 T t 0 t 0 + T ( Q a ( t ) + Q w ( t ) ) d t
expressed in kWh/day. In ( 36 ) , Q a denotes the return sludge flow rate and Q w the excess sludge flow rate, both in units of m 3 /day.
The aeration energy (AE) in kWh/day required to aerate the last three compartments is written as:
A E = 24 T t 0 t 0 + T i = 3 5 ( 0.4032 K L a i ( t ) 2 + 7.8408 K L a i ( t ) ) d t
where K L a i ( t ) is the oxygen transfer function in the aerated tank number i in units of h 1 .
The effluent quality (EQ) in Kg pollution/day is defined as a weighted daily average of the total concentration of different compounds in the effluent, as follows:
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:
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, TSS denotes total suspended solids and N t o t e is the total nitrogen 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 [24]. The model considered in this work was developed assuming 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 .
The total cost expressed in ( E U R / d a y ) can be calculated during the interval T by:
O C I = w 3 ( A E + P E )

6.4. Control Problem Formulation

The paper has two major aims. The first one is to show the advantages of a two-layer structure compared with a single-layer and the second one is to provide a theoretical framework of the stability by proving that the deviation between the lower layer and the economically optimal closed-loop trajectory computed by the upper layer is bounded. Two advanced control strategies, both based on nonlinear model predictive control, are tested in the WWTP.

6.4.1. Two Layer

(I).
Lower layer control problem
In this work, the NCLGPC algorithm is applied in the lower layer to control the oxygen S O 2 in the aerobic reactor, and the nitrate levels S N O 1 in the anoxic reactor. This is carried by minimizing the cost function in ( 10 ) subject to the corresponding constraints from Table 4. The manipulated variables are the oxygen transfer coefficient K L a and the internal recycle flow rate Q a , considering the influent flow ( Q i n ) (Figure 3), the organic matter concentration ( S S , i n ) (Figure 4) and the ammonium concentration ( S N H , i n ) (Figure 5) in the influent are measurable disturbances.
Summarizing, the specific WWTP control problem variables considered in this application are:
  • The state vector: x ( t ) = S N H 1 S N O 1 S S 1 S O 1 S N H 2 S N O 2 S S 2 S O 2 T .
  • The output variables: y ( t ) = S N O 1 S O 2 T .
  • The manipulated variables: u ( t ) = Q a K L a T .
  • The measured disturbances: w ( t ) = Q i n S S , i n S N H , i n T .
Rewriting the prediction model of Equations (32) and (33) as in Equation (1) gives:
x ˙ ( t ) = A ( t ) x ( t ) + ψ ( x ( t ) , u ( t ) , w ( t ) )
where
A ( t ) = Q i n V 1 0 0 0 0 0 0 0 0 Q i n V 1 0 0 0 0 0 0 0 0 Q i n V 1 0 0 0 0 0 0 0 0 Q i n V 1 0 0 0 0 Q i n V 2 0 0 0 Q i n V 2 0 0 0 0 Q i n V 2 0 0 0 Q i n V 2 0 0 0 0 Q i n V 2 0 0 0 Q i n V 2 0 0 0 0 Q i n V 2 0 0 0 Q i n V 2
Note that, for the WWTP, Q i n is a positive slow time varying variable and, since A ( t ) is a lower triangular matrix with negative diagonal entries, i.e., with negative eigenvalues t 0 , the assumed condition on A ( t ) in the problem statement (Section 1) is verified.
ψ ( x ( t ) , u ( t ) , w ( t ) ) = 1 V 1 Q i n S N H i n + Q a S N H 2 Q a S N H 1 i x b ρ 11 i x b ρ 21 ( i x b + 1 Y A ) ρ 31 1 V 1 Q a S N O 2 Q a S N O 1 1 Y H 2.86 Y H ρ 21 + 1 Y A ρ 31 1 V 1 Q i n S S i n + Q a S S 2 Q a S S 1 1 Y H ρ 11 1 Y H ρ 21 1 V 1 Q a S O 2 Q a S O 1 1 Y H Y H ρ 11 ( 4.57 Y A + 1 ) ρ 31 1 V 2 Q a ( S N H 1 S N H 2 ) i x b ρ 12 ( i x b + 1 Y A ) ρ 32 1 V 2 Q a ( S N O 1 S N O 2 ) 1 Y H 2.86 Y A ρ 22 + 1 Y A ρ 32 1 V 2 Q a ( S S 1 S S 2 ) 1 Y H ρ 12 1 Y H ρ 22 1 V 2 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 )
(II).
Upper layer control problem
In the upper layer, the economic function to be minimized subject to the corresponding constraints from Table 4 is:
f e c o ( K l a ( t ) , Q a ( t ) ) = w 3 ( A E ( K l a ( t ) ) + P E ( Q a ( t ) )
where A E and P E are defined in ( 36 ) and ( 37 ) .
In order to defined the control problem in ( 9 ) , the gradient of f e c o has been computed according to ( 8 ) , giving us:
D = 0.04 0.8064 K L a + 0.4032
G = 0 0 0 19.3536

6.4.2. One Layer

The one-layer optimization problem proposed in [9] consists of the optimization of a cost function that includes the penalization of control error, of control efforts and the same ( f e c o ) 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 ) )
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
Some specific characteristics of this control strategy are:
  • The predicted control moves are centered around an unconstrained stabilizing control law, u ( k ) = K ( 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.
  • In the objective function the nonlinear economic term is replaced by its gradient.
  • The prediction model, a nonlinear phenomenological model of the plant, is written as a state dependent coefficient model, also called extended linearization.

7. Simulations Settings

The economic NMPC algorithm uses the phenomenological model of the plant described in Equations (32)–(35) for predictions. The fmincon method of Matlab, based on sequential quadratic programming, uses each sampling time to obtain the optimal manipulated variables.
After some preliminary tests, the selected values to tune the economic NMPC for the upper layer are the control horizon m e = 2 , prediction horizon N e = 4 and the weight of the economic function is w 3 = 1 , while the tuning parameters of the optimizing controller for the lower layer are control horizon m = 2 , prediction horizon N = 4 , output weight w 1 = d i a g ( 0.155 , 0.01 , 0.155 , 0.01 ) and input weight w 2 = d i a g ( 0.01 , 0.01 ) .
Figure 3, Figure 4 and Figure 5 present the different profiles of perturbations of B S M 1 used in this study. In this influent, we can observe strong variations in the flow and concentrations during dry weather.
The performance assessment is made at two levels. The first level concerns the control design. The second level measures the effect of the control strategy on plant performance.

8. Simulations Results

Several simulations are carried out to study the process behavior with the controller 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.
The evolution of the most relevant process variables along the operating horizon is presented in the following figures.
Figure 6a,b present the two outputs that are, respectively, the dissolved oxygen in the aerobic reactor and the nitrate in the anoxic reactor. From the Figure 6, the ability of the controller to track the desired set point and disturbances rejection can be appreciated. Figure 7a,b present the evolution of the concentrations S N H 2 and N T o t a l . Good tracking of the controller is observed in spite of the frequent changes of set point and the strong variations in the influent. It is observed that the concentrations SNH2 and SNtot are below the limits most of the simulation time.
The two manipulated variables are shown in Figure 8, indicating that suitable control signals, K l a and Q a , drive the process to follow the set point, while satisfying the constraints imposed. Finally, Figure 9 presents the evolution of the degree of freedom C.
The criteria for evaluating the advantages of the implementation of the different architectures are the tradeoff between economic benefit, process performance, and complexity of the control structure. The performance evaluation criteria is the indicated in the BSM1 protocol for WWTPs.
In order to compare the economic efficiency of the proposed strategy developed in this paper, the performance of the plant with a two layer structure is compared with a one layer nonlinear economic closed-loop generalized predictive control described in Section 6.4.2 (for more details about this controller, please see [9]). The comparison is done in terms of the overall cost index (Equation (40)), aeration energy (Equation (37)), pumping energy (Equation (36)) and effluent quality (Equation (38)). To make a fair comparison, the same process disturbances as in Figure 3, Figure 4 and Figure 5 were applied to each closed-loop system simulation. The details of the comparisons in stormy weather are shown in Table 5.
Table 5 shows that the two-layer strategy improves the economic aspect by reducing the O C I index by 14.99 % , the A E by 17.87 % and the P E by 4.72 % , which proves that the proposed two-layer controller is sufficient for good performance and, in addition, this control could be easily extended to other applications.

9. Conclusions

In this work, we have proposed a two-layer strategy for integrating dynamic economic optimization and nonlinear closed-loop GPCs for nonlinear systems. In the upper layer, an economic NMPC is used to compute an economically optimal time-varying operating trajectory. Instead of including the nonlinear economic cost in the objective function, an approximation of the reduced gradient of the economic function is used. The lower layer is used to compute feedback control actions that force the outputs of the process to track the trajectories received from the upper layer.The controller used in this layer is a nonlinear closed-loop GPC. Instead of the classic dual-mode MPC (model predictive controller) schemes, where the terminal control law defined in the terminal region is obtained offline by solving a linear quadratic regulator problem, here, the terminal control law is determined online by an unconstrained nonlinear generalized predictive control. We have proved that the deviation between the actual closed-loop system and the economically optimal closed-loop trajectory is bounded. This paper presents a two-level hierarchical control structure for biological wastewater treatment plants, with the goal of improving effluent quality and reducing operational costs. Modifying the tuning parameters of the higher level, a tuning region is determined in which the effluent quality and operational costs are simultaneously improved.
The proposed methodology has been successfully applied to the N-Removal process in a WWTP. The strategy drives the plant to the economically optimal operating condition in spite of strong disturbances in the influent. The application of the proposed control strategies reduces the operational costs by around 15%, together with a satisfactory compromise regarding effluent quality in comparison with the one-layer strategy. The methodology of this work is general and can easily be extended to other applications.

Author Contributions

H.E.b. and P.V. conceived and designed the experiments; H.E.b. performed the experiments; F.T. analyzed the data. All the authors have contributed to write the paper. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Spanish Government through the MINECO project DPI2015-67341C21R and by the Junta de Castilla y Leon and FEDER funds (CLU 2017-09 and UIC 233).

Acknowledgments

The first and the second authors gratefully acknowledge the support of the Spanish Government through the MINECO project DPI2015-67341-C2-1-R. The last author is funded by the Junta de Castilla y Leon and FEDER funds (CLU 2017-09 and UIC 233).

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
MPCModel Predictive Control
NMPCModel Predictive Control
GPCGeneralized Predictive Control
NCLGPCNonlinear Closed Loop Generalized Predictive Control
QPQuadratic Programming
NLPNonlinear Programming
RTOReal Time Optimization
D-RTODynamic Real Time Optimization
CLMPCClosed Loop Model Predictive Control
WWTPWastewater Treatment Plant
MIMOMulti Input Multi Output
PEPumping Energy
AEAeration Energy
EQEffluent Quality
OCIOverall Coast Index
BSM1Benchmark Simulation Model 1
ASPActivated Sludge Process

Appendix A

The system is discretized using Euler integration method and re-arranged into the state-dependent coefficient form. State and control dependent matrices in general may be formulated in an infinite number of ways. Finally we can write the discrete model in the following matrix form:
x k + 1 = A ˜ ( x k ) x k + B ˜ ( x k ) u k
y k = C ˜ ( x k ) x k
The state-dependent form of the model, in state space format, is substituted to the traditional GPC format, allowing for inherent integral action within the model, including the control increment as system input to the state space model. Thus, an extra system state is included.
χ 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 ] and χ k = x k u k 1
To derive the nonlinear predictive control algorithm, the assumption on the future trajectory of the system must be made. In this work, we assume that the future trajectory for the state of the system is known. State-space model (A4), (A5) 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. Therefore, the following notations for state-dependent matrices A k = A ( χ k ) , B k = B ( χ k ) and C k = C ( χ k ) are used in the remaining part of the paper. Now, the future trajectory for the system has to be determined. In the classic predictive control strategy, the vector of current and future controls is calculated. For the receding horizon control technique, only the first control is used for the plant inputs manipulation, and the remaining part is not. However, this part may be employed in the next iteration of the algorithm to predict the future trajectory.
The cost function it can be written as:
J k = i = 1 p w 1 ( r ( k + i | k ) y ( k + i | k ) 2 2 + i = 0 m 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:
X k + 1 , p = [ χ k + 1 T , , χ k + p T ] T , Δ U k , m = [ Δ u k T , , Δ u k + m 1 T ] T Y k + 1 , p = [ y k + 1 T , , y k + p T ] T , R k + 1 , p = [ r k + 1 T , , r k + p T ] T
The cost function (A6) with notation (A7) may be written in the vector form:
J k = ( R k + 1 , p Y k + 1 , p ) T w 1 ( R k + 1 , p Y k + 1 , p ) + Δ U k , m T w 2 Δ U k , m + ( d + G Δ U k , m ) T w 3 ( d + G Δ U k , m )
Now using (A7) the following equation for the future state predictions vector X k + l , p is obtained:
X k , p = Ω k , p A k χ k + Ψ k , p Δ U k , m
where
Ω k , p = Π i = 1 0 A k + i T Π i = 1 1 A k + i T Π i = 1 p 1 A k + i T .
Ψ k , p = [ Π i = 1 0 A k + i ] B k 0 [ Π i = 1 1 A k + i ] B k [ Π i = 2 0 A k + i ] B k + 1 [ Π i = 1 p 1 A k + i ] B k [ Π i = 2 p 1 A k + i ] B k + 1
0 [ Π i = m p 1 A k + i ] B k + m 1
From the output equation it is clear that
y k + i = C k + i χ k + i
Combining (A7) and (A10) the following relationship between vectors X k + l , p and Y k + 1 , p is obtained:
Y k + 1 , p = Θ k , p X k + 1 , p
where: Θ k , p = d i a g ( C k + 1 , C k + 2 , , C k + p )
Finally, substituting in ( A 11 ) X k + p by ( A 9 ) the following equation for output prediction is obtained
Y k + 1 , p = Φ k , p A k χ k + S k , p Δ U k , m
where:
Φ k , p = Θ k , p Ω k , p , S k , p = Θ k , p Ψ k , p
Substituting Y n + 1 , p in the cost function (A6) by the equation (A12) and performing the static optimization, the control minimizing the given cost function is finally derived:
Δ U k , m = ( S k , p T w 1 S k , p + w 2 + G T w 3 G ) 1 S k , p w 1 ( R k + 1 , p Φ k , p A k χ k ) G T w 3 d

Appendix B

If we pose t = t k + 1 and t k + 1 t k = δ in the Equation ( 28 ) gives
V ( t k + 1 ) e x p ( 1 2 α 1 δ ) V ( t k )
Additionally, moving k in time from 0 until t
V ( 1 ) e x p ( 1 2 α 1 δ ) V ( 0 )
V ( 2 ) e x p ( 1 2 α 1 δ ) V ( 1 )
V ( t ) ( e x p ( 1 2 α 1 ) δ ) t V ( 0 )
V ( t ) e x p ( 1 2 α 1 ) δ t V ( 0 )

References

  1. Edgar, T. Control and operations: When does controllability equal profitability? Comput. Chem. Eng. 2004, 29, 41–49. [Google Scholar] [CrossRef]
  2. Darby, M.L.; Nikolau, M.; Jones, J.; Nicholson, D. RTO: An overview and assessment of current practice. J. Process Control 2011, 21, 874–884. [Google Scholar] [CrossRef]
  3. Rawlings, J.B.; Patel, N.R.; Risbeck, M.J.; Maravelias, C.T.; Wenzel, M.J.; Turney, R.D. Economic MPC and real-time decision making with application to large-scale HVAC energy systems. Comput. Chem. Eng. 2018, 114, 89–98. [Google Scholar] [CrossRef]
  4. 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]
  5. De Prada, C.; Sarabia, D.; Gutierrez, G.; Gomez, E.; Marmol, S.; Sola, M.; Pascual, C.; Gonzalez, R. Integration of RTO and MPC in the Hydrogen Network of a Petrol Refinery. Processes 2017, 5, 3. [Google Scholar] [CrossRef]
  6. Rawlings, J.B.; Amrit, R. Optimizing Process Economic Performance Using Model Predictive Control. In Nonlinear Model Predictive Control; Magni, L., Raimondo, D.M., Allgöwer, F., Eds.; Lecture Notes in Control and Information Sciences; Springer: Berlin/Heidelberg, Germany, 2009; Volume 384. [Google Scholar]
  7. Ellis, M.; Christofides, P.D. 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]
  8. Kadam, J.V.; Schlegel, M.; Marquardt, W.; Tousain, R.L.; Van Hessem, D.H.; van den Berg, J.; Bosgra, O.H. A two-level strategy of integrated dynamic optimization and control of industrial processes–a case study. In Computer Aided Chemical Engineering; Elsevier: Amsterdam, The Netherlands, 2002; Volume 10, pp. 511–516. [Google Scholar]
  9. 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. [Google Scholar] [CrossRef]
  10. Zanin, A.C.; de Gouvéa, M.T.; Odloak, D. Integrating real-time optimization into the model predictive controller of the fcc system. Control Eng. Pract. 2002, 10, 819–831. [Google Scholar] [CrossRef]
  11. Huang, R.; Harinath, E.; Biegler, L.T. Lyapunov stability of economically oriented NMPC for cyclic processes. J. Process. Control 2011, 21, 501–509. [Google Scholar] [CrossRef]
  12. Heidarinejad, M.; Liu, J.; Christofides, P.D. Economic model predictive control of nonlinear process systems using Lyapunov techniques. AIChE J. 2012, 58, 855–870. [Google Scholar] [CrossRef]
  13. Zambrano, D.; Camacho, E.F. Application of MPC with multiple objective for a solar refrigeration plant. In Proceedings of the International Conference on Control Applications, Glasgow, UK, 18–20 September 2002; Volume 2, pp. 1230–1235. [Google Scholar]
  14. Zavala, V.M. Real-Time Resolution of Conflicting Objectives in Building Energy Management: An Utopia-Ttracking Approach; Technical Report ANL/MCS-P2056-0312; Argonne National Laboratory: Lemont, IL, USA, 2012. [Google Scholar]
  15. Piotrowski, R.; Brdys, M.A.; Konarczak, K.; Duzinkiewicz, K.; Chotkowski, W. Hierarchical dissolved oxygen control for activated sludge processes. Control Eng. Pract. 2008, 16, 114–131. [Google Scholar] [CrossRef]
  16. Yamanaka, O.; Obara, T.; Yamamoto, K. Total cost minimization control scheme for biological wastewater treatment process and its evaluation based on the cost benchmark process. Water Sci. Technol. 2006, 53, 203–214. [Google Scholar] [CrossRef] [PubMed]
  17. Benot, B.; Lemoine, C.; Steyer, J.-P. Multiobjective genetic algorithms for the optimisation of wastewater treatment processes. In Computational Intelligence Techniques for Bioprocess Modelling Supervision and Control; Springer: Berlin/Heidelberg, Germany, 2009; pp. 163–195. [Google Scholar]
  18. 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]
  19. Imsland, L.; Rossiter, J.A.; Pluymers, B.; Suykens, J. Robust triple mode MPC. Int. J. Control 2008, 81, 679–689. [Google Scholar] [CrossRef]
  20. 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]
  21. Rossiter, J.A. Model-Based Predictive Control: A Practical Approach; CRC Press: Boca Raton, FL, USA, 2013. [Google Scholar]
  22. El bahja, H.; Vega, P.; Tadeo, F.; Francisco, M. A constrained closed loop MPC based on positive invariance concept for a wastewater treatment plant. Int. J. Syst. Sci. 2018, 49, 2101–2115. [Google Scholar] [CrossRef]
  23. Zavala, V.M.; Flores-Tlacuahuac, A. Stability of multiobjective predictive control: A utopia-tracking approach. Automatica 2012, 48, 2627–2632. [Google Scholar] [CrossRef]
  24. Nadri, M.; Hammouri, H. Design of a continuous-discrete observer for state affine systems. Appl. Math. Lett. 2003, 16, 967–974. [Google Scholar] [CrossRef]
  25. Oguntuase, J.A. On an inequality of Gronwall. J. Inequalities Pure Appl. Math. 2001, 2, 1–6. [Google Scholar]
  26. 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]
Figure 1. A block diagram of the proposed two-layer framework.
Figure 1. A block diagram of the proposed two-layer framework.
Processes 10 01821 g001
Figure 2. Schematic representation of the plant.
Figure 2. Schematic representation of the plant.
Processes 10 01821 g002
Figure 3. Influent flow Q i n for stormy weather.
Figure 3. Influent flow Q i n for stormy weather.
Processes 10 01821 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.
Processes 10 01821 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.
Processes 10 01821 g005
Figure 6. Responses of controlled variables under the proposed controller. (a) Dissolved oxygen concentration S O 2 , (b) Nitrite and nitrate concentration S N O .
Figure 6. Responses of controlled variables under the proposed controller. (a) Dissolved oxygen concentration S O 2 , (b) Nitrite and nitrate concentration S N O .
Processes 10 01821 g006
Figure 7. Ammonium and total nitrogen concentration under the proposed controller. (a) Ammonium concentration N H 2 , (b) Total Nitrogen N T o t a l .
Figure 7. Ammonium and total nitrogen concentration under the proposed controller. (a) Ammonium concentration N H 2 , (b) Total Nitrogen N T o t a l .
Processes 10 01821 g007aProcesses 10 01821 g007b
Figure 8. Manipulated variables with the proposed controller. (a) Oxygen transfer coefficient K L a , (b) Internal recycled flow Q a .
Figure 8. Manipulated variables with the proposed controller. (a) Oxygen transfer coefficient K L a , (b) Internal recycled flow Q a .
Processes 10 01821 g008
Figure 9. Evolution of the degree of freedom C. (a) Evolution of C 1 , (b) Evolution of C 2 .
Figure 9. Evolution of the degree of freedom C. (a) Evolution of C 1 , (b) Evolution of C 2 .
Processes 10 01821 g009
Table 1. List of state variables of the model.
Table 1. List of state variables of the model.
Notation    DefinitionUnit
S N H N H 4 + N H 3 concentrationgrN/m 3
S N O Nitrate and nitrite concentrationgrN/m 3
S S Readily biodegradable substrate concentration           grCOD/m 3         
S O Dissolved oxygen concentrationgr/m 3
Table 2. Process characteristics.
Table 2. Process characteristics.
NotationDefinition
Q i n Influent flow rate
S S , i n Influent organic matter concentration
S N H , i n Influent ammonium compounds concentration        
Q a Internal recycle flow
K L a 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 , s a t 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 N H Ammonia saturation coefficient for heterotrophs        
K O , A Oxygen saturation coefficient for autotrophs
Y H Heterotrophic yield
Y A Autotrophic yield
i x b Nitrogen fraction in biomass
Table 4. Bounds of the effluent concentrations.
Table 4. Bounds of the effluent concentrations.
Effluent QualitiesUpper BoundUnit
S N H 4mg/L
S N O 10mg/L
N t o t 18mg/L
T S S 30mg/L
C O D 100mg/L
K L a 200d 1
Q a 3850      m 3 /d
Table 5. Comparison of performance indices for one-layer and two-layer strategies.
Table 5. Comparison of performance indices for one-layer and two-layer strategies.
Strategy IndexOne Layer [9]Two Layers%
A E 1449.401190.40−17.87%
P E 421.55401.64−4.72%
E Q 5897.005845.00−0.88%
O C I 1870.901592.10−14.99%
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

El bahja, H.; Vega, P.; Tadeo, F. Integrating Dynamic Economic Optimization and Nonlinear Closed-Loop GPC: Application to a WWTP. Processes 2022, 10, 1821. https://doi.org/10.3390/pr10091821

AMA Style

El bahja H, Vega P, Tadeo F. Integrating Dynamic Economic Optimization and Nonlinear Closed-Loop GPC: Application to a WWTP. Processes. 2022; 10(9):1821. https://doi.org/10.3390/pr10091821

Chicago/Turabian Style

El bahja, Hicham, Pastora Vega, and Fernando Tadeo. 2022. "Integrating Dynamic Economic Optimization and Nonlinear Closed-Loop GPC: Application to a WWTP" Processes 10, no. 9: 1821. https://doi.org/10.3390/pr10091821

APA Style

El bahja, H., Vega, P., & Tadeo, F. (2022). Integrating Dynamic Economic Optimization and Nonlinear Closed-Loop GPC: Application to a WWTP. Processes, 10(9), 1821. https://doi.org/10.3390/pr10091821

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