Optimal Control Method for Wastewater Treatment Process based on Self-Adjusting Multi-Task Particle Swarm Optimization

20220383062 · 2022-12-01

    Inventors

    Cpc classification

    International classification

    Abstract

    An optimal control method for wastewater treatment process (WWTP) based on a self-adjusting multi-task particle swarm optimization (SA-MTPSO) algorithm belongs to the field of WWTP. To balance the relationship between the effluent water quality (EQ) and energy consumption (EC) and achieve optimization online quickly, the invention establishes a data-based multi-task optimization model for WWTP to describe the relationship between the control variables and EQ, EC. Then, the SA-MTPSO algorithm is adopted to solve the optimal set-points of the nitrate nitrogen and dissolved oxygen concentration for WWTP. The PID controller is used to track the optimal set-points, so as to reduce EC while ensuring EQ, and realize the online optimal control of WWTP.

    Claims

    1. An optimal control method for wastewater treatment process based on a self-adjusting multi-task particle swarm optimization algorithm, comprising the following steps: (1) collect the process data: the dissolved oxygen is an important indicator of the reaction nitrification process, which is mainly detected by detection instrument of dissolved oxygen; the nitrate nitrogen determines the process of denitrification rate, which is mainly detected by detection instrument of nitrate nitrogen; and the data will be transmitted to programmable logic controller by fieldbus; the programmable logic controller converts the signal into digital or analog quantity and communicates with the master computer through transmission protocol; the master computer obtains real-time data from the wastewater treatment process and stores the collected data in Structured Query Language server database; (2) design the data-based multi-task optimization model for wastewater treatment process: the multi-task optimization model for wastewater treatment process adopts data-based method to describe the relationship between optimization set-points and effluent quality, energy consumption, including the objective task model based on the kernel function and the auxiliary task model based on the polynomial regression; {circle around (1)} establish the objective task model of effluent quality and energy consumption based on the kernel function: f 1 ( t ) = B 1 ( t ) + .Math. z = 1 10 W 1 , z ( t ) H 1 , z ( t ) ( 1 ) f 2 ( t ) = B 2 ( t ) + .Math. z = 1 10 W 2 , z ( t ) H 2 , z ( t ) ( 2 ) where ƒ.sub.1(t) is the objective task model of effluent quality at time t, and ƒ.sub.2(t) is the objective task model of energy consumption at time t; B.sub.1(t) is the output offset of ƒ.sub.1(t) at time t, within [−2, 2], B.sub.2(t) is the output offset of ƒ.sub.2(t) at time t, within [−2, 2]; W.sub.1,z(t) is the weight of the zth kernel function of ƒ.sub.1(t) at time t, within [−3, 3], W.sub.2,z(t) is the weight of the zth kernel function of ƒ.sub.2(t) at time t, within [−3, 3]; H.sub.1,z(t) is the kernel functions related to ƒ.sub.1(t) for wastewater treatment process, and H.sub.2,z(t) is the kernel functions related to ƒ.sub.2(t) for wastewater treatment process:
    H.sub.1,z(t)=e.sup.−∥x(t)-c.sup.1,z.sup.(t)∥.sup.2.sup./2s.sup.1,z.sup.(t).sup.2  (3)
    H.sub.2,z(t)=e.sup.−∥x(t)-c.sup.2,z.sup.(t)∥.sup.2.sup./2s.sup.2,z.sup.(t).sup.2  (4) where x(t)=[S.sub.NO(t), S.sub.O(t)] is the input variable at time t, S.sub.NO(t) is the anaerobic end nitrate nitrogen concentration by detection instrument of dissolved oxygen at time t, within [0, 2], unit: mg/L, and S.sub.O(t) is the concentration of dissolved oxygen at the aerobic terminal by detection instrument of nitrate nitrogen at time t, within [0, 3], unit: mg/L; T is the transpose of a vector or a matrix; c.sub.1,z(t)=[c.sub.1,z,1(t), c.sub.1,z,2(t)].sup.T is the center of the zth kernel function of ƒ.sub.1(t), and the value ranges of c.sub.1,z,1(t) and c.sub.1,z,2(t) are [−1,1], c.sub.2,z(t)=[c.sub.2,z,1(t), c.sub.2,z,2(t)].sup.T is the center of the zth kernel function of ƒ.sub.2(t), and the value ranges of c.sub.2,z,1(t) and c.sub.2,z,2(t) are [−1,1]; σ.sub.1,z(t) is the width of the zth kernel function of ƒ.sub.1(t) at time t, within [0, 2], σ.sub.2,z(t) is the width of the zth kernel function of ƒ.sub.2(t) at time t, within [0, 2]; {circle around (2)} train the parameters c(t), σ(t) and W(t) of the objective task model for wastewater treatment process: c ( t + 1 ) = c ( t ) - α 1 e 1 u ( t ) c ( t ) ( 5 ) σ ( t + 1 ) = σ ( t ) - α 2 e 1 u ( t ) σ ( t ) ( 6 ) W ( t + 1 ) = W ( t ) - α 3 e 1 u ( t ) W ( t ) ( 7 ) where c(t)=[c.sub.1,z(t), c.sub.2,z(t)] is the center of the kernel function for the objective task model at time t, and c(t+1)=[c.sub.1,z(t+1), c.sub.2,z(t+1)] is the center of the kernel function for the objective task model at time (t+1); σ(t)=[σ.sub.1,z(t), σ.sub.2,z(t)] is the width of the kernel function for the objective task model at time t, and σ(t+1)=[σ.sub.1,z(t+1), σ.sub.2,z(t+1)] is the width of the kernel function for the objective task model at time (t+1); W(t)=[W.sub.1,z(t), W.sub.2,z(t)] is the weight of the kernel function for the objective task model at time t, and W(t+1)=[W.sub.1,z(t+1), W.sub.2,z(t+1)] is the weight of the kernel function for the objective task model at time (t+1); α.sub.1 is the learning rate of the kernel function center for the objective task model within [0, 1], α.sub.2 is the learning rate of the kernel function width for the objective task model within [0, 1], α.sub.3 is the learning rate of the kernel function weight for the objective task model within [0, 1]; e.sub.1u(t)=y.sub.1(t)−y.sub.u(t) is the prediction error of the objective task model at time t, y.sub.1(t)=[ƒ.sub.1(t), ƒ.sub.2(t)] is the output of the objective task model at time t, y.sub.u(t)=[EQ(t), EC(t)] is the actual output value of wastewater treatment process at time t, EQ(t) is the actual effluent quality value of wastewater treatment process at time t, EC(t) is the actual energy consumption value of wastewater treatment process at time t; {circle around (3)} establish the auxiliary task model of effluent quality and energy consumption in wastewater treatment process based on the polynomial regression: f 3 ( t ) = b 1 ( t ) + .Math. q = 0 2 A 1 , q ( t ) ( x ( t ) ) q ( 8 ) f 4 ( t ) = b 2 ( t ) + .Math. q = 0 2 A 2 , q ( t ) ( x ( t ) ) q ( 9 ) where ƒ.sub.3(t) is the auxiliary task model of effluent quality at time t, and ƒ.sub.4(t) is the auxiliary task model of energy consumption at time t; b.sub.1(t) is the output offset of ƒ.sub.3(t) at time t, within [−2, 2], b.sub.2(t) is the output offset of ƒ.sub.4(t) at time t, within [−2, 2]; A.sub.1,q(t) is the qth coefficient of ƒ.sub.3(t) at time t, within [−3, 3], A.sub.2,q(t) is the qth coefficient of ƒ.sub.4(t) at time t, within [−3, 3]; {circle around (4)} train the polynomial coefficient A(t) of the auxiliary task model for wastewater treatment process: A ( t + 1 ) = A ( t ) - α 4 e 2 u ( t ) A ( t ) ( 10 ) where A(t)=[A.sub.1,q(t), A.sub.2,q(t)] is the polynomial coefficient of the auxiliary task model for wastewater treatment process at time t, and A(t+1)=[A.sub.1,q(t+1), A.sub.2,q(t+1)] is the polynomial coefficient of the auxiliary task model for wastewater treatment process at time (t+1); α.sub.4 is the learning rate of polynomial coefficient for the auxiliary task model within [0, 1]; e.sub.2u(t)=y.sub.2(t)−y.sub.u(t) is the prediction error of the auxiliary task model at time t, and y.sub.2(t)=[ƒ.sub.3(t), ƒ.sub.4(t)] is the output of the auxiliary task model at time t; {circle around (5)} establish the multi-task optimization model for wastewater treatment process: minimize F ( t ) = [ F 1 ( t ) , F 2 ( t ) ] ( 11 ) { F 1 ( t ) = [ f 1 ( t ) , f 2 ( t ) ] F 2 ( t ) = [ f 3 ( t ) , f 4 ( t ) ] ( 12 ) where, F(t) is the multi-task optimization model of wastewater treatment process at time t, F.sub.1(t) is the objective task model of wastewater treatment process at time t, and F.sub.2(t) is the auxiliary task model of wastewater treatment process at time t; (3) solve the optimal set-points based on self-adjusting multi-task particle swarm optimization embedded in the master computer: through knowledge transfer between the objective task and the auxiliary task, the self-adjusting multi-task particle swarm optimization algorithm achieves accelerated convergence of the objective task; {circle around (1)} set the total iteration times of self-adjusting multi-task particle swarm optimization as τ.sub.max=500, the particle swarm size as N=100, the number of tasks as K=2, and initialize the external archive U(0) as empty set; {circle around (2)} the optimization objective of self-adjusting multi-task particle swarm optimization is the data-based multi-task optimization model for wastewater treatment process: min F(t)=[F.sub.1(t), F.sub.2(t)]; {circle around (3)} the position information of particles x.sub.t(τ)=[S.sub.NOt(τ), S.sub.Ot(τ)] is used as input in T iteration at time t; the fitness and skill factors of particles are calculated, and the particles are divided into different groups according to the skill factors; the fitness ranking of the particles are carried out; {circle around (4)} evaluate the validity of knowledge carried by particles: E t ( t ) = .Math. m = 1 20 ( F t m ( t ) - F _ t ( t ) ) ( g t m ( t ) - g t _ ( t ) ) s ( F t ( t ) ) s ( g t ( t ) ) ( 13 ) where E.sub.t(τ) is the knowledge validity of the τth iteration at time t, F.sup.m.sub.t(τ)=[F.sup.m.sub.1t(τ), F.sup.m.sub.2t(τ)] is the multi-task optimization fitness of the mth particle in τ iteration at time t, F.sup.m.sub.1t(τ) is the objective task fitness of the mth particle in τ iteration at time t, and F.sup.m.sub.2t(τ) is the auxiliary task fitness of the mth particle in τ iteration at time t; F.sub.t(T)=[F.sub.1t(τ), F.sub.2t(τ)] is the mean of fitness for multi-task optimization in τ iteration at time t, F.sub.1t(T) is the mean of fitness for the objective task in τ iteration at time t, F.sub.2t(τ) is the mean of fitness for the auxiliary task in τ iteration at time t; F.sub.t(τ)=[F.sub.1t(τ), F.sub.2t(τ)] is the fitness of multitask optimization in τ iteration at time t, F.sub.1t(T) is the fitness of the objective task in τ iteration at time t, F.sub.2t(τ) is the fitness of the auxiliary task in τ iteration at time t; g.sub.t(τ) is the distance between the objective task particle and the global optimal particle of the auxiliary task in τ iteration at time t, g.sup.m.sub.t(τ) is the distance between the mth objective task particle and the global optimal particle of the auxiliary task in τ iteration at time t, g.sub.t(τ) is the mean distance between the objective particle and the global optimal particle of the auxiliary task in τ iteration at time t; {circle around (5)} design the knowledge transfer strategy: p tg * ( t ) = { p tJ ( t ) E t ( t ) E t ( t - 1 ) p tJ ( t - 1 ) E t ( t ) > E t ( t - 1 ) ( 14 ) where P*.sub.tg(T)=[p*.sub.tg,1(τ), p*.sub.tg,2(τ)] is the knowledge transfer term in τ iteration at time t, P.sub.tJ(T)=[p.sub.tJ,1(τ), p.sub.tJ,2(τ)] is the global optimal solution of the auxiliary task in τ iteration at time t, P.sub.tJ(τ−1)=[p.sub.tJ,1(τ−1), p.sub.tJ,2(τ−1)] is the global optimal solution of the auxiliary task in (τ−1) iteration at time t, and J is the solution with the highest knowledge validity in the Pareto optimal solution set of the auxiliary task at time t:
    J=argmin.sub.j∈{1,2, . . . ,M}{E.sub.tj(t)}  (15) where E.sub.tj(τ) is the knowledge validity of the Jth particle in the Pareto optimal solution set of the auxiliary task in τ iteration at time t; the particle velocity update formula:
    v.sub.ti(t+1)=wv.sub.ti(t)+c.sub.1r.sub.1(p.sub.ti(t)−x.sub.ti(t))+c.sub.2r.sub.2(p.sub.tg(t)−x.sub.ti(t))+c.sub.3r.sub.3(p*.sub.tg(t)−x.sub.ti(t))  (16) where v.sub.ti(τ+1) is the velocity of the ith particle in (τ+1) iteration at time t, and v.sub.ti(τ) is the velocity of the ith particle in τ iteration at time t, x.sub.ti(τ+1) is the position of the ith particle in (τ+1) iteration at time t, and x.sub.ti(τ) is the position of the ith particle in τ iteration at time t, P.sub.ti(τ) is the individual optimal position of the ith particle in τ iteration at time t, and P.sub.tg(τ) is the global optimal position of the ith particle in τ iteration at time t; ω=0.8 is the inertia weight; c.sub.1=0.25 is the individual experience acceleration constant, c.sub.2=0.25 is the social experience acceleration constant, c.sub.3=0.25 is the knowledge transfer term acceleration constant; r.sub.1 is the individual experience random number within [0, 1], r.sub.2 is the social experience random number within [0, 1], r.sub.3 is the knowledge transfer item random number within [0, 1]; {circle around (6)} by comparing the individual optimal position P.sub.ti(τ) with the solution of the archive Φ.sub.t(τ−1) in τ iteration at time t, the archive Φ.sub.t(τ) is updated: { Φ t ( τ ) = Φ t ( τ - 1 ) .Math. P ti ( τ ) if F 1 ( φ t ( τ - .Math. ) ) .Math. F 1 ( P ti ( τ ) ) Φ t ( τ ) = Φ t ( τ - 1 ) else , .Math. = 1 , 2 , .Math. , t - 1 ( 17 ) where ∪ is logic relationship “union”, Φ.sub.t(τ−1)=[φ.sub.t(τ−1), φ.sub.t(τ−2), φ.sub.t(τ−.Math.), . . . , φ.sub.t(1)], φ.sub.t(τ−.Math.) is the .Math.th optimal solution of archives in τ iteration, F.sub.1(φ.sub.t(τ−.Math.)) is the objective tasks fitness of φ.sub.t(τ−.Math.), F.sub.1(P.sub.ti(τ)) is the objective tasks fitness of P.sub.ti(τ); {circle around (7)} judge whether to stop iteration: if the current iteration number τ≥τ.sub.max, terminate the iteration process and go to step {circle around (8)}; otherwise, the iteration number τ increases by 1 and go back to step {circle around (3)}; {circle around (8)} a solution is randomly selected from the archives Φ.sub.t(τ.sub.max) as the optimal set-points at time t u*(t)=[S*.sub.NO(t), S*.sub.O(t)], where S*.sub.NO(t) is the optimal set-point of nitrate nitrogen at time t and S*.sub.O(t) is the optimal set-point of dissolved oxygen at time t; (4) track control of the optimal set-points: the multivariable proportion integral differential controller is used to track and control the optimal set-points, and the control signal is transmitted to the programmable logic controller though Object Linking and Embedding for Process Control of communication; the analog signal is converted to digital signal through the analog digital converter; the digital signal is transferred to the frequency converter by fieldbus, to control the frequency of oxygen supply pump and reflux pump, and realize the optimal control of effluent water quality and energy consumption for wastewater treatment process; {circle around (1)} proportion integral differential controller performs tracking control on the optimal set-points S*.sub.NO(t) and S*.sub.O(t): Δ u ( t ) = K p [ e ( t ) + H l 0 t e ( t ) dt + H d de ( t ) dt ] ( 18 ) where Δu(t)=[ΔQ.sub.a(t), ΔK.sub.La(t)].sup.T is the operational variable matrix, ΔQ.sub.a(t) is the change of the circulating flow, ΔK.sub.La(t) is the change of the oxygen transfer coefficient in the fifth zone; K.sub.p is the proportional coefficient, H.sub.l is the integral coefficient, H.sub.d is the differential coefficient; e(t)=y*(t)−y(t) is control error at time t, y*(t)=[S*.sub.NO(t), S*.sub.O(t)].sup.T is the optimal set-points at time t, y(t)=[S.sub.NO(t), S.sub.O(t)].sup.T is the actual output values at time t; {circle around (2)} adjust the transfer coefficient of the dissolved oxygen and the internal return flow:
    K.sub.La(t+1)=K.sub.La(t)+ΔK.sub.La(t)  (19)
    Q.sub.a(t+1)=Q.sub.a(t)+ΔQ.sub.a(t)  (20) where K.sub.La(t+1) is the transfer coefficient of dissolved oxygen at time (t+1), K.sub.La(t) is the transfer coefficient of the dissolved oxygen at time t; Q.sub.a(t+1) is the inner return flow at time (t+1), Q.sub.a(t) is the inner return flow at time t; when the frequency of oxygen supply pump and reflux pump is adjusted by frequency converter, the concentration of nitrate nitrogen will be adjusted to S*.sub.NO(t) and the concentration of dissolved oxygen will be adjusted to S*.sub.O(t); thus, the optimal control of effluent quality and energy consumption for wastewater treatment process is realized.

    Description

    DESCRIPTION OF DRAWINGS

    [0033] FIG. 1 is the nitrate nitrogen result of the optimal control method.

    [0034] FIG. 2 is the nitrate nitrogen tracking error of the optimal control method.

    [0035] FIG. 3 is the dissolved oxygen result of the optimal control method.

    [0036] FIG. 4 is the dissolved oxygen tracking error of the optimal control method.

    DETAILED DESCRIPTION OF THE INVENTION

    [0037] (1) collect the process data: the dissolved oxygen is an important indicator of the reaction nitrification process, which is mainly detected by detection instrument of dissolved oxygen; the nitrate nitrogen determines the process of denitrification rate, which is mainly detected by detection instrument of nitrate nitrogen; and the data will be transmitted to programmable logic controller by fieldbus; the programmable logic controller converts the signal into digital or analog quantity and communicates with the master computer through transmission protocol; the master computer obtains real-time data from the wastewater treatment process and stores the collected data in Structured Query Language server database;

    [0038] (2) design the data-based multi-task optimization model for wastewater treatment process: the multi-task optimization model for wastewater treatment process adopts data-based method to describe the relationship between optimization set-points and effluent quality, energy consumption, including the objective task model based on the kernel function and the auxiliary task model based on the polynomial regression;

    [0039] {circle around (1)} establish the objective task model of effluent quality and energy consumption based on the kernel function:

    [00010] f 1 ( t ) = B 1 ( t ) + .Math. z = 1 1 0 W 1 , z ( t ) H 1 , z ( t ) ( 21 ) f 2 ( t ) = B 2 ( t ) + .Math. z = 1 1 0 W 2 , z ( t ) H 2 , z ( t ) ( 22 )

    where ƒ.sub.1(t) is the objective task model of effluent quality at time t, and ƒ.sub.2(t) is the objective task model of energy consumption at time t; B.sub.1(t) is the output offset of ƒ.sub.1(t) at time t, within [−2, 2], B.sub.1(0)=−1.01, B.sub.2(t) is the output offset of ƒ.sub.2(t) at time t, within [−2, 2], B.sub.2(0)=0.32; W.sub.1,z(t) is the weight of the zth kernel function of ƒ.sub.1(t) at time t, within [−3, 3], W.sub.1,z(0)=1.8, W.sub.2,z(t) is the weight of the zth kernel function of ƒ.sub.2(t) at time t, within [−3, 3], W.sub.2,z(0)=2.4; H.sub.1,z(t) is the kernel functions related to ƒ.sub.1(t) for wastewater treatment process, and H.sub.2,z(t) is the kernel functions related to ƒ.sub.2(t) for wastewater treatment process:


    H.sub.1,z(t)=e.sup.−∥x(t)-c.sup.1,z.sup.(t)∥.sup.2.sup./2s.sup.1,z.sup.(t).sup.2  (23)


    H.sub.2,z(t)=e.sup.−∥x(t)-c.sup.2,z.sup.(t)∥.sup.2.sup./2s.sup.2,z.sup.(t).sup.2  (24)

    where x(t)=[S.sub.NO(t), S.sub.O(t)] is the input variable at time t, S.sub.NO(t) is the anaerobic end nitrate nitrogen concentration by detection instrument of dissolved oxygen at time t, within [0, 2], unit: mg/L, and S.sub.O(t) is the concentration of dissolved oxygen at the aerobic terminal by detection instrument of nitrate nitrogen at time t, within [0, 3], unit: mg/L, S.sub.O(0)=1.5 mg/L; T is the transpose of a vector or a matrix; c.sub.1,z(t)=[c.sub.1,z,1(t), c.sub.1,z,2(t)].sup.T is the center of the zth kernel function of ƒ.sub.1(t), and the value ranges of c.sub.1,z,1(t) and c.sub.1,z,2(t) are [−1, 1], c.sub.1,z,1(0)=0.76, c.sub.1,z,2(0)=0.45, c.sub.2,z(t)=[c.sub.2,z,1(t), c.sub.2,z,2(t)].sup.T is the center of the zth kernel function of ƒ.sub.2(t), and the value ranges of c.sub.2,z,1(t) and c.sub.2,z,2(t) are [−1, 1], c.sub.2,z,1(0)=0.82, c.sub.2,z,2(0)=0.67; σ.sub.1,z(t) is the width of the zth kernel function of ƒ.sub.1(t) at time t, within [0, 2], σ.sub.1,z(0)=1.72, σ.sub.2,z(t) is the width of the zth kernel function of ƒ.sub.2(t) at time t, within [0, 2], σ.sub.2,z(0)=0.62;

    [0040] {circle around (2)} train the parameters c(t), σ(t) and W(t) of the objective task model for wastewater treatment process:

    [00011] c ( t + 1 ) = c ( t ) - α 1 e 1 u ( t ) c ( t ) ( 25 ) σ ( t + 1 ) = σ ( t ) - α 2 e 1 u ( t ) σ ( t ) ( 26 ) W ( t + 1 ) = W ( t ) - α 3 e 1 u ( t ) W ( t ) ( 27 )

    where c(t)=[c.sub.1,z(t), c.sub.2,z(t)] is the center of the kernel function for the objective task model at time t, and c(t+1)=[c.sub.1,z(t+1), c.sub.2,z(t+1)] is the center of the kernel function for the objective task model at time (t+1); σ(t)=[σ.sub.1,z(t), σ.sub.2,z(t)] is the width of the kernel function for the objective task model at time t, and σ(t+1)=[σ.sub.1,z(t+1), σ.sub.2,z(t+1)] is the width of the kernel function for the objective task model at time (t+1); W(t)=[W.sub.1,z(t), W.sub.2,z(t)] is the weight of the kernel function for the objective task model at time t, and W(t+1)=[W.sub.1,z(t+1), W.sub.2,z(t+1)] is the weight of the kernel function for the objective task model at time (t+1); α.sub.1 is the learning rate of the kernel function center for the objective task model within [0, 1], α.sub.2 is the learning rate of the kernel function width for the objective task model within [0, 1], α.sub.3 is the learning rate of the kernel function weight for the objective task model within [0, 1]; e.sub.1u(t)=y.sub.1(t)−y.sub.u(t) is the prediction error of the objective task model at time t, y.sub.1(t)=[ƒ.sub.1(t), ƒ.sub.2(t)] is the output of the objective task model at time t, y.sub.u(t)=[EQ(t), EC(t)] is the actual output value of wastewater treatment process at time t, EQ(t) is the actual effluent quality value of wastewater treatment process at time t, EC(t) is the actual energy consumption value of wastewater treatment process at time t;

    [0041] {circle around (3)} establish the auxiliary task model of effluent quality and energy consumption in wastewater treatment process based on the polynomial regression:

    [00012] f 3 ( t ) = b 1 ( t ) + .Math. q = 0 2 A 1 , q ( t ) ( x ( t ) ) q ( 28 ) f 4 ( t ) = b 2 ( t ) + .Math. q = 0 2 A 2 , q ( t ) ( x ( t ) ) q ( 29 )

    where ƒ.sub.3(t) is the auxiliary task model of effluent quality at time t, and ƒ.sub.4(t) is the auxiliary task model of energy consumption at time t; b.sub.1(t) is the output offset of ƒ.sub.3(t) at time t, within [−2, 2], b.sub.1(0)=−1.5, b.sub.2(t) is the output offset of ƒ.sub.4(t) at time t, within [−2, 2], b.sub.2(0)=−0.84; A.sub.1,q(t) is the qth coefficient of ƒ.sub.3(t) at time t, within [−3, 3], A.sub.1,q(0)=0.56, A.sub.1,q(t) is the qth coefficient of ƒ.sub.4(t) at time t, within [−3, 3], A.sub.2,q(0)=1.34;

    [0042] {circle around (4)} train the polynomial coefficient A(t) of the auxiliary task model for wastewater treatment process:

    [00013] A ( t + 1 ) = A ( t ) - α 4 e 2 u ( t ) A ( t ) ( 30 )

    where A(t)=[A.sub.1,q(t), A.sub.2,q(t)] is the polynomial coefficient of the auxiliary task model for wastewater treatment process at time t, and A(t+1)=[A.sub.1,q(t+1), A.sub.2,q(t+1)] is the polynomial coefficient of the auxiliary task model for wastewater treatment process at time (t+1); α.sub.4 is the learning rate of polynomial coefficient for the auxiliary task model within [0, 1]; e.sub.2u(t)=y.sub.2(t)−y.sub.u(t) is the prediction error of the auxiliary task model at time t, and y.sub.2(t)=[ƒ.sub.3(t), ƒ.sub.4(t)] is the output of the auxiliary task model at time t;

    [0043] {circle around (5)} establish the multi-task optimization model for wastewater treatment process:

    [00014] minimize F ( t ) = [ F 1 ( t ) , F 2 ( t ) ] ( 31 ) { F 1 ( t ) = [ f 1 ( t ) , f 2 ( t ) ] F 2 ( t ) = [ f 3 ( t ) , f 4 ( t ) ] ( 32 )

    where, F(t) is the multi-task optimization model of wastewater treatment process at time t, F.sub.1(t) is the objective task model of wastewater treatment process at time t, and F.sub.2(t) is the auxiliary task model of wastewater treatment process at time t;

    [0044] (3) solve the optimal set-points based on self-adjusting multi-task particle swarm optimization embedded in the master computer: through knowledge transfer between the objective task and the auxiliary task, the self-adjusting multi-task particle swarm optimization algorithm achieves accelerated convergence of the objective task;

    [0045] {circle around (1)} set the total iteration times of self-adjusting multi-task particle swarm optimization as τ.sub.max=500, the particle swarm size as N=100, the number of tasks as K=2, and initialize the external archive U(0) as empty set;

    [0046] {circle around (2)} the optimization objective of self-adjusting multi-task particle swarm optimization is the data-based multi-task optimization model for wastewater treatment process: min F(t)=[F.sub.1(t), F.sub.2(t)];

    [0047] {circle around (3)} in τ iteration at time t, the position information of particles x.sub.t(τ)=[S.sub.NOt(τ), S.sub.Ot(τ)] is used as input; the fitness and skill factors of particles are calculated, and the particles are divided into different groups according to the skill factors; the fitness ranking of the particles are carried out;

    [0048] {circle around (4)} evaluate the validity of knowledge carried by particles:

    [00015] E t ( t ) = .Math. m = 1 20 ( F t m ( t ) - F _ t ( t ) ) ( g t m ( t ) - g t _ ( t ) ) s ( F t ( t ) ) s ( g t ( t ) ) ( 33 )

    where E.sub.t(τ) is the knowledge validity of the τth iteration at time t, F.sup.m.sub.t(τ)=[F.sup.m.sub.1t(τ), F.sup.m.sub.2t(τ)] is the multi-task optimization fitness of the mth particle in τ iteration at time t, F.sup.m.sub.1t(τ) is the objective task fitness of the mth particle in τ iteration at time t, and F.sup.m.sub.2t(τ) is the auxiliary task fitness of the mth particle in τ iteration at time t; F.sub.t(τ)=[F.sub.1t(τ), F.sub.2t(τ)] is the mean of fitness for multi-task optimization in τ iteration at time t, F.sub.1t(t) is the mean of fitness for the objective task in τ iteration at time t, F.sub.2t(τ) is the mean of fitness for the auxiliary task in τ iteration at time t; F.sub.t(τ)=[F.sub.1t(τ), F.sub.2t(τ)] is the fitness of multitask optimization in τ iteration at time t, F.sub.1t(τ) is the fitness of the objective task in τ iteration at time t, F.sub.2t(τ) is the fitness of the auxiliary task in τ iteration at time t; g.sub.t(τ) is the distance between the objective task particle and the global optimal particle of the auxiliary task in τ iteration at time t, g.sup.m.sub.t(τ) is the distance between the mth objective task particle and the global optimal particle of the auxiliary task in τ iteration at time t, g.sub.t(τ) is the mean distance between the objective particle and the global optimal particle of the auxiliary task in τ iteration at time t;

    [0049] {circle around (5)} design the knowledge transfer strategy:

    [00016] p tg * ( t ) = { p tJ ( t ) E t ( t ) E t ( t - 1 ) p tJ ( t - 1 ) E t ( t ) > E t ( t - 1 ) ( 34 )

    where P*.sub.tg(τ)=[p*.sub.tg,1(τ), p*.sub.tg,2(τ)] is the knowledge transfer term in τ iteration at time t, P.sub.tJ(τ)=[p.sub.tJ,1(τ), p.sub.tJ,2(τ)] is the global optimal solution of the auxiliary task in τ iteration at time t, P.sub.tJ(τ−1)=[p.sub.tJ,1(τ−1), p.sub.tJ,2(τ−1)] is the global optimal solution of the auxiliary task in (τ−1) iteration at time t, and J is the solution with the highest knowledge validity in the Pareto optimal solution set of the auxiliary task at time t:


    J=argmin.sub.j∈{1,2, . . . ,M}{E.sub.tj(t)}  (35)

    where E.sub.tj(τ) is the knowledge validity of the Jth particle in the Pareto optimal solution set of the auxiliary task in τ iteration at time t;

    [0050] the particle velocity update formula:


    v.sub.ti(t+1)=wv.sub.ti(t)+c.sub.1r.sub.1(p.sub.ti(t)−x.sub.ti(t))+c.sub.2r.sub.2(p.sub.tg(t)−x.sub.ti(t))+c.sub.3r.sub.3(p*.sub.tg(t)−x.sub.ti(t))  (36)

    where v.sub.ti(τ+1) is the velocity of the ith particle in (τ+1) iteration at time t, and v.sub.ti(τ) is the velocity of the ith particle in τ iteration at time t, x.sub.ti(τ+1) is the position of the ith particle in (τ+1) iteration at time t, and x.sub.ti(τ) is the position of the ith particle in τ iteration at time t, P.sub.ti(τ) is the individual optimal position of the ith particle in τ iteration at time t, and P.sub.tg(τ) is the global optimal position of the ith particle in τ iteration at time t; ω=0.8 is the inertia weight; c.sub.1=0.25 is the individual experience acceleration constant, c.sub.2=0.25 is the social experience acceleration constant, c.sub.3=0.25 is the knowledge transfer term acceleration constant; r.sub.1 is the individual experience random number within [0, 1], r.sub.2 is the social experience random number within [0, 1], r.sub.3 is the knowledge transfer item random number within [0, 1];

    [0051] {circle around (6)} by comparing the individual optimal position P.sub.ti(τ) in τ iteration at time t with the solution of the archive Φ.sub.t(τ−1) in τ iteration at time t, the archive Φ.sub.t(τ) is updated:

    [00017] { Φ t ( τ ) = Φ t ( τ - 1 ) .Math. P ti ( τ ) if F 1 ( φ t ( τ - .Math. ) ) .Math. F 1 ( P ti ( τ ) ) Φ t ( τ ) = Φ t ( τ - 1 ) else , .Math. = 1 , 2 , .Math. , t - 1 ( 37 )

    where ∪ is logic relationship “union”, Φ.sub.t(τ−1)=[φ.sub.t(τ−1), φ.sub.t(τ−2), φ.sub.t(τ−.Math.), . . . , φ.sub.t(1)], φ.sub.t(τ−1) is the ith optimal solution of archives in τ iteration, F.sub.1(φ.sub.t(τ−.Math.)) is the objective tasks fitness of φ.sub.t(τ−.Math.), F.sub.1(P.sub.ti(τ)) is the objective tasks fitness of P.sub.ti(τ);

    [0052] {circle around (7)} judge whether to stop iteration: if the current iteration number τ≥τ.sub.max, terminate the iteration process and go to step {circle around (8)}; otherwise, the iteration number τ increases by 1 and go back to step {circle around (3)};

    [0053] {circle around (8)} a solution is randomly selected from the archives Φ.sub.t(τ.sub.max) as the optimal set-points at time t u*(t)=[S*.sub.NO(t), S*.sub.O(t)], where S*.sub.NO(t) is the optimal set-point of nitrate nitrogen at time t and S*.sub.O(t) is the optimal set-point of dissolved oxygen at time t;

    [0054] (4) tracking control of the optimal set-points: the multivariable proportion integral differential controller is used to track and control the optimal set-points, and the control signal is transmitted to the programmable logic controller though Object Linking and Embedding for Process Control of communication; the analog signal is converted to digital signal through the analog digital converter; the digital signal is transferred to the frequency converter by fieldbus, to control the frequency of oxygen supply pump and reflux pump, and realize the optimal control of effluent water quality and energy consumption for wastewater treatment process;

    [0055] {circle around (1)} PID controller performs tracking control on the optimal set-points S*.sub.NO(t) and S*.sub.O(t):

    [00018] Δ u ( t ) = K p [ e ( t ) + H l 0 t e ( t ) dt + H d de ( t ) dt ] ( 38 )

    where Δu(t)=[ΔQ.sub.a(t), ΔK.sub.La(t)].sup.T is the operational variable matrix, ΔQ.sub.a(t) is the change of the circulating flow, ΔK.sub.La(t) is the change of the oxygen transfer coefficient in the fifth zone; K.sub.p is the proportional coefficient, H.sub.l is the integral coefficient, H.sub.d is the differential coefficient; e(t)=y*(t)−y(t) is control error at time t, y*(t)=[S*.sub.NO(t), S*.sub.O(t)].sup.T is the optimal set-points at time t, y(t)=[S.sub.NO(t), S.sub.O(t)].sup.T is the actual output values at time t;

    [0056] {circle around (2)} adjust the transfer coefficient of the dissolved oxygen and the internal return flow:


    K.sub.La(t+1)=K.sub.La(t)+ΔK.sub.La(t)  (39)


    Q.sub.a(t+1)=Q.sub.a(t)+ΔQ.sub.a(t)  (40)

    where K.sub.La(t+1) is the transfer coefficient of dissolved oxygen at time (t+1), K.sub.La(t) is the transfer coefficient of the dissolved oxygen at time t; Q.sub.a(t+1) is the inner return flow at time (t+1), Q.sub.a(t) is the inner return flow at time t; when the frequency of oxygen supply pump and reflux pump is adjusted by frequency converter, the concentration of nitrate nitrogen will be adjusted to S*.sub.NO(t) and the concentration of dissolved oxygen will be adjusted to S*.sub.O(t); thus, the optimal control of effluent quality and energy consumption for wastewater treatment process is realized.

    [0057] An optimal control system for wastewater treatment process based on self-adjusting multi-task particle swarm optimization algorithm outputs the concentrations of nitrate nitrogen and dissolved oxygen. FIG. 1 shows nitrate nitrogen results, where the solid line is the optimal set-point and the dotted line is the actual output value. X-axis: time, in days, Y-axis: nitrate nitrogen concentration, in mg/L. FIG. 2 is the nitrate nitrogen tracking error. X-axis: time, in days, Y-axis: nitrate nitrogen tracking error, in mg/L. FIG. 3 is the dissolved oxygen result, where the solid line is the optimal set-point and the dotted line is the actual output value. X-axis: time, in days, and Y-axis: dissolved oxygen concentration, in mg/L. FIG. 4 is the dissolved oxygen tracking error. X-axis: time, in days, Y-axis: dissolved oxygen tracking error, in mg/L.