全文HTML
1 支持向量回归机与粒子群优化算法
1.1 支持向量回归机
y(x)=wTφ(x)+b | (1) |
min12wTw+γl∑i=1(ξi+ξ∗i)s.t.{wTφ(xi)+b−yi≤ε+ξi(i=1,2,⋯,l)yi−(wTφ(xi)+b)≤ε+ξi(i=1,2,⋯,l)ξi,ξ∗i≥0(i=1,2,⋯,l) | (2) |
maxα,α∗L=−12l∑i=1l∑j=1(αi−α∗i)(αj−α∗i)K(xi,xj)−εl∑i=1(αi+α∗i)+l∑i=1yi(αi−α∗i)s.t.{l∑i=1(αi−α∗i)=00≤αi≤C0≤α∗i≤C | (3) |
f(x)=∑(αi−α∗i)K(xi,x)+b | (4) |
K(xi,x)=exp(−|x−xi|22σ2) | (5) |
1.2 粒子群优化算法
{νk+1ij=w⋅νkij+r1⋅c1⋅(pij−xkij)+r2⋅c2⋅(pgj−xkij)xk+iij=xkij+νk+1ij | (6) |
2 基于PSO-SVR的污水处理厂出水总氮浓度预测模型建模
2.1 模型输入输出变量的选取
2.2 数据的获取与处理
xi=xi−min(xi)max(xi)−min(xi) | (7) |
Table 1 Operational data from a WWTP in Beijing from 2013 to 2014
Table 1 Operational data from a WWTP in Beijing from 2013 to 2014
日期 | Qin/ (104m3) |
T/℃ | BODin/ (mg·L-1) |
CODin/ (mg·L-1) |
TNin/ (mg·L-1) |
NH3-Nin/ (mg·L-1) |
MLSS/ (mg·L-1) |
MLVSS/ (mg·L-1) |
TNout/ (mg·L-1) |
2013-01 | 1 303.2 | 14.8 | 182 | 408 | 49.8 | 39.4 | 4 996.2 | 2 757.1 | 27.10 |
2013-02 | 1 124.5 | 14.9 | 178 | 421 | 49.6 | 39.1 | 4 965.9 | 2 427.7 | 28.00 |
2013-03 | 1 279.5 | 15.7 | 172 | 421 | 49.6 | 39.1 | 5 365.8 | 2 776.2 | 29.00 |
2013-04 | 1 268.5 | 17.1 | 176 | 419 | 52.0 | 41.0 | 5 134.6 | 2 785.8 | 27.10 |
2013-05 | 1 267.9 | 21.0 | 212 | 468 | 52.7 | 41.3 | 4 814.4 | 2 383.7 | 26.70 |
2013-06 | 1 343.1 | 23.0 | 220 | 486 | 49.3 | 37.5 | 4 578.3 | 2 070.1 | 26.16 |
2013-07 | 1 615.0 | 24.9 | 170 | 410 | 42.0 | 32.6 | 4 046.4 | 2 109.0 | 25.10 |
2013-08 | 1 587.1 | 25.2 | 158 | 385 | 45.8 | 34.8 | 3 293.2 | 2 041.0 | 23.50 |
2013-09 | 1 495.4 | 24.7 | 172 | 385 | 45.7 | 35.3 | 3 179.4 | 2 041.2 | 25.20 |
2013-10 | 1 498.0 | 24.2 | 193 | 430 | 51.7 | 39.9 | 3 312.8 | 2 219.8 | 27.87 |
2013-11 | 1 395.6 | 20.4 | 170 | 369 | 55.1 | 43.4 | 3 556.9 | 2 503.1 | 29.50 |
2013-12 | 1 452.3 | 17.2 | 191 | 417 | 54.0 | 43.2 | 4 132.7 | 3 236.7 | 29.80 |
2014-01 | 1 337.2 | 16.2 | 200 | 440 | 54.4 | 43.4 | 4 114.8 | 3 111.0 | 28.81 |
2014-02 | 1 226.7 | 15.9 | 192 | 381 | 51.7 | 41.7 | 3 894.5 | 2 838.6 | 30.20 |
2014-03 | 1 278.4 | 17.1 | 212 | 444 | 57.1 | 45.9 | 3 981.9 | 2 885.2 | 28.51 |
2014-04 | 1 293.1 | 19.1 | 234 | 479 | 55.8 | 44.3 | 3 546.0 | 2 483.7 | 28.79 |
2014-05 | 1 441.4 | 20.4 | 204 | 452 | 51.7 | 40.5 | 4 126.9 | 2 676.2 | 25.90 |
2014-06 | 1 397.9 | 21.6 | 176 | 420 | 47.3 | 36.1 | 3 857.7 | 2 398.1 | 26.12 |
2014-07 | 1 480.4 | 25.6 | 178 | 405 | 47.4 | 36.5 | 3 562.6 | 2 132.6 | 25.52 |
2014-08 | 1 519.3 | 25.7 | 138 | 284 | 46.3 | 35.3 | 2 850.4 | 1 865.2 | 25.49 |
2014-09 | 1 412.0 | 23.4 | 135 | 285 | 47.0 | 36.1 | 2 805.8 | 2 037.8 | 24.50 |
2014-10 | 1 394.7 | 22.2 | 166 | 336 | 50.9 | 39.1 | 2 941.1 | 2 095.6 | 26.30 |
2014-11 | 1 392.1 | 20.8 | 170 | 358 | 49.5 | 38.2 | 3 415.5 | 2 492.7 | 27.08 |
2014-12 | 1 351.0 | 16.9 | 183 | 393 | 50.3 | 39.0 | 3 758.6 | 2 654.9 | 27.30 |
2.3 模型的构建过程
Fig. 1 Flow chart of SVR parameters optimization based on PSO

2.4 模型回归效果评价
MRE=1nn∑i=1|yi−ˆyi| | (8) |
RMSE=√(1n)n∑i=1(yi−ˆyi)2 | (9) |
R2=(nn∑i=1yiˆyi−n∑i=1yin∑i=1ˆyi)2(nn∑i=1y2i−(n∑i=1yi)2)(nn∑i=1ˆy2i−(n∑i=1ˆyi)2) | (10) |
3 结果与讨论
3.1 模型参数确定
Fig. 2 Fitness change curve of parameters optimizing based on PSO

3.2 污水处理厂出水总氮浓度预测
Fig. 3 Curve fitting results of real and predicted value among training set

Table 2 Real and PSO-SVR prediction values of effluent TN of WWTP
Table 2 Real and PSO-SVR prediction values of effluent TN of WWTP
日期 | 实际值/(mg·L-1) | 预测值/(mg·L-1) | 绝对误差/(mg·L-1) | 相对误差/% |
2014-07 | 25.52 | 25.76 | 0.24 | 0.94 |
2014-08 | 25.49 | 25.45 | 0.04 | 0.157 |
2014-09 | 24.50 | 26.07 | 1.57 | 6.408 |
2014-10 | 26.30 | 26.75 | 0.45 | 1.711 |
2014-11 | 27.08 | 26.98 | 0.10 | 0.369 |
2014-12 | 27.30 | 27.69 | 0.39 | 1.429 |
3.3 模型比较
Fig. 4 Forecasting results of PSO-SVR, MLR and BP-ANN

Table 3 Precision comparison of forecast results for three models
Table 3 Precision comparison of forecast results for three models
模型 | 平均相对误差/% | 决定系数 R2 |
均方根误差 RMSE |
多元线性回归 | 2.815 | 28.31 | 1.093 5 |
BP神经网络 | 5.973 | 2.66 | 2.023 1 |
PSO-SVR | 1.836 | 67.76 | 0.693 9 |