Parameter Identification of an Activated Sludge Wastewater Treatment Process Based on Particle Swarm Optimization Method

The current paper is entirely devoted to show the applicability of Particle Swarm Optimization (PSO) algorithm as a parameter identificationmethod for a representativemodel of anActivated SludgeWastewater Treatment Process (ASWWTP)with alternating phases. The model of identification is composed of two linear submodels: one for the aerobic phase and the other for the anoxic phase. In order to prove the efficiency of the proposed method, its performance is compared with another classical method called Simplex Search Algorithm (SSA) as well as with the experimental data.


Introduction
Over the years, populations' growth, industries' development, and chemical products' spreading have been causing a devastating impact on the environment especially natural water resources.Responding to the rising concerns about this fact, many researches have been trying to find out effective methods to remove the carbon and nitrogen pollutants from water and to regulate its quality respecting the international standards.Biological wastewater treatment processes have proved to be the best solution considering their efficiency and economical profit.One of the most well-known solicited bioprocesses is the activated sludge process.It is founded, under well-defined conditions (oxygen presence, external carbon source), on the biological oxidation of the polluted water through microorganisms activity [1].
Models of wastewater treatment processes are very complicated and strongly nonlinear.A proper and a more effective presentation can build up clear understanding of these processes and arrange a better process design and control strategy.Literature had proposed some models determined by IWA (International Water Association): a group which was very interested in presenting to researchers a standardized collection of models.The most popular one and the starting point for all the models was the ASM1 (activated sludge model no.1).It was developed in 1987 [2].This model produces a general acceptance for the wastewater treatment processes' configuration for both industrial communities and researchers.It is based on removing carbon and nitrate substrates and contains 13 state variables and more than 20 parameters [3].Therefore this model's capabilities are extended by developing another model called activated sludge model no. 2 (ASM2) with 19 state variables.However it does not yet describe all phenomena that take place [4].After that, two other developments of ASM2 were proposed: firstly, the ASM2d by adding the denitrifying activity of the phosphorus that would provide a clear picture for the performance of phosphate and nitrate [5], and, secondly, the ASM3 [6] which was intended to became the basic modern model [7,8].The prime defect of ASM1 is its complication which makes it less efficient to be used for the system controlling strategy.All of this leads researchers to seek more simplified models like the reference model that incorporates 11 nonlinear differential equations with 20 parameters.However it is also as complex as the ASM1 which requires creating other reduced models [9,10].
The parameter identification problem presents a very important one for wastewater treatment processes.The huge number of state variables and parameters makes the identification procedure very difficult.Up to date, variety of methods for model identifiability, model calibration, and validation were studied [11][12][13][14][15]. Concerning parameters identification, many techniques have been applied: conventional such as the simplex method [9], recursive prediction error method [16], subspace method [17], the calculus of state variables sensibilities [3], and the minimization of an Euclidean-distance criterion [18]; nonconventional like the neural networks [19,20] and evolutionary methods [21,22].
In this work, standing on the successful results obtained by the application of Particle Swarm Optimization (PSO) algorithm in various areas like robotics, solar energy, image segmentation, telecommunication [23][24][25][26][27], its use will be considered especially in the field of models' parameter identification [22,[28][29][30][31][32].In this way, this algorithm will be applied for a model that describes an activated sludge wastewater treatment process.The PSO is a stochastic optimization method originally developed by Kennedy and Eberhart in 1995 [33].It is one of the most favoured evolutionary computations, first used for simulating the social behavior of animals, precisely the movement of individuals in swarm or group like a bird flock or a fish school.The PSO algorithm is based on an initial population of organisms which present the candidate solutions for the proposed problem.It has a flexible mechanism to intensify the local and global exploration and exploitation abilities in the searching space that guides eventually to the best solution.
In this paper, the evaluation of the applied PSO performance in parameter identification will be done by comparing it with one of the conventional methods named Simplex Search Algorithm as well as with the real-life system measurements.The remainder of this contribution is formulated as follows: The description of the chosen activated sludge model is presented in Section 2. In Section 3, an overview of the PSO algorithm is stated.The application of the considered methods to the parameter identification problem is detailed in Section 4. Section 5 illustrates the outperformance of our method.Finally a conclusion is presented in Section 6.

Model Description
The main components of the activated sludge process are given in the simplified scheme of Figure 1 [3].This process generally incorporates two tanks: a biological reactor and a clarifier.Coming from an external source, the polluted water flows into the bioreactor where a microorganisms population is developed to degrade the organic substrate.After that, the mixed effluent will be sent to the clarifier (separator) where the clear water and the sludge are separated.A fraction of the concentrated biomass is recycled back to the aeration tank while the rest is removed.Finally the clear effluent is evacuated into the natural environment.
The bioreaction takes place essentially in the aerator which is divided into two phases alternately functioning: In the first one, entitled aerobic/nitrification stage, the oxygen is inserted into the bioreactor in order to nurture the microorganisms for the carbon and nitrite elimination.The second one consists of shutting down the aeration and a carbon source is added for the nitrogen removal.It is called anoxic/denitrification stage.The microorganisms continue consuming the dissolved oxygen that remains in the bioreactor until it is totally worn out.It is a transitional period (usually very short).It also belongs to the aerobic stage.The transition between the bioreactor's two phases includes a change of physic conditions (aeration period: oxygen transfer coefficient   ̸ = 0, anoxic period:   = 0).Therefore, the aeration procedure is considered discontinuous.
Aiming to develop a controlling procedure as well as better comprehension of the system, this latter needs to be presented by a mathematical model that describes efficiently its performance.The reference model [9,10] offers a better solution but it is far complex for the observation and control strategies and incompetent for the real time use, which leads to the search for more simple models regarding the compromise between complexity and precision of the process.
Considering the pilot unit of the ASWWTP installed in the Engineering Laboratory of Environmental Processes (ELEP) of the National Institution of Applied Sciences (NIAS) in Toulouse, France, as the studied system, this process has a low mass load and the only measurable state variables are the nitrate, the ammonium, and the oxygen which pinpoint the way to develop more reduced models.Many reductive methods have been studied and applied [34,35].One of the most known ones is the nonlinear method of regular and singular perturbations.In fact it is very simply used and provides reduced-order models while preserving the models' basic structures.Applied on the reference model, It divides its state variables into three classes: the fast (small time constant), the average, and the slow (big time constant) variables.Standing on this classification, the oxygen which presents a very important variable in the system dynamics cannot be considered as a state variable since it has a slow performance [9,10].Taking into account the unfit use of this method, the applied reduction strategy is based on some biochemical considerations (observation of variables behavior and their influence on kinetics reactions and other variables) as well as the adjustment of the reduced-order model to ensure the conservation of controllability and observability properties [9,10].

Nonlinear Model.
The obtained reduced nonlinear model encloses four state variables (the biodegradable substrate, the nitrate, the ammonium, and the oxygen) and eleven parameters which make the handling of the ASWWTP more easy [9,10,36].
It can be described by the following differential equations: where   in are the input concentrations of the state variables and   present the kinetics of the process.They can be written in these forms: ( The different variables are defined in Table 1.

Linear Model. So far, most efforts have been dedicated
to the study and the development of observation and control techniques for linear systems.Many approaches have been developed to solve a variety of automation problems not only in the theoretical perspective but also in the practical one.Nevertheless, for the nonlinear systems, the results are fewer and more difficult to implement.That is why researchers aim to develop a linear mathematical model for the activated sludge process.Despite their potential, linear models for ASWWTP are few in the literature: Anderson et al. [37] have developed a linear model composed of two submodels: one for the aerobic phase, the other for the anoxic one.It has eight state variables.Afterwards, Smets et al. [38] have offered a linear model for the ASM1 model but it is far more complicated.
The main concern in applying an analytic linearization method is to avoid the destruction of the nonlinear model structure (loss of the physical meaning of state variables).The conventional widely spread method for the linearization of models is the Taylor series expansion around a nominal point or trajectory.In the case of the considered activated sludge processes, the aerobic and anoxic phases are constantly alternating, and the nominal point (equilibrium) does not exist because the model is never in the steady state.In this way, it is more appropriate to take on the linearization around operation trajectories [10].
The linear model consists of two submodels, one for the aerobic phase and another for the anoxic phase; the switching from one model to another is ensured by means of the oxygen transfer coefficient   .This model has four state variables that are the most relevant ones in the nitrogen elimination process.It can be described by the following general equation: where    are the specific parameters of the reduced linear model. ) Toward its best performance Toward the best performance of its neighbors Toward the accessible point with its current velocity Current position

New position
Figure 2: Displacement of a particle.

Particle Swarm Optimization
The PSO algorithm presents an efficient technique for solving optimization problems specially the problem of nondifferentiable function where it is hard to find the optimum.It is also a kind of evolutionary computation method that describes the social behavior within a swarm in nature.
The concept of PSO algorithm is a very simple one.The PSO conducts the problem resolution using a set of data usually chosen randomly and having a certain size called "population" (swarm) which includes the candidate solutions named "particles."These "particles" move (fly) over a multidimensional searching space to locate their best experience.Each particle is associated with a fitness value calculated by mathematical function and a velocity that rules its flying.It also has a small memory related to its best visited solution (local optimum) and the ever best visited solution by the population (global optimum) along with the capacity to communicate with the other particles (informants).Depending on the sharing information "cooperation" between the swarm particles, they will pursue a tendency: first, of their motivation to return to their optimal solution, and second, of their motivation to reach the best solutions achieved by their neighbors.So from local optima, the whole swarm of particles will eventually meet, after a certain number of iterations, the global optimal solution of the regarded problem.
Based on the shared information, a particle must decide its next move that deducts also its new velocity.The particle movement in the swarm is influenced by three components: (i) An inertial component: the particle tends to follow its current movement direction.
(ii) A memory component: the particle tends to go back to the best position it has ever visited.
(iii) A social component: the particle tends to rely on the experience of its peers and thus to head for the best position already achieved by its neighbors.
The displacement strategy of a particle is illustrated in Figure 2.
The position and the velocity of the population members are calculated by using a mathematical operator so they can be expected to head toward the best solution.The updating operation is defined as follows: where  ,  is the position of the th particle at each iteration  and for each dimension ,  ,  is the velocity of the th particle at each iteration  and for each dimension ,  presents the inertia weight generally between [0 1], and  1 and  2 are positive constant parameters usually in the range of [0 2] called acceleration coefficients and known also as the cognitive and collective parameters. 1 and  2 are random variables generated for each velocity update between [0 1].At last  ,  denotes the local best position of the th particle at each iteration  and for each dimension , and   defines the global best position at each iteration .
The PSO algorithm repeats the application of these equations until the prespecified stopping rule (often the maximum number of iterations) becomes valid.
The optimization algorithm can be described by the following flow chart of Figure 3.

Identification Methods
The identification of models that describe the biotechnological processes must take into account two important factors: the complexity of the models (high number of parameters and state variables) and the small quantity (and poor quality) of the available measures for the different variables.
The parametric identification method intends to determine the characteristic parameters of a mathematical model from a set of input-output process measures.It generally has an interactive strategy.First, it achieves the model identification using a choosing algorithm (classical or intelligent).Second, this model must be validated by checking its compatibility with other experimental frameworks.As part of our study, we are interested specifically in the offline identification.
Julien [9] and Gomez-Quintero [10] have applied an offline algorithm for the identification of their reduced models: both linear and nonlinear, entitled Simplex Search Algorithm.
This algorithm, named also the Nelder-Mead algorithm (NM), is initially suggested by Spendley, Himsworth, and Hext in 1962 and then developed by Nelder and Mead in 1965 [39].It is a well-Known classical direct search technique for multidimensional unconstrained optimization (especially minimization) scenarios.Since it does not need any derivatives calculation, it is very useful for parameters estimation and other statistical problems where the functions are nonsmooth, or with uncertain values.
This technique is totally different from the Dantzig's simplex method for linear models which solves only a constrained linear problem.It is a simple basic algorithm and quite easy to use.This method is founded on a simplex which presents a geometrical figure composed of ( + 1) points in -dimension; segments will be connecting them and then polygonal surfaces will be resulting such as a segment on a line, a triangle in two-dimensional space, a tetrahedron for three-dimensional space [40].
The NM algorithm starts not only with one point but with a set of  + 1 vertices of an initial simplex  and their corresponding function values.Then it evaluates a comparison between these values.If  0 is chosen as the initial starting point, the other points of the simplex will be generated according to the following equation: where   is the th unit vector and  is the characteristic constant of the scale problem.
The initial chosen simplex must be nondegenerate which means that all the points do not have to be in the related hyperplane.It performs a sequence of basic transformations which are reflection, contraction, expansion, and finally shrinkage.With these four operations the simplex moves and changes its form (size, shape, orientation) to approach at each iteration little by little the optimum point [41].
The main concept of parameters identification policy is to compare the real system responses with the identified model ones by using an evaluation function which gives an idea of how well the model performance can follow the real system.Thus, to handle the problem of parameters identification, this latter can be expressed as an optimization problem.
For the Nelder-Mead approach, a classical quadratic function of weighted least squares that reduces errors between the experimental values and the obtained model is chosen as the minimization criterion.
Only the specific parameters to this model   ,  = 1, . . ., 9, are selected to be identified.This choice is justified by the fact that these parameters are very influential on the model dynamics than the remaining parameters, given that they are defined specifically for this model after some consideration [10].Moreover, they do not have a precise definition in terms of variables involved in the process model that can help to determine reliable numerical values.However, the other physical parameters were kept to their standardized values of the reference model [10].
In this study the Mean Square Error (MSE) between the real and estimated responses for a given number of data is treated as the evaluating performance function (fitness) of the estimated model.This function is formalized as follows: where  = 1, . . .,  denotes the sampling time points and  presents the length of samples used for the parameters identification.  and Yes  are the real and the estimated responses of system in each sample time, respectively.Finally  presents the error between the two responses.The real data are composed of two experiments that were carried out for the ASWWTP over 6 hours and with a sampling period of 20 minutes under different aeration conditions entitled experiment 1 and experiment 2 [10,42].One of them has been chosen (experiment 2) for the identification procedure and the other for the result validation (experiment 1).The only measured state variables are as we said before,  NO 3 ,  NH 4 , and  O 2 .No measurements for the   are available.The activated sludge process is provided by wastewater from Toulouse sewer which is characterised by a low organic loading.Some of the operating conditions are detailed in Table 2 [10,36].
The slow operating mode of the nitrification/denitrification phases, characterised by a big sampling time from one to several hours, makes the identification of this process tough (limited number of real measures) which points the way to the use of the pseudomeasurements as a solution.
Since its appearance, much effort has been done to reach better convergence properties of PSO.These studies focus essentially on a better calibration of its basic control parameters, which are the inertia weigh, acceleration coefficients, and swarm size.This leads to the conclusion that the PSO is sensitive to the choice of these parameters.Wrong selection may be responsible for divergence or cyclic behavior of the algorithm.
In this section, the object is to identify the reduced linear model for the ASWWTP using PSO mechanism.
Considering its specific parameters, the following vector is formed: , where each parameter corresponds to one dimension of the problem and the whole vector corresponds to a particle of the swarm.The identification operation consists of two stages: one for aerobic phase and the other for the anoxic one using the pseudomeasurements.
Furthermore, to apply the PSO method, the lower and upper bounds of each parameter need to be defined to ensure the convergence toward the best solution along with the PSO parameters that have been chosen after many tests: number of particles = 10, number of iterations = 100,  1 and  2 ∈ [0, 1],  1 =  2 = 1.5, and  often decreases linearly from a maximum value to a minimum one usually chosen to be about 0.9 and 0.4, respectively, according to the following equation: where iter max is the maximum number of iterations and iter is the present iteration.Five runs will be performed for the algorithm and their mean values will be considered.The result will be discussed in the next part.

Simulation Result and Comparison
The simulation result of PSO algorithm will be mentioned in Table 3 along with the result of the Nelder-Mead method.These results may be also determined by using the parameters relations that link between the intermediate model (reference model) and the reduced model, so the parameters   have been calculated from the identified model parameters of the reference model [10].
According to the these results, the identified parameters with PSO approach are validated by comparing them, on the one hand, with the identified ones by NM algorithm and, on the other hand, with the calculated ones.Although their values are mismatched, they have the same numerical magnitude order; in such manner they can be all considered correct.The numerical differences between these three groups are explained by the simplifications made on the reference model for the calculated parameters and the choice of the objective function for the identified ones.An equivalent model has been obtained, although it is not identical.
After finding the value of the parameters vector , it will be used to simulate the reduced linear model of the ASWWTP.Responses of the obtained estimated system will be compared to the ones determined by the simplex method and as well as the experimental ones.The values of model parameters determined by PSO are chosen for a specified sampling time which equals 1 minute.
In order to examine the sensitivity of the PSO technique to sampling time.This method will be tested with different sampling periods:  = [1 min, 5 min, 10 min].The results are mentioned in Table 4.We can see clearly that with every different sampling time we have different identified parameters.
Figures 4, 5, and 6 present the result of experiment 2. They display the dynamics of the linear model identified by the NM method (red line), the dynamics of the linear model estimated by the PSO technique (green line), the experimental data (cross).These figures show a good agreement between the data and the two linear models, specifically the one determined by PSO because it is the most close one to the real  data despite some differences specially viewed for the oxygen concentration.
Once the model is identified, data of experiment 1 are used to validate its predictive capabilities under similar operation conditions.The result of the simulation is shown From Table 5, it is noticed that the estimated model by PSO algorithm presents a smaller error than the estimated one by simplex method when they are firstly compared with the real output values (MSE 1) and secondly with the nonlinear model outputs (MSE 2).Thus, between the estimated models our obtained one is the closest to the original nonlinear model.Finally, we conclude that the PSO algorithm is capable of presenting a mathematical model that can well imitate the dynamics of the real system.Comparing the performance of the PSO and the Nelder-Mead method shows that both of them have their benefits and shortcomings, but the PSO technique is new and fast and demands a reduced number of parameters ( 1 ,  2 , , number of particles, number of iterations), which makes its use more beneficial.

Conclusion
This contribution proposes an identification technique based on PSO algorithm for an activated sludge wastewater treatment process.It gives a view of the proposed method and proves its effectiveness by comparing its performance with the experimental measurements and also with a classical method called Nelder-Mead.Results of simulation illustrate the ability of the considered approach to estimate the model parameters and to follow the real behavior of the process better than the classical one.Thus, it provides a valuable outcome in order to be exploited for the controlling strategies.This work can be carried forward by other intelligent techniques to improve the estimated model by optimizing its parameters.

Table 4 :
Identified parameters with different sampling time.