Research on Optimization of Total Nitrogen Peak Suppression in Wastewater Treatment Based on the Data Driven Method

In order to solve the problems of water eutrophication, algae anoxic decay, and death by biological poisoning, which are caused by the excessive emission of total nitrogen in wastewater treatment process, this paper proposes a method of total nitrogen peak suppression which is based on neural network decision optimization. First, the SSORBF neural network is established according to the wastewater treatment process, and total nitrogen, infow fow, current total nitrogen, dissolved oxygen concentration, and nitrate nitrogen concentration are selected to predict the total nitrogen concentration. Second, the density-and memory-based NSGA2 multiobjective optimization method is used to set the optimal solution to meet the requirement of energy consumption. If the prediction of total nitrogen exceeded the set value, the optimal control strategy is adopted to control the peak value of total nitrogen in advance, and it cannot exceed the national maximum allowable emission value. If the prediction of total nitrogen is lower than the set value, it continues to track the parameter set value. Finally, compared with other methods, the proposed method can efectively suppress the peak value of total nitrogen under 18mg/L and reduce the energy consumption in wastewater treatment by 7.6%. It can provide decisions and advice for wastewater treatment plants.


Introduction
Total nitrogen concentration is an important indicator to measure the quality of efuent water [1][2][3].Excessive discharge of total nitrogen can cause serious consequences, such as reduced dissolved oxygen concentration in water bodies, eutrophication of water bodies, and death of organisms [4][5][6].For this issue, China stipulates the daily maximum allowable emission concentration for basic control projects of water pollutant emissions ( Table 1, 2002).Te total nitrogen level I Class A emission standard is 15 mg/L and the Class B emission standard is 20 mg/L.Strict emission standards highlight the importance China attaches to the total nitrogen emissions.Currently, the common methods to measure total nitrogen concentration in China are traditional biological denitrifcation processes, new biological denitrifcation processes, and physical and chemical processes [7][8][9].Among them, traditional biological nitrogen removal processes such as A2/O and SBR have classic process structures and high ammonia nitrogen removal rates, but they have complex operating procedures, long cycles, and high treatment costs.New biological nitrogen removal processes such as short-range biological nitrogen removal technology and synchronous digestion denitrifcation technology have good removal efects when the concentration of ammonia nitrogen wastewater is low, but they are susceptible to the impact of dissolved oxygen, pH, and other conditions.Physical and chemical methods (such as sedimentation, stripping, and adsorption) require expensive equipment and reagents, and most wastewater treatment plants cannot aford long-term treatment costs [10,11].Te above processes can efectively achieve the efective removal of ammonia nitrogen in the wastewater treatment process, but how to achieve optimal control, energy conservation, consumption reduction, and peak suppression on the premise that the efuent from the wastewater treatment process meets the standard is still a difcult problem in the current research.
Researchers have done a lot of studies on the control of key parameters in wastewater treatment processes.Stare et al. [12] proposed a simplifed nonlinear model and a linear black box model.Compared to PI controllers, the model's predictive control strategy has a good ammonia nitrogen removal efciency in the case of large errors.Vega et al. [13] proposed a hierarchical control method based on nonlinear model prediction, using a strategy of combining real-time optimization and model predictive control to achieve predictive control of dissolved oxygen and nitrate nitrogen, improving the control efect of key parameters and reducing wastewater treatment operating costs.Mulas et al. [14] proposed a multivariable controller based on a dynamic matrix control strategy to control total nitrogen concentration with the goal of minimizing economic and removal efciency.Experiments have shown that this method can simultaneously reduce energy consumption and total nitrogen concentration.Han et al. [15] proposed a data driven multiobjective predictive control method for wastewater treatment processes using data related to wastewater treatment processes.Te results show that this method can achieve good control over dissolved oxygen and nitrate nitrogen in a relatively short time.Santin et al. [16] proposed an improved fuzzy decision control method for wastewater treatment, using a fuzzy controller to control the nitrifcation and denitrifcation processes in the wastewater treatment process, achieving the goal of meeting the water quality standards and reducing operating costs while avoiding excessive emissions of ammonia nitrogen and total nitrogen.Although this method efectively inhibits the peak value of ammonia nitrogen in the efuent, there is a problem of high energy consumption.Li et al. [17] proposed an optimization method for wastewater treatment decision-making based on the NSGA2 optimization algorithm.A fxed structure neural network was used to establish a prediction model for ammonia nitrogen and total nitrogen in the efuent, and the optimization algorithm was used to optimize the set values to reduce the total nitrogen and ammonia nitrogen concentration in efuent on the premise that the water quality and energy consumption meet the standards.Although this method can efectively reduce the concentration of pollutants, there is a large computational complexity in the neural network.Inaccurate prediction results in changes in water infow parameters.In summary, for wastewater treatment systems with large time-varying, strongly coupled, and nonlinear characteristics, how to reduce energy consumption and improve removal efciency while efectively suppressing the peak value of total nitrogen in the efuent water is worth exploring.
In order to solve the problems, this paper proposes a total nitrogen peak suppression method based on neural network decision optimization control.First, this method uses the spiking self-organizing RBF neural network (SSORBF neural network) to establish a prediction model for total nitrogen in wastewater treatment, then uses a densityand memory-based NSGA2 multiobjective algorithm (NSGA2-DM) to optimize energy consumption and water quality, select the appropriate solution as the set value for dissolved oxygen and nitrate nitrogen, and fnally adopt diferent optimal suppression control strategies based on whether the predicted total nitrogen exceeds the standard.Tis method can efectively improve the prediction accuracy and adaptive ability of the network, reduce the peak value of total nitrogen in the efuent, and meet the requirements of energy conservation and consumption reduction, as well as efuent compliance.

Prediction Model
Te neural network has good nonlinear ftting ability and generalization strength.Te RBF neural network prediction model is shown in Figure 1.Te network mainly consists of an input layer, a hidden layer, and an output layer.
(1) Te output of the neurons in the input layer is , c is the center vector, and σ is the width.Where c j (t) � [c j 1 (t), c j 2 (t), . . ., c jn (t)] is the center vector of the jth neuron in the RBF layer; c ji (t) ∈ [− 2, 2] is a random value, and σ j (t) is the width of the jth node.Te maximum value of j is m, m is the number of neurons in the hidden layer, and σ j (t) ∈ [0.01, 2] is the random value within the range.
(3) Te output layer is y(t) �  m j�1 w j (t)θ j (t), w is the output weight, and y(t) is the output of the output layer at time t.Note.Te frst level standard is divided into categories A and B; the values outside the brackets for ammonia nitrogen are the control indicators when the water temperature is >12 °C, and the values inside the brackets are the control indicators when the water temperature is <12 °C.

Journal of Control Science and Engineering
In order to select the appropriate number of neurons, this paper adopts the SSORBF neural network with adaptive structural adjustment [18] and uses the biological neuron membrane potential excitation mechanism to establish a self-organized dynamic adjustment mechanism.When the peak intensity of neurons is greater than the excitation threshold, action potentials are activated and new neuronal processing tasks are added; if the spike intensity of a neuron is less than the excitation threshold, it is considered that the neuron is in an inactive state and the hidden layer neuron needs to be deleted.Te adjusted network structure is used as a model for predicting the total nitrogen output of wastewater treatment.
In this study, variance threshold [19], analysis of variance (ANOVA) [20], and mutual information (MI) [21] were used to select the feature of the data.Te concentration of total nitrogen in wastewater treatment is infuenced by many factors, such as pH, temperature, BOD, COD, ORP, dissolved oxygen concentration, total nitrogen in water, infow fow, current total nitrogen in water, nitrate nitrogen concentration, and so on.Some parameters have a signifcant impact on the total nitrogen in the efuent, while others have a smaller impact.Based on the mechanism analysis and literature research of the wastewater treatment process, fve variables with the greatest impact are selected as the input of the network: total nitrogen in water, infow fow, current total nitrogen in water, dissolved oxygen concentration, and nitrate nitrogen concentration.Te network output is the predicted value of total nitrogen concentration in water.Select the data sampled from the BSM1 experimental platform as the model training test data.Te set value of S O,5 concentration is set at 1.4-2.4mg/l, and the set value of S NO,2 concentration is set at 0.5-1.5 mg/l.Te data sampling period is 14 days and the sampling time is 15 minutes.181390 sets of data are obtained.Among them, 163251 sets of data are used as training samples, and 18139 sets of data are used as test samples [17].Using trial and error methods, the network structure is initially selected as 5-50-1, and the sample sampling normalization method is used.Te learning algorithm uses a gradient algorithm with a learning rate of 0.1, and the maximum number of learning steps is 4000.RMSE of diferent prediction models is shown in Table 2.It can be seen that the proposed method has better training RMSE and testing RMSE under the same number of neurons.

Optimization of Set Points for Wastewater Treatment Processes
From the above analysis, it can be seen that S O,5 , and S NO,2 have a direct impact on the total nitrogen concentration of the efuent, and optimizing their set points can efectively reduce energy consumption.Terefore, this article uses the establishment of energy consumption and water quality models as optimization objective functions and then uses the NSGA2-DM algorithm to optimize multiple objectives, selecting appropriate solutions as the set values for S O,5 , and S NO,2 .
According to the research background of the wastewater treatment process, energy consumption and water quality are used as the objective functions of the optimization algorithm.However, due to the complexity of wastewater treatment mechanism and many infuencing factors, this paper uses the current conventional feed-forward neural network to establish energy consumption and water quality models.Te input variables for both the energy consumption model and the water quality model are the concentration of suspended solids in the efuent, S NH,e , S O,5 , and S NO,2 [24].Data collection does not consider time delay, and data are collected every 15 minutes.Te S NO,2 concentration setting values and the S O,5 concentration setting values are selected within a range of values and experiments are conducted on the BSM1 platform.

Optimization Problem Model.
In order to establish an efective optimization model and simplify the description of the problem, F1 and F2 are selected as the energy consumption and water quality objective functions, and f1 and f2 are selected as the energy consumption and water quality models, respectively.(x 1 , x 2 ) are the dissolved oxygen concentration in the ffth zone and the nitrate nitrogen concentration in the second zone, respectively. Minimize where l i and v i are the lower and upper bounds of the ith decision variable, respectively; Δ is the penalty term for exceeding the limit; C Ntot is the predicted total nitrogen exceeding the limit in the efuent; f Ntot represents the S Ntot,e prediction model established in Section 2 of the article; and 18 is the upper limit value of S Ntot,e by the empirical method.Journal of Control Science and Engineering

Local Search.
Calculate its sparsity by assuming the target vector of the ith solution is (F 1 (X i ), F 2 (X i )).After normalization, the sparsity calculation formula for the ith solution is as follows: where W p is the number of target vectors F(X i ) in the objective function space whose Euclidean distance from the target vector is less than r, and the value range of r is 0 < r < 1.In this paper, the value is 0.1.Te sparse solution selects the nondominant solution with the smallest current sparsity, N � 100, and the number of decision variables, n � 2. Two population variation strategies are used here.First, use the limit optimization method to conduct a local search, resulting in a number of local solutions of n, and the mutation formula is as follows: where x i is a decision variable; h is a random number between 0 and 1; and q is a positive real number, called a shape parameter.In this paper, q is set to 1.1; β max (x i ) is the maximum value that can be changed for the current decision variable.
Second, in order to avoid falling into a local optimum, a random migration strategy is used for mutation operations, resulting in a local solution number of 0.2N.
where c is a random number between 0 and 1.2.Te maximum changeable value of the decision variable and the mutated solution set are n + 0.2N local solutions generated by the above two mutation strategies for the mutated decision variable.Te NSGA2-DM algorithm is based on the original genetic algorithm, and it establishes a memory bank to store the central solution and environmental variables.When the input data changes, an initial population is generated based on the memory to quickly fnd the optimal solution, reducing the amount of computation and improving the search speed.

Multiobjective Optimization and Optimal Solution
Selection.Using the NSGA2-DM algorithm to obtain multiple nondominated solutions can efectively obtain a solution set that meets the requirements of energy consumption and water quality.Te specifc process can be summarized as follows: First, initialize the population and calculate the ftness and crowding distance of all solutions in the population.Second, the optimal N solutions are obtained through cross-mutation to form the next-generation population.Finally, the optimal solution is obtained through iteration.Te obtained multiple nondominant solutions are brought into the SSORBF prediction model.If the efuent index meets the standard, select the solution with the lowest energy consumption.If the efuent index does not meet the standard, a peak suppression control strategy is adopted, and the solution with the highest water quality is selected as the set value.

Peak Suppression Control of Total Nitrogen Concentration in Effluent
Te wastewater treatment process adopts the denitrifcation process using organic compounds in the wastewater as the carbon source for the denitrifcation process, thereby eliminating the need for additional carbon sources such as methanol and acetic acid.Te peak inhibition strategy for total nitrogen in efuent is shown in Figure 2. Te biochemical reaction tank in the fgure is the secondary treatment stage in the wastewater treatment process, and tracking control mainly controls the oxygen conversion coefcient (K La5 ) and internal return fow (Q a ) in the ffth zone.Terefore, it can be seen that when the predicted values of S Ntot,e do not exceed the standard, fuzzy control rules are used to control K La5 and Q a through the error and error variation between the current concentration and the set value, respectively, to achieve tracking control of S Ntot,e .Tis article focuses on peak suppression control methods and will not do much in-depth research here.When S Ntot,e is predicted to exceed the standard, fuzzy control is performed on the frst and second zone external carbon sources (q EC1 ) and (q EC2 ) based on the predicted S Ntot values.Increasing carbon sources can promote denitrifcation and remove nitrogen.In this paper, the value range of S Ntot suppression control is 17 to 19.7 mg/L, and the value range of q EC is 4 to 6 m 3 /d.Terefore, the fuzzy rules are as follows: If (SNtot is 19.0-19.7),then (qEC1 is 5, qEC2 is 2) If (SNtot is 18.0-18.9),then (qEC1 is 4, qEC2 is 1) If (SNtot is 17.0-17.9),then (qEC1 is 4, qEC2 is 0) Switch back to fuzzy tracking control when the predicted total nitrogen in the efuent is below 17 mg/L and the total nitrogen in the ffth zone is below 13.5 mg/L.Te parameter value of 17 mg/L is obtained based on empirical methods.

Results and Discussion
Tis experiment uses BSM1 sewage treatment process parameters and verifes the efectiveness of the proposed total nitrogen suppression method through experimental analysis and simulation.Te evaluation indicators used include effuent quality (EQ), total cost (OCI) [25], and percentage of water quality exceeding the standard (P).Te specifc analysis is as follows.
Figure 3 shows the change curve of total nitrogen concentration in the efuent without the peak suppression method, and Figure 4 shows the change curve of total nitrogen concentration in the efuent with the peak suppression method.From the analysis in Figure 3, it can be seen that the efuent S Ntot,e predicted by the SSORBF neural network exceeds the upper limit value of conventional total nitrogen control by 20 mg/L at 15 h, 20 h, and 65 h and cannot meet the emission standard.Terefore, when the predicted S Ntot,e exceeds 18 mg/L, a suppression control method is used to add carbon sources in advance.Te simulation efect is shown in Figure 4, and the ammonia nitrogen concentration in the efuent does not exceed 20 mg/L, achieving the goal of eliminating the peak value.Figure 5 shows the curve diagram of the change between the set value and the actual value of dissolved oxygen concentration after adding the peak suppression method, and Figure 6 shows the curve diagram of the change between the set value and the actual value of nitrate nitrogen concentration after adding the peak suppression method.Te red curve in the fgure represents the actual value, and the blue curve represents the set value.As can be seen from Figure 5, when the predicted total nitrogen exceeds the set value, peak suppression is the main goal, so the actual value of dissolved oxygen concentration difers greatly from the set value.

Journal of Control Science and Engineering
When the total nitrogen does not exceed the set value (such as 125 h-150 h), tracking the set value is the main goal.Figure 6 refects the change curve of nitrate nitrogen concentration, which is basically the same as that described in Figure 5 and will not be described in detail.From Figures 7 and 8, it shows the control of K La5 and Q a by decision optimization control when S Ntot,e predictions do not exceed the standard.
Table 3 shows the comparison and comparison results of the proposed algorithm with Jeppsson et al. [26], Nopens et al. [27], Flores Alsina et al. [28], and Santin et al. [16].Journal of Control Science and Engineering From the table, it can be seen that the percentage of total nitrogen in efuent exceeding the standard is 0%, and compared to other control algorithms, energy consumption is signifcantly reduced and water quality is improved.Experimental simulation results verify the efectiveness of peak suppression with this method.

Conclusion
In order to solve the problem that the peak value of total nitrogen in the wastewater treatment process exceeds the standard, this paper proposes a decision optimization method for total nitrogen in wastewater treatment based on the SSORBF neural network and NSGA2-DM optimization algorithm, which can efectively inhibit the concentration of total nitrogen in wastewater while reducing energy consumption.Te specifc conclusions are as follows: (1) An optimization algorithm is used to analyze the possible peaks, and optimal decisions are made to adjust the amount of carbon sources added on the premise that the efuent meets the standard.
Trough experimental analysis and comparison with other methods, this method achieves better total nitrogen control efect, lower energy consumption, and better efuent quality in sewage treatment, meeting the national discharge standards for sewage treatment.
(2) When the predicted values of S Ntot,e do not exceed the standard, fuzzy control rules are used to control K La5 and Q a through the error and error variation between the current concentration and the set value, respectively.When the predicted values of S Ntot,e exceed the standard, fuzzy control is performed on the frst and second zone external carbon sources.
Increasing carbon sources can promote denitrifcation and remove nitrogen.
From the long-term perspective of industry development, there are still many shortcomings in wastewater treatment data analysis methods; for example, network prediction and learning algorithms can be further improved, tracking control efects can be improved when total nitrogen does not exceed the standard, and the selection of nondominant solutions and learning algorithms during optimal control still need to be improved.

Figure 1 :
Figure 1: Prediction model of total nitrogen concentration.

Figure 6 :Figure 7 :
Figure 6: Optimization and tracking results of S NO,2 .

Table 1 :
Maximum allowable emission concentration of pollutants (daily average value); unit: mg/L.

Table 3 :
Comparison of diferent algorithms.