Multimodal Control by Variable-Structure Neural Network Modeling for Coagulant Dosing in Water Purification Process

Stochastic neural network has the characteristics of good global convergence and fast gradient-based learning ability. It can be applied to multidimensional nonlinear systems, but its generalization ability is poor. In this paper, combined with rule base, through the PCA method, an improved multimodal variable-structure random-vector neural network algorithm (MM-P-VSRVNN) is proposed for coagulant dosing, which is a key production process in water purification process. Ensuring for qualified water, how to control coagulation dosage effectively, obtain valid production cost, and increase more profits is a focus in the water treatment plan. Different with the normal neural network mode, PCA is used to optimize hidden-layer nodes and update the neural network structure at every computation. This method rectifies coagulant dosage effectively while keeping valid coagulation performance. By the way, the MM-P-VSRVNN algorithm can decrease computation time and avoid overfitting learning ability. Finally, the method is proved feasible through the experiment and analyzed by the simulation result.


Introduction
In water purification process, one important point is coagulant dosing. e effect of coagulation is to make dosage mixed with colloidal particles and tiny suspended solids in raw water, subsided in live embodiment of the amorphous substance in the coagulation and sedimentation tank. Coagulant dosing is a complex, physical, and chemical process with time-varied, delay, and nonlinear characteristics. In addition, there are still many actual factors, such as pH value, turbidity, water flow rate, and coagulation dosage that affect coagulation performance. In many references about coagulant dosing, most water plants take two methods, namely, manual dosing and automatic dosing. Manual dosing mostly depends on workers' experience that is an obvious openloop control method. It is difficult to save cost effectively. e second is automatic dosing; its control method is related with actual waterworks technology. ere is still no uniform control method. Currently, PID control and feedforward control are commonly used, but some water plants still work in manual dosing. Take a water plant in Changsha as an example. Its coagulation effect takes about 90 minutes of delay, and the turbidity after coagulation, named turbidity before filtration, is generally about 5 NTU or less. And the most important thing is that the water plants are still in manual dosing that needs more workers to work by turns. e above being concerned, how to complete coagulant dosing automatically is a hot problem. At present, the automatic control of coagulant dosing mainly adopts a singlefactor closed-loop method, which needs to change the method from traditional PID control to intelligent control for complex control objects [1,2]. Researchers take some predictors to finish coagulant dosing with different manufacturing techniques. Some people try to find a mathematical model of coagulant dosing, as shown in [3][4][5][6][7]. In [3], based on the iterative feedback tuning (IFT), combined with Smith predictive control, a data-driven direct control method is proposed that need not understand the actual time-delay object model. It can initialize the controller and take online self-tuning. In [4], after studying coagulant dosing process in water plants, a feedforward and feedback control method combined with the generalized predictive control (GPC) and PID is proposed for dosing. In [5], a twostage control structure is designed for dosage target calculation and dynamic optimization of the coagulant dosing system. e model predictive control (MPC), a bounder control method, requires less information of the controlled object and proves its validity by simulation. In [6], this paper focuses on analyzing the structure and principle of coagulant dosing and uses predictive autodisturbance rejection control (PADRC) to design an online self-tuning dosing controller. In [7], a multimodal control strategy is proposed based on artificial intelligence, which simulates actual operation without any manual control and ensures the effect of coagulant dosing. Coagulant dosage mainly depends on the accuracy of the computation outcome of the system's mathematical mode. So, modeling accurately is the most difficult to realize the target here.
With the development of the artificial neural network (ANN), it provides another data-driven solution without any mathematical model for such a nonlinear system. Commonly used ANN also includes the radial basis function (RGF) neural network, backpropagation (BP) neural network, cerebella model control articulation (CMCA) neural network, and self-organizing neural network. Some people have applied these types of feedforward neural networks in coagulant dosing, as shown in [8][9][10][11]. In [8], a predictive control strategy is proposed for coagulant dosing in wastewater treatment process, an adaptive neural network model is established to analyze the relationship between dosage and detergency, and it is optimized by the gradient descent method. In [9], a RBF neural network predictor with a feedforward compensation is proposed. For a single-input and single-output system, a nonlinear autoregressive moving average model is built up and predicted for coagulant dosing. In [10] after analyzing the characters of raw water and finding out related factors of coagulant dosing, a feedforward controller is designed combined with the CMAC neural network and fuzzy algorithm, and offline modeling is finished in order to realize online optimization and predict coagulant dosage. In [11], a neural network and an adaptive fuzzy model are established to simulate the coagulant dosing process. Finally, simulation is proved valid. Take the neural network model is feasible that has a lower request, self-learning ability, and generalization ability. is method can be applied to complex industry process without building an accurate mathematical model [12]. However, those mentioned gradient-learning algorithms have an obvious problem: overfitting ability and local optimum. So, it is little difficult to design a specific neural network structure which is invariant with lower flexibility.
For improving the neural network, currently, randomvector neural networks have been developed rapidly in recent years because of their learning speed and generalization ability better than traditional neural network algorithms [13,14]. In many applications, random-vector neural networks are also used in nonlinear complex systems and verified effectively [15][16][17][18]. As we know, water purification itself is a nonlinear complex industrial process; for the dynamic mechanism of coagulant dosing is complex, the internal state is unclear. If we need to find the functional relationship between input and output factors about coagulant dosing, it is very hard to do well in setting up a mathematical model. In this paper, we select a water plant in Changsha as the target and analyze its coagulant dosing process and related factors. Considering the difficulty of building up the neural network model, we propose a variable-structure random-vector neural network (VS-RVNN) model for online learning for optimization of coagulant dosage.

Analysis and Modeling for Coagulation
Dosing Process

Analysis for Coagulation Dosing
Process. e water purification process mainly includes drug administration, coagulation-sedimentation, filtration, and chlorine disinfection. Each subprocess is independent and related to each other. e coagulation process is composed of data sampler, controller, coagulation-sedimentation tank, and execution equipment. Taking a water plant in Changsha as an example, its process is shown in Figure 1.
When raw water passes through the water pump room, its turbidity and flow velocity are measured before the coagulation tank. In addition, after the coagulant and running water are mixed in an appropriate proportion, the mixture enters the coagulation tank by the dosing pump and performs coagulation reaction with raw water. e coagulant dosing will take effects after about 90 minutes, meaning a long-delay process. At the outlet of the tank, turbidity is measured one more time and judged whether its values reach set values or not. e key point is that necessary data are sampled by equipment, computed by the controller, and an optimum coagulant for dosing pump operation is obtained. Pump adjusts its speed and opening to optimize online coagulant dosage. As we know, coagulant dosing process is complicated, varied, and nonlinear, with long delay. It cannot find the direct relationship between input and output information. So, it is not easy to establish a correct mathematical model.

Modeling and Control for Coagulant Dosing Process.
ere are three common modeling methods at current, namely, mechanism model, knowledge-based model, and data-driven model. Firstly, the mechanism model depends too much on the system internal mechanism. However, a system becomes more nonlinear and strong coupling than before; its interior mechanism is complicated and cannot be shown obviously and clearly by formula. Secondly, the knowledge-based model mostly relies on limited expert knowledge with poor adaptability. Lastly, the data-driven model need not know what system's inner state is; however, it still can predict and give a reasonable decision by a lot of data analyses and intelligent deduction. After analyzing the three methods, establishing a data-driven model has become one powerful method for a complex system in recent years. Neural network model (NNM) is one of them that can deal 2 Complexity with inaccurate and complicated information of the complex system [19][20][21]. In the paper, coagulant dosing process is just such a type without analyzing its mechanism, collecting insufficient and inaccurate expert knowledge. However, coagulant dosing process runs independently; its necessary parameters can be measured and monitored. Taking a water plant in Changsha as an example, water supply varies in different seasons and at different times of a day. Especially at rush hour, water supply must increase sharply. en, coagulant dosage will be predicted appropriately in advance. Furthermore, there are two main problems about the target water plant at current. One is that it still takes simple manual dosing. e other problem is that system delay is a little long, and working condition is changeable. So, only one simple NNM cannot work useful with abrupt events. rough local investigation, we gather related data and get to a conclusion: turbidity, flow velocity, working pumps affect coagulation obviously. Other parameters such as pH and water temperature also affect coagulation slowly. How to control coagulant dosage is a concerned topic. It satisfies turbidity while decreasing production cost as much as possible. To sum up, aiming at the actual object, a nonlinear autoregressive multimode (NARM) is set up as follows: ...
where historical data are also concerned. A multimodal function is provided in formula (1).
. . , f i (.) are different respective nonlinear relations between input parameters and output parameters at different modes. Combining with NARM, for solving the above two problems concerned in this paper, we design a multimodal control scheme, as shown in Figure 2.
In the control scheme, rule base (RB) just contains a lot of dosing parameters and several modal decision rules. e most important focus is the variable-structure randomweight neural network (VS-RVNN). It can build up variablestructure NN which can optimize its model and onlinecompute the optimum dosage. RB will provide suitable operational parameters for the dosing pump. All data will be stored in a database after one computation is completed. According to the analysis for related factors of coagulant dosing in this part, RB will make a decision by systems' operating state, select the most suitable mode, and rectify existed rules. e neural network controller updates the target value and training data set, varies the computation model, calculates optimum dosage, and keeps continuous cycle operation. e whole control method mainly combines RB and VS-RVNN and designs a MM-P-VSRVNN algorithm. e design is figured out in Figures 3 and 4.
In Figure 3, about RB, we set multiple modes and design a mode switcher.
rough the main influencing factors which have been defined, a series of decision rules are constructed and categorized into the designed mode. ese rules are also the criterion of judgement for the switching mode. Furthermore, in each mode, there are some typical control rules about water pump control parameters. e selected control rule will be connected to the ANN controller as a guideline for further optimization.
In Figure 4, we design an initial NNM which has an initial value of hidden-layer nodes in the leftmost. When real-time data are sampled, NNM judges working mode once again and takes a new computation after retraining the neural network with the corresponding training data, and the hidden-layer nodes decrease from L to Ki by PCA (when mode � i, i � 1, . . . , n), and the structure of the neural network is updated for real-time computation. is means NNM will have n-type structures after the PCA dimension.
Notation: here, NNM, proposed in Figure 4, has a variable structure. Because the number of hidden-layer nodes is always a key point for modeling, here, NNM is not fixed when we perform principal component analysis (PCA) for hidden-layer nodes. So, NNM has a variable structure at each computation.
is method can effectively solve the

MM-P-VSRVNN Algorithm
Combining with Section 2.2, the whole algorithm mainly includes two parts, namely, modal switching and dimensionality reduction by PCA. e prediction algorithm is executed by the MM-P-VSRVNN. It takes two stages: offline modeling and online optimization.
Here, the whole algorithm steps are as follows: Before computation, we choose a multimodal data set for training samples: And each mode has its independent data subset Z i | when mode � i in it.
(i) Step 1: sample real-time data, and judge the working mode by RB. For example, if mode � i, it gives a decision for NNM and switches to the ith control strategy. (ii) Step 2: build up a VS-RVNN with a random layer (L nodes) and an output layer (N nodes). e initial value of L is set to 60. e random layer can be constructed by the hidden layer and input layer.
(iii) Step 3: take the corresponding data subset of training samples for NNM. en, the functional of the random layer is defined as x 1 , . . . , x N | θ 1 , . . . , θ N } when mode � k. en, the function of the random layer is defined as where ω j � (ω j1 , ω j2 , . . . , ω jn ) is the input weight of the jth hidden-layer node, b j is the threshold value of the jth hidden-layer node, θ j � ω ω j j is the random-weight vector of the hidden-layer nodes, and x i (i � 1, 2, . . . , N) is the input to the network. (iv) Step 4: set the training target, and start to train the NNM with the given data subset. (v) Step 5: let G h � g j (x i , θ j ). Repeat to run step 4 until training meets the given target. Otherwise, it restarts at step 2 and computes once again.   Complexity characteristics. Next, continue to standardize G. en, the standardized matrix is G, and find its correlation coefficient matrix S, which meets its mean value per column which is 0 and standard deviation which is 1: where r ij represents the correlation coefficient between variable i and variable j. After that, the eigenvalue decomposition of S is done, eigenvalues λ 1 , . . . , λ L and eigenvectors of S are computed, and these eigenvalues are sorted by size.
which is based on its corresponding d eigenvectors, and the random-layer matrix G is met and satisfies the equality G � GP.
(ix) Step 9: input the latest collected samples into NNM, and calculate the function value of each outputlayer node f l � β j g j (x i , θ j ), 1 ≤ l ≤ N. All necessary data are stored.    Complexity (xii) Step 12: wait for the next sampling, and repeat the work from steps 1 to 11. Notation: compared with the traditional RVNN, RS-RVNN can perform mode switching and train the original neural network with the corresponding data set and system's control state. e output matrix of the hidden layer is obtained through multiple training times and can be reduced dimensionally by PCA. e neural network structure can be optimized under different modalities to ensure the system's continuous stability. Furthermore, the neural network controller implements dynamic optimization of the variable structure every time. Network training is performed during mode switching, and it enhances the flexibility of the controller.

Experiment Results and Discussion
In this paper, we analyze the actual water purification process of Changsha's water plant. is plant was built up as a two-phase project, which mainly has two storage tanks, alum tanks, coagulation tanks, and pump workshop for capacity expansion. And now, one of them is working. e water purification process with related parameters is shown timely and stored in the system database. Its coagulant dosing system is shown in Figure 5. rough these data provided by applied instruments and electromechanical equipment, we choose the important factors related to coagulation efficiency: turbidity before filtration (NTU), turbidity of raw water (NTU), discharge of water (m 3 /h), water temperature (°C), frequency (Hz), pH, pump stroke (percent), target turbidity (NTU), historical data of turbidity (NTU), water flow rate (m 3 /h), and coagulant dosing (m 3 /h). ese are prepared for building up a NNM. Two of them, target turbidity (NTU) and prediction value of coagulant dosing (m 3 /h), are output targets of the NNM. From parts 2 and 3, the number of hidden-layer nodes cannot be determined. In our NNM, we set an initial value (60) for hidden-layer nodes, which can be decreased by PCA. en, the structure of the NNM is optimized, and the prediction for coagulant dosage is obtained. A new NNM is named P-VSRVNN.
Coagulant dosing process contains 3 working modes. In this experiment, we select 1000 groups of data. Among them, 960-group data are divided into 3 subsets for training
(1) As NARM is described, building a valid optimized VSRVNN is a key work. It mainly computes node contribution about 95 percent, retains the corresponding nodes, and avoids overfitting learning. VSRVNN is constructed offline with updated training set by PCA, which reduces 60 original hidden-layer nodes to k i when it works in the ith mode. 40 groups of dimension reduction for the testing set are listed in Table 1. Table 1 shows us that the structure of the VSRVNN is variable at different modes. Even at the same mode, optimized result may not be the same. e value of k is changed from 7 to 9, and 8 is the majority. Taking one computation as   : Prediction output for turbidity before filtration with four different algorithms. 8 Complexity an example, the first eight principal components' analysis outcomes are shown in Table 2. e first eight principal components' effects are added to more than 95 percent, which are displayed on the VSRVNN. Because its training set changes after one computation, the optimized result is also varied but still meets 95 percent node contribution. (2) For checking the validity of the VSRVNN, we program an algorithm named MM-P-VSRVNN. And contrasting its predicted results to actual values, the total 40 points are shown in Figures 6 and 7.
Two parameters are compared in separated figures. Real line labeled as "•" symbol is the actual dosage, and the other line labeled as "∘" is the predicted dosage. In this test, predicted dosage varies around the actual value and remains consistent with its tendency. Average predicted dosage is reduced about 0.4165 percent in Figure 6; meanwhile, average predicted turbidity increases about 0.5 percent in Figure 7. e simulation result is acceptable for enterprise. To them, it already meets needs of water purification process, reduces total coagulant dosage and saves manufacturing cost to a certain extent. (3) A further test is to analyze the performance of the MM-P-VSRVNN in contrast with other three similar algorithms. Other similar algorithms are single-modal random-vector neural network (SM-RVNN), SM-RVNN after dimension reduction (SM-P-RVNN), and multimodal random-vector neural network (MM-RVNN). All predictive results are in contrast, visually, as shown in Figures 8 and 9.
On the contrary, all the algorithms are in contrast with their statistical parameters, separately named root mean    Tables 3 and 4. ese four aforementioned algorithms used the same data set and original mode. In Figure 6, the method provided in this paper has better result accuracy and tendency. It proves that, after quantitative computation, MM-P-VSRVNN can optimize the neural network mode and classify the operating mode that led to a better prediction.
(4) For improving the generalization ability of the MM-P-VSRVNN, NNM takes a new computation once a new group of data is measured. en, NNM is optimized again because hidden-layer nodes vary. Now, for a further check, the next experiment changes the hidden-layer node number from 1 to 20 and computes RMSE for different algorithms. And these results are compared with those provided by the MM-P-VSRVNN in Figures 10 and 11.
In Figures 10 and 11, MM-P-VSRVNN provided in the paper has lower RMSE and better generalization ability, which can avoid the overfitting problem when the neural network is operating.
Notation: with all the experiments, as we know, the number of hidden-layer nodes takes a new update when a new computation occurs, computation mode is optimized, and the system provides a suitable result. By the way, this computation for RMSE is also operated until hidden-layer nodes increased to 300 one by one, but we found the operating time is too long, and the contrast result is indistinct. erefore, considering the known information, we set the maximum number as 20.

Conclusion
is paper aims at coagulant dosing in water purification process for a water plant in Changsha. After analyzing the actual process and previous control modes, we put up a NNM and applied a new MM-P-VSRVNN algorithm for dosage prediction. is NNM is optimized by the MM-P-VSRVNN algorithm and gives an appropriate control result to perform a new dynamic dosing. At last, we also perform a series of experiments with the designed NNM and its algorithm to prove the practicability. e algorithm provides an improved method, and the coagulant dosing control realizes automatically.

Data Availability
All the data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare no conflicts of interest.