Gradient Descent Optimization Control of an Activated Sludge Process based on Radial Basis Function Neural Network

Most systems in science and engineering can be described in the form of ordinary differential equations, but only a limited number of these equations can be solved analytically. For that reason, numerical methods have been used to get the approximate solutions of differential equations. Among these methods, the most famous is the Euler method. In this paper, a new proposed control strategy utilizing the Euler and the gradient method based on Radial Basis Function Neural Network (RBFNN) model have been used to control the activated sludge process of wastewater treatment. The aim was to maintain the Dissolved Oxygen (DO) level in the aerated tank and have the substrate concentration Chemical Oxygen Demand (COD5) within the standard limits. The simulation results of DO show the robustness of the proposed control method compared to the classical method. The proposed method can be applied in wastewater treatment systems. Keywords-activated sludge process; Euler method; gradient method; nonlinear system; RBF neural network; wastewater treatment

Abstract-Most systems in science and engineering can be described in the form of ordinary differential equations, but only a limited number of these equations can be solved analytically. For that reason, numerical methods have been used to get the approximate solutions of differential equations. Among these methods, the most famous is the Euler method. In this paper, a new proposed control strategy utilizing the Euler and the gradient method based on Radial Basis Function Neural Network (RBFNN) model have been used to control the activated sludge process of wastewater treatment. The aim was to maintain the Dissolved Oxygen (DO) level in the aerated tank and have the substrate concentration Chemical Oxygen Demand (COD 5 ) within the standard limits. The simulation results of DO show the robustness of the proposed control method compared to the classical method. The proposed method can be applied in wastewater treatment systems.
Keywords-activated sludge process; Euler method; gradient method; nonlinear system; RBF neural network; wastewater treatment I.
INTRODUCTION Various industrial processes often generate large quantities of wastewater that must be treated in the safest and least expensive way, according to the discharge regulations. This water, prior to its discharge, is treated through a primary and a secondary process, which increase production cost. Therefore, modern industries seek ways to reduce the use of water during the production process and/or means for a more efficient and low-cost secondary treatment. The primary treatment consists of an operation that separates solid particulate materials and coarse contaminants, by previous decanting. The secondary treatment is after the decanting and consists in the biological removal of dissolved contaminant material by the use of active sludge consisting of microorganisms that metabolize the dissolved organic matter in aerobic conditions [1,2]. Dissolved Oxygen (DO) level has a direct influence on the activity of the microorganisms. Insufficient supply of DO worsens the quality of the treated wastewater, and for that reason the control of the DO concentration became the most studied control in activated sludge process [3]. Many control strategies have been proposed for activated sludge process of wastewater treatment, starting from classical controllers such as the Proportional-Integral-Derivative (PID) controller to keep the process at a set-point [4,5] and fuzzy logic control to improve the operational performance of the system [6,7]. Some modern controllers based on the process model have been also used for the activated sludge process. Model Predictive Control (MPC) methods have been applied on the distinct activated sludge process [8][9][10]. An adaptive fuzzy control strategy for DO concentration was used to control the activated sludge process in [11]. The controller manipulates the flow control valves supplying air to the bioreactor. In [12], Takagi-Sugeno fuzzy PI control has been applied for managing DO concentration. Authors considered the dilution rate, influent DO and influent substrate concentration as the disturbance. Two control strategies which as a gain scheduling PI control and a Model Predictive Control (MPC) were used to maintain substrate concentration in the effluent within the standard limits by controlling the DO concentration in [13]. Authors in [14], employed a fuzzy model-based predictive controller for activated sludge process. The objective was to maintain the DO concentration. Authors in [15] used a Takagi Sugeno (TS) Fuzzy Inference System (FIS) to approximate the feedback linearization law for controlling the DO concentration in the bioreactor. The purpose was to obtain the chemical oxygen demand (COD 5 ) limited in the effluent. Piotrowski proposed nonlinear fuzzy control for tracking the DO reference trajectory in activated sludge process via the aeration system [16]. Sequencing batch reactor and aeration system are modeled as plant control performed by the cascade nonlinear adaptive control system extended by an anti-windup filter in [17]. Authors in [18] developed an adaptive neural technique using a disturbance observer to solve the DO concentration control problem.
In this paper, a nonlinear control strategy based on Euler and gradient method to control the DO in wastewater treatment process via aeration rate is proposed. The performance of the proposed control strategy laws is illustrated with numerical simulations and their results are compared with a conventional PI controller's.
II. EULER METHOD Let us consider the following differential equation: is the initial condition, t : time, u: input control, u y : output system. (3) Figure 1 shows the curves of (2) and (3). The numerical solution of the differential equation (2) is defined to be a set of points ( ) k k y t , and each point is an approximation to the corresponding points . We begin by discretizing the variable t into N equal subintervals such as , the parameter h is the step size. The principal of Euler's method is to approximate the solutions of (2). We begin by integrating the two parts of (2) between 0 t and 1 t (we begin by choosing a step size ). The system equation can be written as follows: By using the Euler method, (4) can be written as: The objective of the proposed algorithm is to control the system output via the input control u . For that reason, we have to find at every instant k t the value of k u that makes the system output 0 u y track the reference r .

III. GRADIENT DESCENT ALGORITHM FOR CONTROLLING OF NONLINEAR SYSTEM
Gradient descent is an iterative minimization method. In this paper, the gradient descent method is employed to control a nonlinear system. From (6), we have: Firstly, at time 1 The input control k u is adjusted by using the gradient descent algorithm by minimizing the objective function with respect to 0 u . The objective function in this case is the squared The input control 1 u is updated by using the gradient descent algorithm: where λ is the learning rate parameter.
The RBF neural network will be used to determine ( )

IV. RBFNN ALGORITHM
The Radial Basis Function Neural Network (RBFNN) is introduced in [19]. The RBFNN has three layers: an input layer, a nonlinear hidden layer that uses Gaussian function as activation function, and a linear output layer [20][21][22]. RBFNNs have many uses, including function approximation, classification, and system control. They have the advantage of fast learning speed and are able to avoid the problem of local minimum. The structure of the RBF neural network is illustrated in Figure 2. RBF neural network structure.
The output of the j th hidden neuron with center C i,j and width parameter b j is: is the input vector of the RBF network.
The RBFNN output can be described in the following equation: where W l,j is the weight between the hidden layer and the output layer. The center C i,j , the basis width parameter b j and the weights W l,j of the RBFNN are adjusted by using the gradient descent algorithm to minimize the sum of square error RBF E (the error between the system output 0 u y and the RBFNN output y m (Figure 3)) by using the following equations: The expression of E RBF is given as: The corresponding modifier formulas are: where a is momentum factor, and η is the learning rate.
Generally, it is difficult or impossible to find ( ) According to this, we can obtain: . The structure of the proposed method is illustrated in Figure 4. The activated sludge process is a biological treatment that uses microorganisms (biomass) to remove organic matter, nitrogen, and phosphorus. The organic and nitrogen removal are the most used in wastewater treatment. The schema of the wastewater treatment process is illustrated in Figure 5. The process consists of a biological reactor (aeration tank) where the microorganism (biomass) population is developed aiming to remove the substrate from the reactor, and a settler. In the settler tank, the solids are separated from the wastewater. A part of the removed sludge is recycled back to the aeration tank. The mathematical model considered in this paper contains four differential equations: the biomass concentration X, the substrate concentration S, the DO concentration DO and the recycled biomass concentration X r . The model is given by the following equations [24,25]: . . with: where W is the air flow rate, which will be considered as the input control to maintain the oxygen concentration level in the aeration tank. The used step size is h=0. 5. More details about the model parameters can be found in the appendix.

VI. RESULTS AND DISCUSSION
The proposed method has been used to control the organic COD 5 in the aeration tank through concentration control. Figures 6 and 7 show the DO and substrate concentration in open loop (without control). We can see clearly that the substrate concentration is above the standard limit of 20mg/l the control of substrate became a necessity. In order to test the effectiveness and the performance of the proposed method, the used set-point of the dissolved oxygen concentration changes immediately from 5mg/l to 5.5mg/l and from 5.5mg/l to 6.5mg/l and from 6mg/l to 7mg/l. For comparison, two controllers have been used: the PI controller with parameters: k p =3, k i =0.9 and the PSO-PI with the optimized parameters: k p =7.3618 and k i =8.8304. At the beginning the dilution rate and the influent substrate concentration are considered constants (D=0.04h -1 and S in =200mg/l).   Aeration rate (control variable).
DO concentration with constant dilution rate is depicted in Figure 8. From the simulations results it can be seen that the proposed controllers are able to control the DO level to track the desired set-point DO ref , contrary of the PI controller that doesn't track the desired reference DO ref . Initially the set-point for DO level DO ref is 5mg/l and the control variable or aeration rate W is at 40m 3 /l (Figure 9). After a while, when the DO level DO ref suddenly changed to 5.5mg/l the aeration rate W increased to 45m 3 /l to satisfy the augmented demand for oxygen (the DO level changes to track the set-point level DO ref ). So, W depends on the demand of oxygen (when W increases the DO level increases, and vice versa). The dilution rate and the influent substrate concentration are considered variables (in real wastewater treatment systems). In Figure 10, different values of dilution rate were considered to cover the work domain (the water flow entering the reactor is not constant throughout the operation). Figure 11 shows the influent substrate concentration S in with different values to assure a real study of the wastewater system. When the influent substrate concentration increases from 200mg/l to 300mg/l, the PI controller from Figure 12 is strongly affected by this change and it is not able to track the set-point reference, in contrast with the proposed method that  Figure 13. It can be seen that the power signal (control variable) of the proposed method is higher compared with the PI controller and PSO-PI controller respectively. In Figure 14 we can see that the chemical oxygen demand COD 5 is biologically degraded below 20mg/l (the legislation limit on wastewater treatment) and the wanted objective is established in the case of variable set-point of the dissolved oxygen concentration. In order to compare the different control strategies, their performance should be assessed by the Integral of Absolute Error (IAE) and the Integral of Square Error (ISE). These criteria are computed as:  Chemical oxygen demand COD5. VII. CONCLUSION Wastewater treatment processes are very marked nonlinear systems because of the limited measurement data available on biological processes, a fact that complicates the control task when using the classical methods. In this paper, the proposed control method based on Euler and gradient has been established to control the chemical oxygen demand COD 5 via the control of the DO concentration in an activated sludge process of wastewater treatment (no measurements of the substrate concentration are needed). The effectiveness of the proposed method was evaluated through a comparison with the classic PI controller. A variable set-point reference for the DO concentration has been designed. Based on the above results, it can be seen that the proposed controller is proven to be the better choice in terms of performance, required time for establishment, and process overshoot.