Study on Coagulant Dosing Control System of Micro Vortex Water Treatment

In view of the characteristics of nonlinearity, large time delay and multi disturbance in the process of coagulant dosing in water treatment, it is difficult to control the dosage of coagulant. According to the four indexes of raw water quality parameters (raw water flow, turbidity, pH value) and turbidity of sedimentation tank, the micro vortex coagulation dosing control model is constructed based on BP neural network and GA. The forecast results of BP neural network model are ideal, and after the optimization of GA, the prediction accuracy of the model is partly improved. The prediction error of the optimized network is ±0.5 mg/L, and has a better performance than non-optimized network.


Introduction
Coagulation is one of the most important water treatment process in water treatment, and the coagulation effect will have a direct impact on the subsequent water treatment process and final effluent water quality [1]. The coagulation process is a nonlinear, large time delay and multi disturbance process with many influencing factors, such as the characteristics of raw water quality (including raw water flow, turbidity, pH, temperature, alkalinity, etc.), coagulant types and dosage, etc.. When the type of coagulant is settled, controlling the dosage of coagulant accurately will have a great impact on the water treatment effect and economic benefit.
If the dosage of coagulant is too low, it is not enough to agglomerate colloidal particles in water. Consequently, it is difficult to obtain better coagulation sedimentation effect, which may affect the subsequent water treatment process, so that the effluent water quality cannot reach the standard. On the contrary, if the dosage of coagulant is too high, the floc with good settling property will be formed in the process, and the "colloid protection phenomenon" may occur, which will make the coagulation effect worse [2]. Therefore, when excess coagulants are added, it will not only affect the coagulation effect, but also waste the medicine so as to increasing the water production cost. In the process of water treatment, it is necessary to adopt proper method to control the dosage of coagulant accurately in the most appropriate range, and it can not only ensure the quality of the effluent, but also save the cost.
With the development of water treatment technology, many different coagulant dosing control methods have been formed, including jar test method, simulated sedimentation tank method, mathematical model method, and single factor control method, etc [3,4].The single factor control method is widely used at present [5,6], such as Streaming Current Detector, Transmittance Fluctuation Detection Equipment, Flocculation Control Device, Floc Velocity Detector, etc. The basic principle of all the above devices is the method of single factor control. However, due to relying on the single index of the coagulation process to reflect the coagulation effect, the lack of prediction accuracy and other issues were gradually exposed in the application process [7,8]. This paper studies the control model of coagulant in the process of micro vortex water purification basing on BP neural network and GA, and the research results are of great significance for water making enterprises to reduce the cost of water production and improve the economic and social benefits of enterprises.

Micro vortex water purification process
The micro vortex water purification process is shown in Fig 1, the raw water is raised to the pipeline by elevator pump. Meanwhile, the coagulant is added into the elevated raw water by dosing pump, and the two form miscible liquids. Subsequently, the mixture enters the vortex clarifier with the function of coagulation and sedimentation, and after these two processes, the effluent water is obtained.

Test Methods
The experimental raw water was taken from the Kong-mu Lake of East China Jiaotong University. The micro vortex coagulation water purification test was carried out to obtain a certain amount of data. On this foundation, the relationship among raw water flow, raw water turbidity, pH value, effluent turbidity of sedimentation tank and coagulant dosage is studied, and the coagulant dosing control system is eventually constructed.

Basic principle of BP neural network
Back Propagation(BP) [9] neural network is a multi-layer forward network, composed of input layer, hidden layer and output layer, and between adjacent layers are connected by the connection weights. Besides, the output of each layer serves as the input of the next layer, and there is no coupling between adjacent layer nodes. The schematic diagram of the BP neural network is shown in  predicted output value and the actual value of the neural network is minimized, when the learning effect is good, the prediction accuracy of BP neural network will be better.

The characteristics of BP neural network
BP neural network adopts the method of information parallel distribution processing, and also has better error-accepting, self-learning, self-organizing and self-adaptive ability [11]. Hence, the BP neural network can be trained and learned to perfect its functions constantly so as to adapting to different environments. Therefore, BP neural network has enormous advantages in solving nonlinear complex problems. However, in the application process, BP neural network has gradually exposed the problems such as slow learning speed, low convergence efficiency, sometimes even falling into local extreme value, leading to network training failure and other issues [12,13]. In order to improve these problems, it is often necessary to optimize it.

Construction of coagulant dosing control model based on BP neural network
The transfer functions among the input layers and the hidden layers of the BP neural network model are tangent S type function named Logsig, and the output layers transfer functions are linear function named Purelin. Besides, the function called Trainglm which is contained in BP algorithm is selected to be the training function. There are 4 inputs and 1 output in the network, and 9 neurons in the hidden layer. 200 groups of data are used to train and learn the constructed network, and the 20 groups of data are used to verify the training effect. The code is written and run by MATLAB, and the output results are shown in Fig. 3 and Fig. 4. Fig. 4 prediction error graph of BP network By comparing the predictive output of BP network and the desired value(actual value) of test data, it can be known that the two curves are generally in good agreement. However, it is not difficult to see that the error at some points is larger, which illustrates that the structure of BP neural network construction still exists some shortcomings. Moreover, it also implies that the prediction accuracy and stability should be further improved. In order to express the prediction effect of BP neural network more clearly, the prediction error graph of BP neural network is given. As is shown in Fig. 4, the prediction error of BP neural network is ±2mg/L, and most errors fluctuated in the range of ±1mg/L, and only a few samples has small error, which is ±0.5mg/L. In other words, the prediction error of BP neural network is relatively large for most samples, so it is necessary to optimize it. Genetic Algorithm(GA) [14] is a random search optimization algorithm, which is based on the natural selection and genetic mechanism of natural biological evolution process, namely "survival of the fittest" mechanism. Traditional search algorithms rely on gradient information to optimize, and show some limitations in the process of solving nonlinear complex problems. Differently with the traditional search algorithm, in the process of problem optimization, the GA makes use of the prepared objective function to describe the problem, then according to the natural selection and genetic mechanism of the biological world, the optimal solution of the problem is obtained from the global space.

Optimization of BP neural network based on GA
As a result of the fact that the gradient descent method has a bad effect on the connection weights and thresholds adjustment in the network, there is considerable error in the BP neural network coagulant dosing control model. In this paper, the BP neural network is optimized by GA, which is actually optimizing its connection weights and thresholds so as to minimizing the error of predicted value and expected value (actual value). The process of the GA is to choose the excellent individuals with the greatest fitness to breed the next generations. In contrast to GA, the objective function of BP neural network is a minimization problem. BP neural network takes the mean square deviation between actual output and expected output as the index to evaluate network training and learning degree. When the mean square deviation is better, it means that the training effect is better, and the prediction effect will be better. Therefore, the reciprocal of the mean square error of the BP neural network is used as the fitness function of the GA to measure the superiority of the individual so as to finding the optimal solution of the function and achieving the purpose of optimizing the BP network.

Construction of coagulant dosing control system based on BP neural network optimized by GA
GA uses real encoding. The length of the chromo is the total number of connection of the neural networks. The parameter setting of the population size is 20, and the number of iterations is 30. After the encoding is completed, the program is executed by MATLAB. The output results are shown in Fig.  5 and Fig. 6. As is shown in Fig. 5, the coagulant dosage curve predicted by BP neural network optimized by GA is in good agreement with the actual dosage curve, and they are almost overlapped. It indicates that GA has a very good positive effect on the optimization of BP neural network, and the optimized BP neural network has better prediction accuracy and prediction stability than the non-optimized BP neural network. It can be seen from Fig. 6 that the prediction error of BP neural network optimized by GA is ±0.5mg/L, and the fluctuation range of most part points is between ± 0.25mg/L. Besides, there is no point where the error is quite obvious. The error curve is more stable than that of BP neural network before optimization. Therefore, BP neural network combined with GA not only greatly improved the prediction accuracy of BP neural network, but also enhanced the stability of the prediction results of the network. In short, the optimized BP neural network has better performance than the non-optimized BP neural network.

Conclusion
Based on BP neural network, the control system of micro vortex coagulation is constructed, and then the network is optimized by GA. The results show that the optimization effect is obvious, it's not only improved the prediction accuracy of BP neural network, but also enhanced the stability of the prediction result. The prediction error of the optimized network is ±0.5mg/L, and has better performance than non-optimized network.