Multivariate control based on recurrent wavelet neural network for wastewater treatment process Authors: Yu Fang, Yin Su, You Li Published: 2026 ABSTRACT The wastewater treatment process (WWTP), including multiple biochemical reactions, is a coupled and dynamic process. Thus, it is a challenge to achieve precise control of the WWTP. In order to address this issue, the self-organizing recurrent wavelet neural network controllers combined with the input mechanism (ISRWNNs) are proposed. First, the joint input mechanism is established for the coupling of dissolved oxygen (DO) and nitrate nitrogen (NO). Unlike the common multi-controller, the input of the proposed method takes into account both DO and NO errors to solve the coupling problem. Then, the self-organization algorithm of controller is proposed to automatically adjust the structure of the controllers for the dynamicity of WWTP. Furthermore, the stability of ISRWNN is analyzed through the Lyapunov stability theorem. Finally, the experimental results show that the proposed ISRWNN can obtain good control results of WWTP. 1. Introduction Water pollution has become a major water environmental problem in the past decade. The wastewater treatment process (WWTP), which can improve water quality and save water resources [1], has become an important means to solve the water pollution problems. The main features of WWTP are as follows:1) The mechanism is complex, and it is difficult to establish the accurate kinetic model [2]. And the influent flow and components are easily affected by geographic and weather conditions, showing strong nonlinearity and dynamic characteristics. 2) The WWTP has multiple biochemical reaction processes, which are interrelated [3], leading to strong coupling problems between different control loops. When the control variables of one control loop change, it is easy to cause the other control variable to change. Then the smoothness of the control system is limited. Therefore, achieving stable and accurate control of the WWTP is still a difficult problem. Due to the complex mechanism of WWTP, it is difficult to achieve the desired control performance by traditional control methods. To address this problem, some intelligent control methods have been proposed [4–8]. For example, the boundary-based predictive controller was proposed to keep the dissolved oxygen (DO) concentration in the activated sludge unit within the desired range [9]. The simulation results demonstrate that compared with the conventional on-off controller, the proposed controller can obtain superior control performance and stability when the system is disturbed. Chistiakova et al. designed a combined feedback and feedforward aeration controller to control DO to solve the time delay of WWTP [10]. In [11], the radial basis function (RBF) neural network controller was used to control the DO concentration to deal with the uncertainty of WWTP. Based on the RBF neural network, Han et al. developed the model predictive control (MPC) for DO concentration [12]. Compared to traditional feed-forward and PID control methods, the results show that intelligent methods have better control performance of DO. However, several unit processes and control parameters are contained in WWTP, which is a typical multivariable control system [13,14]. Since the WWTP is a typical multivariate process, these univariate control methods, which only consider DO, cannot guarantee the stable operation of the WWTP. To solve the problem of univariate controller, some multivariate control methods have been designed for WWTP [15,16]. For instance, the MPC control combining two self-organizing RBF neural networks was proposed to control DO and nitrate nitrogen (NO) in the WWTP [17]. Based on MPC, Vege et al. proposed the combination of real-time optimization and MPC to control WWTP to improve effluent quality [18]. In [19], to control the activated sludge process, the recurrent neural network controllers were employed. The experimental results show that the proposed method can ensure the precision of control while reducing the energy cost, as well as reducing the nitrate concentration. Moreover, some other methods have been used for multivariate control in WWTP [20,21]. Among these methods, multi-neural network (NN) control can achieve accurate control of WWTP due to its powerful self-learning capability [22–24]. However, the structure of the controllers is fixed and difficult to adapt to different operating conditions. To deal with the problem of fixed structure of NN controllers, which will affect the control performance, the self-constructing NN controller was designed for nonlinear system [25]. The controller incorporates the self-organization mechanism based on the mutual information to improve the control performance, which can automatically adjust the structure of controller. Wang et al. [26] used the self-organizing fuzzy NN control for uncertainty and unknown disturbances to improve the control accuracy of surface vehicles. The results prove that the adjustment mechanism of controller structure can adapt to the dynamic changes of the system and obtain superior control effects. However, the multi-NN controllers do not consider the coupling problem of the system [27,28]. Each control loop is independent, but the variables can affect each other, thus affecting the control performance of the system. Based on the above analysis and discussion, the objective is to enhance the control performance of WWTP with respect to its dynamic characteristics and coupling problem. The recurrent wavelet neural network (RWNN), as a recurrent neural network which also combines the ability of wavelet analysis, can effectively improve the control accuracy of the network. Therefore, the RWNN is chosen as the controller in this paper. In the practical setting, the controllers with fixed structure are difficult to adapt to dynamically changing wastewater treatment process. Furthermore, the coupling between variables in WWTP will affect the performance of the controller. To solve these problems, the self-organizing RWNNs combined with an input mechanism (ISRWNNs) are designed to control the WWTP. The major benefits are as follows, The input mechanism is designed to solve the coupling problem of WWTP. Unlike the input which only considers the error of a single variable, the input of ISRWNN considers the error of multiple variables and the variation of error. The input mechanism is designed to solve the coupling problem of WWTP. Unlike the input which only considers the error of a single variable, the input of ISRWNN considers the error of multiple variables and the variation of error. Unlike controller with a fixed structure, the online self-organization algorithm is proposed based on the firing strength of wavelet neurons to deal with the dynamicity of WWTP. Then, the structure determination of ISRWNNs can be realized by automatically adjusting the number of wavelet nodes. Unlike controller with a fixed structure, the online self-organization algorithm is proposed based on the firing strength of wavelet neurons to deal with the dynamicity of WWTP. Then, the structure determination of ISRWNNs can be realized by automatically adjusting the number of wavelet nodes. The stability of ISRWNNs when the structure is fixed and changed is guaranteed by the Lyapunov stability theorem respectively to ensure the practical application of controller. The stability of ISRWNNs when the structure is fixed and changed is guaranteed by the Lyapunov stability theorem respectively to ensure the practical application of controller. Based on the benchmark simulation model no. 1 (BSM1) simulation platform, the control performance of ISRWNs is verified by comparing with other control methods. Experimental results show that the proposed ISRWNNs controller can effectively solve the problem of multivariate coupling in WWTP, and at the same time, the control accuracy can be improved. Based on the benchmark simulation model no. 1 (BSM1) simulation platform, the control performance of ISRWNs is verified by comparing with other control methods. Experimental results show that the proposed ISRWNNs controller can effectively solve the problem of multivariate coupling in WWTP, and at the same time, the control accuracy can be improved. The rest of this paper is organized as follows. Section 2 gives the details of the WWTP. In Section 3, the control method is presented. Experiment results are displayed in Section 4. Finally, Section 5 gives some conclusions. 2. WWTP The municipal wastewater treatment process is shown in Fig 1, which is mainly divided into two parts: the biochemical reaction tank and the secondary settling tank. In the secondary sedimentation tank, part of the biological denitrification of the wastewater is precipitated. In the biochemical reaction tank, a variety of biochemical reactions are carried out, with nitrification and denitrification reactions as the core processes. Among them, the concentration of DO plays an important role in the nitrification reaction; the NO has a significant impact on the rate of the denitrification reaction. In addition, too high or too low concentration of DO in the aerobic tank can inhibit the denitrification reaction and thus affect NO concentration. Low NO concentration can lead to an increase in aerobic tank aeration. It is indicated that there is a coupling between DO and NO. Therefore, how to achieve multivariate control of DO and NO and design controllers with decoupling performance are important to improve the efficiency of WWTP. The model of WWTP. According to WWTP, the kinetic model of DO and NO is where Qa is the internal return flow of the second tank, Qr and Q0 are the sludge return flow and inlet flow, Zk, Vk, rk are the component concentration, volume and flow of the kth tank respectively, Qk, So,k and KLak are the flow, DO concentration and oxygen conversion coefficient of the kth reaction tank respectively, So,sat is the saturated concentration of DO. According to (1) and the mechanisms of nitrification and denitrifications reactions, the NO concentration depends on Qa and the DO concentration depends on KLak. Therefore, the KLa5 and Qa are chosen as the operating variables for the DO of fifth tank and NO of second tank. 3. The SRWNN controller combined with the input mechanism The control methods is proposed in this section for WWTP, as shown in Fig 2. In the conventional multi-controllers, the coupling between variables is not considered and therefore the control accuracy is limited. To solve this problem, a control strategy combined with input mechanisms is introduced firstly, which improves the input of the controller by considering the error of multiple variables. Furthermore, the self-organizing algorithm is proposed to automatically adjust the structure of the controllers to adapt to different conditions of WWTP. The parameter learning algorithm is also presented. Finally, the stability proof of ISRWNN controller is given. ISRWNNs control for WWTP. 3.1 Control strategy The structure of the ISRWNN controllers is shown in Fig 3. Suppose that there are n input neurons, mk wavelet nodes and 1 output in the kth ISRWNN controller. Then the input vector of each ISRWNN controller is The structure of kth ISRWNN. where eDO(t)=SDO,set−SDO and eNO(t)=SNO,set−SNO are the errors of the DO and NO, SDO,set and SNO,set are the set-point of DO and NO, SDO and SNO are the value of DO and NO concentration at time t, respectively.ΔeDO(t) and ΔeNO(t) are the variation of error. The errors of DO and NO are incorporated into the inputs of both controllers. The NO concentration error is used to preemptively adjust the DO controller output to counteract the coupling effect from the NO loop to the DO loop. Conversely, the DO error similarly compensates the NO control action. This bidirectional compensation is realized through a decoupling network integrated into the ISRWNN framework, which dynamically adjusts control signals based on real-time error variations. From a control theory viewpoint, the decoupling is achieved through coupling error compensation embedded in the multi-variable input structure. Specifically, each controller is designed not only to track its own reference but also to actively compensate for the coupling effects originating from other input variables. This is realized by constructing a set of compensating signals that cancel the interaction terms in the system dynamics [29–31]. Then the operating variables KLa5(t) and Qa(t) can be calculated as where ΔKLa5(t)=y1(t) and ΔQa(t)=y2(t) are the outputs of the two ISRWNN controllers, respectively. Furthermore, the ΔKLa5(t) and ΔQa(t) are the variation of KLa5(t) and Qa(t). For the kth controller, the expression is as follows. where wk,j0(t) is the output weight of the jth wavelet node, aik(t) is the input weight of ith input neuron, xi(t) is the ith input at time t, uk,j(3)(t) is the output of jth wavelet node which can be calculated as where ui,jk(t) is the output of the mother wavelet neuron at time t, bi,jk(t) and ci,jk(t) are the translation and dilation coefficient respectively, wj,ik(t) is the weight of the feedback loop, ui,jk(t−1) is the output of the mother wavelet neuron at time (t-1),. Remark 1. Different with the conventional multi-controller methods, the input of the proposed ISRWNN controller considers both DO and NO errors. Compared with considering only the error of the single variable, it can effectively improve the decoupling ability of the controller. 3.2. Structure adjustment mechanism In neural network control, the selection of appropriate network structure is an important issue, which will affect the control performance. Therefore, the growing and pruning mechanism of wavelet base is proposed to automatically determine the structure of the controller for different operating conditions. The firing strength of the wavelet neuron serves as the precise quantitative measure of the alignment between input signals and the localized features encoded by wavelet nodes [30]. Compared to other abstract internal signals, the firing strength offers superior interpretability. Moreover, due to the localized response characteristics of wavelet functions, only a small subset of nodes is significantly activated when processing specific inputs. This inherent sparsity enables rapid and accurate identification of both critical and redundant nodes, thereby substantially improving the computational efficiency of structural self-adaptation. Consequently, leveraging firing strength to guide the structural evolution of ISRWNN not only enhances the transparency and trustworthiness of the network but also ensures its simplicity and efficiency during dynamic learning. The expression of firing strength is shown as follows. where uk,j(3)(t) is the output of jth wavelet node of kth controller. Then, the structure adjustment algorithm is introduced as follows. 1) Growing Phase: In the growing phase, the neural network generates new nodes to make full use of the effective wavelet base. The new wavelet neuron is added when the ratio of the firing strength meets the following requirements where Pk,max is the threshold of kth ISRWNN during the growing phase. The initial parameters of newly added wavelet node are set as where dk(t) is the desired output, uk,m+1(3)(t) is the output of (m + 1)th neuron, {r1,r2,r3} are randomly selected from the range of [−1, 1]. 2) Pruning Phase: In the pruning phase, the redundant nodes will be removed. The lth wavelet node will be deleted if the following condition is satisfied where Pk,min is the pruning threshold of the kth controller. If the lth wavelet neuron is deleted, the output weight of the l′th wavelet node with the shortest Euclidean distance from the lth neuron will be adjusted as follow. where wk,l′0(t) and uk,l′(3)(t) are the output weight and output of the l′th wavelet node before deleting, wk,l0(t) and uk,l(3)(t) are the output weight and output of the lth wavelet node before pruning, wk,l′0′(t) is the output weight of the l′th wavelet node after deleting. Remark 2. Two ISRWNN controllers are independent of each other, and the structure adjustment is carried out simultaneously. Through the self-organizing algorithm, the controllers can automatically adjust their structures for different input conditions to further improve the control performance. 3.3. Parameter learning mechanism The controller based on an offline parameter training algorithm is difficult to adapt to real-time changes in WWTP. Thus, the parameters of ISRWNN are updated online based on the gradient descent method. The cost function of the controller is set as where ek(t) is the error of kth controller. For brevity, Ω(t) is used to denote the ensemble of parameters, i.e., Ωk(t)=[wj,ik,bj,ik,cj,ik,wk,j0,aik]. Then the parameters can be learned as follows. where λk=[λ1,k,λ2,k,λ3,k,λ4,k,λ5,k] are the adaptive learning rates, which are expressed as follows. where α is the coefficient with value in the range (0,2/5), η is a positive number close to 0. 3.3 Control process of WWTP For a clearer representation, the specific control process of WWTP is shown in Table 1. During the control process, the parameters are continuously learned to achieve the control accuracy requirements. On the other hand, according to the structure adjustment algorithm, the wavelet bases can be added and removed to obtain the appropriate ISRWNN structure. 10.1371/journal.pone.0348671.t001Table 1The control process of WWTP.Initialization: Initialize two ISRWNN controllers with hidden nodes as 5, the parameters of controllers Ωk(t). Set the parameters Pk,max, Pk,min, α and η.for t=1:tmax Calculate the outputs of ISRWNN ΔKLa5(t) and ΔQa(t) Update Ω1(t) and Ω2(t) Calculate the Dk,j and Pk,j of wavelet neuron If the Pk,j satisfies (9) Add one new wavelet neuron with initial parameters as (10) If the Pk,j satisfies (11) Delete the neuron and adjust the parameters of its nearest wavelet neuron as shown in (12)EndEnd The control process of WWTP. 3.4 Stability analysis In the design of the control system, the stability of the controller is very important for practical applications. Therefore, the stability of the ISRWNN controller will be verified in terms of both fixed and changed structures. Although the wastewater treatment process itself is continuous in nature, the control signals are sampled and updated at discrete time instants due to the digital implementation of the ISRWNN controller. Therefore, the closed-loop system should be treated as a sampled-data system, and its stability analysis is conducted within a discrete-time framework. Theorem 1. Assume that the number of wavelet nodes of the ISRWNNs controller is m1 and m2 respectively, and the adaptive learning rates of the parameter learning algorithm are set to (15). If the regulation parameter α of λk satisfies the following condition Then the stability of the fixed structure ISRWNN controllers can be guaranteed. Proof. Consider the Lyapunov function of the control system at time t with fixed structure as where e1(t) and e2(t) are the control errors of the ISRWNNs controller, respectively. Then the change in (17) is According to [32], the difference of control error can be expressed by Based on (14) and (15), since (∂ek(t)∂Ωk(t))T(∂ek(t)∂Ωk(t))>0, and η is a positive number close to 0, we have Then (20) can be substituted into (18), it has Based on (17), we can obtain that V(t)>0. Therefore, when 0<α<2/5, substituting into (21), it has 0