## 3 Results and Discussion  
The algorithm was realized by the mathematical software Matlab18a which provides support for algorithm development, data visualization, data analysis, and numerical calculation and has the advantages of simple operation, convenient operation, and fast calculation speed, in which the structure of the BP neural network was 5-11-1. The maximum number of iterations was 2000, the threshold of error precision \(\varepsilon\) was 0.0001, and the learning rate \(\eta\) was 0.005. The population size was set at 50 and the number of evolutions was 200 in the PSO algorithm and GA algorithm. The learning factor \(c_{1}=c_{2}=1.49\). PH, CHLA, NH4H, BOD, and EC were used as inputs; the subsequent DO predictive values were used as the output in models. According to the steps of the neural network training algorithm model, after the prediction model is properly trained, prediction of the dissolved oxygen concentration of the Beihai Lake was possible. In order to test the algorithm's performance, the researchers compared the PSO-GA-BP neural network algorithm with the common BP neural network model, the PSO-BP neural network model, and the GA-BP neural network model. The prediction performance of the four models are shown in Figures 3 and 4, while the water quality prediction results are listed in Tables 2 and 3 as follows. Figure 3 shows the water quality prediction performance of these models intuitively, and it is easy to identify the most different time point between the predicted value and the measured value (real value). Table 2 shows the specific values of the predicted results and the observed results in time series. It can be seen in Figure 3 that the BP neural network prediction model optimized with the genetic algorithm and particle swarm optimization is much better than the traditional BP neural network prediction model. It can even be said that the BP neural network model without optimization shows poor prediction, while the curve fitting result of PSO-GA-BPNN model is the closest to that of the curve of real value. Figure 3: Comparison of predictions by the BPNN, PSO-BPNN, GA-BPNN, and PSO-GA-BPNN models. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & **Measured DO** & **BPNN** & **GA- BPNN** & **PSO- BPNN** & **PSO-GA- BPNN** \\
**Time(min)** & **(mg/L)** & **Estimated DO** & **Estimated DO** & **Estimated DO** & **Estimated DO** \\
06:38 & 3.5 & 3.319104 & 3.204458 & 3.221109 & 3.1595  
For the four models in our testing, the results of \(APE_{max}\), MAPE, RMSE, and \(R^{2}\) have been respectively shown in Table 3. One can see exactly how the model performed and the degree to which the four models differ. Figure 4 shows \(R^{2}\), the linear formula, and the linear curve. PSO-GA-BPNN shows the best prediction effect in terms of both accuracy and robustness. As can be seen from Table 3, the root mean square error mildly dropped from 1.2733, 0.7873, and 0.4019 to 0.3596; the max absolute percentage error dropped from 45.4614%, 47.5328%, and 31.7989% to 16.2661%; the mean absolute percentage error dropped from 25.1506%, 15.7102%, and 8.4506% to 6.7219%; and the coefficient of determination rose from 0.2957, 0.5333, and 0.7818 to 0.9276. PSO-GA-BP achieved the best model performance in all evaluation indices. Specifically, MAPE went up 14.4% and RMSE shrunk to a quarter of the worst result in terms of accuracy; \(APE_{max}\) went up 29.2% and \(R^{2}\) had increased by 63.2% compared with the common BP neural network model. We conclude that the model based on combined particle swarm optimization and genetic algorithm can better fit the complex dynamic nonlinear relationship between the water ecological environment factors and dissolved oxygen. Furthermore, the improved prediction results of the PSO-GA-BPNN algorithm correspond to the real observations of Beihai Lake.