<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article">
 <front>
  <journal-meta>
   <journal-id journal-id-type="publisher-id">
    ojmsi
   </journal-id>
   <journal-title-group>
    <journal-title>
     Open Journal of Modelling and Simulation
    </journal-title>
   </journal-title-group>
   <issn pub-type="epub">
    2327-4018
   </issn>
   <issn publication-format="print">
    2327-4026
   </issn>
   <publisher>
    <publisher-name>
     Scientific Research Publishing
    </publisher-name>
   </publisher>
  </journal-meta>
  <article-meta>
   <article-id pub-id-type="doi">
    10.4236/ojmsi.2024.124008
   </article-id>
   <article-id pub-id-type="publisher-id">
    ojmsi-136703
   </article-id>
   <article-categories>
    <subj-group subj-group-type="heading">
     <subject>
      Articles
     </subject>
    </subj-group>
    <subj-group subj-group-type="Discipline-v2">
     <subject>
      Physics 
     </subject>
     <subject>
       Mathematics
     </subject>
    </subj-group>
   </article-categories>
   <title-group>
    Prediction and Analysis of Total Nitrogen in a Sewage Treatment Plant Effluent
   </title-group>
   <contrib-group>
    <contrib contrib-type="author" xlink:type="simple">
     <name name-style="western">
      <surname>
       Kemeng
      </surname>
      <given-names>
       Xue
      </given-names>
     </name>
    </contrib>
   </contrib-group> 
   <aff id="affnull">
    <addr-line>
     aBeijing No.4 High School, Xicheng District, Beijing, China
    </addr-line> 
   </aff> 
   <pub-date pub-type="epub">
    <day>
     21
    </day> 
    <month>
     10
    </month>
    <year>
     2024
    </year>
   </pub-date> 
   <volume>
    12
   </volume> 
   <issue>
    04
   </issue>
   <fpage>
    114
   </fpage>
   <lpage>
    129
   </lpage>
   <history>
    <date date-type="received">
     <day>
      17,
     </day>
     <month>
      September
     </month>
     <year>
      2024
     </year>
    </date>
    <date date-type="published">
     <day>
      18,
     </day>
     <month>
      September
     </month>
     <year>
      2024
     </year> 
    </date> 
    <date date-type="accepted">
     <day>
      18,
     </day>
     <month>
      October
     </month>
     <year>
      2024
     </year> 
    </date>
   </history>
   <permissions>
    <copyright-statement>
     © Copyright 2014 by authors and Scientific Research Publishing Inc. 
    </copyright-statement>
    <copyright-year>
     2014
    </copyright-year>
    <license>
     <license-p>
      This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/
     </license-p>
    </license>
   </permissions>
   <abstract>
    Total nitrogen was an important indicator for characterizing eutrophication of polluted water. Although the use of water quality online monitoring instrument can monitor water quality changes in real time, the degree of intelligence was low, so it was urgent to predict the water quality and take precautions in advance. A predictive model for total nitrogen levels in a sewage treatment plant utilizing the Anaerobic-Anoxic-Oxic (AAO) process was investigated in this paper. This model demonstrated significant practical application value. Based on the ARIMA (Autoregressive Integrated Moving Average) model and taking into account the impact of Biochemical Oxygen Demand (BOD), a prediction model for effluent total nitrogen was developed. However, the initial results exhibited significant deviations. To address this issue, seasonal factors were further considered. Then, the dataset was divided into winter and Non-winter sub-samples, leading to a reconstruction of the prediction model. Additionally, in developing the Non-winter prediction model, life cycle considerations were incorporated, and consequently, a SARIMA (Seasonal Autoregressive Integrated Moving Average) model was established. The predicting deviation associated with both the winter and Non-winter forecasting models showed a significant reduction.
   </abstract>
   <kwd-group> 
    <kwd>
     Total Nitrogen
    </kwd> 
    <kwd>
      Sewage Treatment Plant
    </kwd> 
    <kwd>
      Prediction
    </kwd> 
    <kwd>
      ARIMA Model
    </kwd>
   </kwd-group>
  </article-meta>
 </front>
 <body>
  <sec id="s1">
   <title>1. Introduction</title>
   <p>
    <xref ref-type="bibr" rid="scirp.136703-"></xref>Total nitrogen was an important indicator for characterizing eutrophication of polluted water. At present, the AAO (Anaerobic-Anoxic-Oxic) process has been adopted in most municipal sewage treatment plant. Due to the complex process of sewage treatment process involved of physics, chemistry, and biology, the current operating procedures of sewage treatment plant were mainly controlled by personnel based on their own experience. However, with the widespread adoption of automatic monitoring instruments, improving the automation control level of sewage plants and ensuring stable and compliant effluent were currently key issues in the operation of sewage plants.</p>
   <p>It was urgent to establish a predictive model for the effluent quality under a certain stable operating condition. At present, a big data modeling method based on statistical method and machine learning theory to industrial processes was becoming a popular research method <xref ref-type="bibr" rid="scirp.136703-1">
     [1]
    </xref>. The technical difficulty lied in how to construct models under the influence of multiple factors, and how to determine the interaction relationships between different factors <xref ref-type="bibr" rid="scirp.136703-2">
     [2]
    </xref>. Some papers <xref ref-type="bibr" rid="scirp.136703-3">
     [3]
    </xref> <xref ref-type="bibr" rid="scirp.136703-4">
     [4]
    </xref> have disclosed some prediction methods on effluent water quality. In these papers, Arima, BP Neural Network and support vector regression model has been reported <xref ref-type="bibr" rid="scirp.136703-5">
     [5]
    </xref>.</p>
   <p>A sewage treatment plant in Chengdu Shi, Sichuan Province was regarded as the research object in this paper. This plant collected urban residents’ sewage, with a designed treatment capacity of 34,000 tons/day. The automation level of the control system and control efficiency in this plant was low due to the manual operation. This plant had automatic control instruments to collect water quality data, but there were not water quality prediction measures and feedback control system. Therefore, process adjustment was not timely and effluent quality was not stable.</p>
  </sec><sec id="s2">
   <title>
    <xref ref-type="bibr" rid="scirp.136703-"></xref>2. Research Methods</title>
   <sec id="s2_1">
    <title>
     <xref ref-type="bibr" rid="scirp.136703-"></xref>2.1. Sewage Treatment Process</title>
    <p>For urban sewage treatment plant, biological methods were mainly used, including activated sludge process, SBR process, AB process, anaerobic treatment process, biofilm process, etc. Among them, the AAO process based on the principle of activated sludge process was the main process currently.</p>
    <p>The principle of AAO process was shown in <xref ref-type="fig" rid="fig1">
      Figure 1
     </xref>.</p>
    <fig id="fig1" position="float">
     <label>Figure 1</label>
     <caption>
      <title>Figure 1. Process chart of a typical AAO.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/2860307-rId12.jpeg?20241021024727" />
    </fig>
    <p>As shown in <xref ref-type="fig" rid="fig1">
      Figure 1
     </xref>, the sewage influent flowed through the anaerobic tank, anoxic tank, and aerobic tank in sequence, and undergoes biochemical reactions with activated sludge to remove COD, nitrogen and phosphorus pollutants.</p>
    <p>For the denitrification process of AAO, the total nitrogen in the effluent was not only related to the process parameters, such as temperature, pH, dissolved oxygen, etc., but also significantly correlated with parameters in the water quality, such as BOD (COD) and ammonia nitrogen. Biochemical oxygen demand (BOD) refers to the amount of dissolved oxygen consumed by microorganisms to decompose oxidizable substances, especially organic matter<sup>1</sup>.</p>
    <p>In the aerobic stage, ammonia nitrogen in the influent will be converted into nitrate nitrogen by the action of nitrite bacteria and nitrifying bacteria. Both microorganisms in this process were autotrophic only consumed oxygen and did not consume BOD, which indicates that nitrification process was independent of BOD. During the anoxic stage, nitrate nitrogen will be converted into nitrogen gas and then released from the water by denitrifying bacteria, under the condition of energy supply from BOD. Therefore, denitrification process was closely related to BOD concentration and the total nitrogen of the effluent was highly relevant to the BOD.</p>
    <p>The influent and effluent water quality indicators and hydraulic retention time of key treatment units designed for this sewage treatment plant were shown in <xref ref-type="table" rid="table1">
      Table 1
     </xref> and <xref ref-type="table" rid="table2">
      Table 2
     </xref>.</p>
    <table-wrap id="table1">
     <label>
      <xref ref-type="table" rid="table1">
       Table 1
      </xref></label>
     <caption>
      <title>
       <xref ref-type="bibr" rid="scirp.136703-"></xref>Table 1. Influent and effluent water quality in design documents.</title>
     </caption>
     <table class="MsoTableGrid custom-table" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
       <td class="custom-bottom-td acenter" width="20.40%"><p style="text-align:center">Water quality indexes</p></td> 
       <td class="custom-bottom-td acenter" width="17.65%"><p style="text-align:center">pH</p><p style="text-align:center">(Dimensionless)</p></td> 
       <td class="custom-bottom-td acenter" width="22.76%"><p style="text-align:center">COD (Chemical oxygen demand, mg/L)</p></td> 
       <td class="custom-bottom-td acenter" width="22.76%"><p style="text-align:center">BOD (Biochemical oxygen demand, mg/L)</p></td> 
       <td class="custom-bottom-td acenter" width="16.43%"><p style="text-align:center">Total nitrogen, TN (mg/L)</p></td> 
      </tr> 
      <tr> 
       <td class="custom-top-td acenter" width="20.40%"><p style="text-align:center">Influent</p></td> 
       <td class="custom-top-td acenter" width="17.65%"><p style="text-align:center">6 - 9</p></td> 
       <td class="custom-top-td acenter" width="22.76%"><p style="text-align:center">&lt;400</p></td> 
       <td class="custom-top-td acenter" width="22.76%"><p style="text-align:center">&lt;200</p></td> 
       <td class="custom-top-td acenter" width="16.43%"><p style="text-align:center">&lt;50</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="20.40%"><p style="text-align:center">Effluent</p></td> 
       <td class="acenter" width="17.65%"><p style="text-align:center">6 - 9</p></td> 
       <td class="acenter" width="22.76%"><p style="text-align:center">&lt;50</p></td> 
       <td class="acenter" width="22.76%"><p style="text-align:center">&lt;10</p></td> 
       <td class="acenter" width="16.43%"><p style="text-align:center">&lt;20</p></td> 
      </tr> 
     </table>
    </table-wrap>
    <table-wrap id="table2">
     <label>
      <xref ref-type="table" rid="table2">
       Table 2
      </xref></label>
     <caption>
      <title>
       <xref ref-type="bibr" rid="scirp.136703-"></xref>Table 2. HRT of different treatment units in an AAO plant.</title>
     </caption>
     <table class="MsoTableGrid custom-table" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
       <td class="custom-bottom-td acenter" width="15.09%"><p style="text-align:center">Process units</p></td> 
       <td class="custom-bottom-td acenter" width="18.89%"><p style="text-align:center">Anaerobic tank</p></td> 
       <td class="custom-bottom-td acenter" width="15.08%"><p style="text-align:center">Anoxic tank</p></td> 
       <td class="custom-bottom-td acenter" width="16.80%"><p style="text-align:center">Aerobic tank</p></td> 
       <td class="custom-bottom-td acenter" width="26.46%"><p style="text-align:center">Sedimentation tank</p></td> 
      </tr> 
      <tr> 
       <td class="custom-top-td acenter" width="15.09%"><p style="text-align:center">HRT (h)</p></td> 
       <td class="custom-top-td acenter" width="18.89%"><p style="text-align:center">3.5</p></td> 
       <td class="custom-top-td acenter" width="15.08%"><p style="text-align:center">6</p></td> 
       <td class="custom-top-td acenter" width="16.80%"><p style="text-align:center">14</p></td> 
       <td class="custom-top-td acenter" width="26.46%"><p style="text-align:center">3</p></td> 
      </tr> 
     </table>
    </table-wrap>
   </sec>
   <sec id="s2_2">
    <title>
     <xref ref-type="bibr" rid="scirp.136703-"></xref>2.2. Water Quality Prediction Model</title>
    <p>The prediction of sewage treatment water quality mainly relied on studying historical water quality monitoring data, establishing model relationships to study the laws of future water quality changes, and exploring the development trends of future water quality. At present, the commonly used methods for water quality prediction internationally include time series analysis, regression analysis, grey system analysis and machine learning. Among them, the ARIMA model based on auto-regression has been widely used.</p>
    <p>The ARIMA (p, d, q) model, also known as the Auto Regressive Integrated Moving Average Model, was a time series prediction method proposed by Box and Jenkins in the early 1970s. It can be used to predict the characteristics of random processes over time rather than being fixed, and the reason for the instability of time series was random rather than deterministic. The ARIMA model refereed to a model established by regressing only the lagged value of the dependent variable and the present value and lagged value of the random error term during the process of converting non-stationary time series into stationary time series.</p>
    <p>In the ARIMA model, AR was auto-regressive and p was the corresponding auto-regressive term. D was the differential order used to obtain a stationary sequence. MA was the moving average, and q was the corresponding number of moving average terms <xref ref-type="bibr" rid="scirp.136703-4">
      [4]
     </xref>.</p>
    <p>The ARIMA model is a traditional model, and in this paper, it is applied to water quality prediction, divided into winter and summer based on local climate, and predictions are made using the ARIMA model for each season.</p>
    <p>Establishing an ARIMA time series model involves three steps as follows:</p>
    <p>1) Stability testing and differential processing of data</p>
    <p>Plot the data and observe whether it was a stationary time series. If it was a stationary series, the ARIMA model can be directly established. For non-stationary time series, one or more (d-order) differentiating operations must be performed to convert it into a stationary time series before the model can be established.</p>
    <p>2) Determine model parameters</p>
    <p>The stationary time series obtained through differential operation was used to calculate the auto-correlation coefficient, ACF, and partial auto-correlation coefficient, PACF. By analyzing the auto-correlation graph and partial auto-correlation graph, the optimal auto-regressive order p and the q of the moving average were obtained. After obtaining the above parameters, the ARIMA model can be established.</p>
    <p>3) Model validation</p>
    <p>The next step was verifying whether the parameter estimation values of the fitted time series model were significant and verifying whether the residual sequence of the fitted time series model was a white noise sequence. If it does not match, go back to step 2.</p>
    <p>The process of establishing the ARIMA model was shown in <xref ref-type="fig" rid="fig2">
      Figure 2
     </xref>.</p>
    <fig id="fig2" position="float">
     <label>Figure 2</label>
     <caption>
      <title>Figure 2. The process chart of modelling.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/2860307-rId15.jpeg?20241021024728" />
    </fig>
    <p>Based on the fundamental analysis of the principle of combined nitrification and denitrification for total nitrogen removal in AAO process, the factors such as ammonia nitrogen concentration, BOD concentration and COD concentration, dissolved oxygen concentration, temperature and pH that affect the denitrification effect of sewage treatment plant have been determined <xref ref-type="bibr" rid="scirp.136703-2">
      [2]
     </xref>.</p>
    <p>Firstly, although temperature and pH can affect the activity and reaction rate of bacteria, pH and T will generally not be adjusted due to the large water amount in the reality of sewage treatment. Therefore, pH and T were not considered as variables in this paper. However, considering the significant difference of water temperature in various months between winter and Non-winter, in this paper, the data were artificially divided into two periods, the winter period and the Non-winter period. Specifically, the data from Apr.1st to Nov.30th of each year were concluded as Non-winter period, and the data from Dec.1st to Mar.31st of next year were concluded as winter period. Furthermore, dissolved oxygen and ammonia nitrogen concentration were not considered as factors for investigation in this paper because there were no online monitoring probes of dissolved oxygen and ammonia nitrogen concentration.</p>
    <p>Secondly, for domestic sewage in municipal treatment plant, there was a clear correlation between BOD and COD. Generally speaking, BOD was half of COD. Therefore, in this paper, only BOD was used as the parameter affecting the model of total nitrogen. In summary, this paper mainly focused on the relation between TN and BOD, respectively all months and distinguish between winter and Non-winter.</p>
    <p>1) Data preparation</p>
    <p>The daily testing data of the sewage plant from Dec.1st, 2019 to Nov.30th, 2020 as the data sample were adopted in this paper. The monitoring frequency of water quality was once a day, so the time series had 365 sample points, which the water quality indicators included BOD and total nitrogen, with a total of 730 data values.</p>
    <p>All data come from the self-control system and are exported in Excel format. After fitting a suitable ARIMA model based on this data, the predicted values were compared with the actual values to verify the predictive performance of the model.</p>
    <p>The data modeling and processing process in this paper was carried out using Stata (Version 15.1) software. All variable was defined in <xref ref-type="table" rid="table3">
      Table 3
     </xref>.</p>
    <table-wrap id="table3">
     <label>
      <xref ref-type="table" rid="table3">
       Table 3
      </xref></label>
     <caption>
      <title>
       <xref ref-type="bibr" rid="scirp.136703-"></xref>Table 3. The table of variable definition.</title>
     </caption>
     <table class="MsoTableGrid custom-table" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
       <td class="custom-bottom-td acenter" width="22.48%"><p style="text-align:center">Variable Name</p></td> 
       <td class="custom-bottom-td acenter" width="63.06%"><p style="text-align:center">Variable Definition</p></td> 
       <td class="custom-bottom-td acenter" width="14.44%"><p style="text-align:center">Unit</p></td> 
      </tr> 
      <tr> 
       <td class="custom-top-td acenter" width="22.48%"><p style="text-align:center">TN</p></td> 
       <td class="custom-top-td acenter" width="63.06%"><p style="text-align:center">Total nitrogen value in effluent water</p></td> 
       <td class="custom-top-td acenter" width="14.44%"><p style="text-align:center">mg/L</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="22.48%"><p style="text-align:center">BOD</p></td> 
       <td class="acenter" width="63.06%"><p style="text-align:center">BOD value in effluent water</p></td> 
       <td class="acenter" width="14.44%"><p style="text-align:center">mg/L</p></td> 
      </tr> 
     </table>
    </table-wrap>
    <p>2) Descriptive statistics of data</p>
    <p>
     <xref ref-type="table" rid="table4">
      Table 4
     </xref> showed the descriptive statistical results of the variables. As shown in <xref ref-type="table" rid="table4">
      Table 4
     </xref>, descriptive statistical showed that there were 365 final samples, standard deviation was not large, indicating a smaller range of fluctuations.</p>
    <table-wrap id="table4">
     <label>
      <xref ref-type="table" rid="table4">
       Table 4
      </xref></label>
     <caption>
      <title>
       <xref ref-type="bibr" rid="scirp.136703-"></xref>Table 4. The table of variable descriptive statistics.</title>
     </caption>
     <table class="MsoTableGrid custom-table" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
       <td class="custom-bottom-td acenter" width="11.46%"><p style="text-align:center">Var.</p></td> 
       <td class="custom-bottom-td acenter" width="11.28%"><p style="text-align:center">Obs.</p></td> 
       <td class="custom-bottom-td acenter" width="18.76%"><p style="text-align:center">Mean</p></td> 
       <td class="custom-bottom-td acenter" width="20.80%"><p style="text-align:center">Std. Dev.</p></td> 
       <td class="custom-bottom-td acenter" width="18.76%"><p style="text-align:center">Min</p></td> 
       <td class="custom-bottom-td acenter" width="18.88%"><p style="text-align:center">Max</p></td> 
      </tr> 
      <tr> 
       <td class="custom-top-td acenter" width="11.46%"><p style="text-align:center">TN</p></td> 
       <td class="custom-top-td acenter" width="11.28%"><p style="text-align:center">365</p></td> 
       <td class="custom-top-td acenter" width="18.76%"><p style="text-align:center">4.4529</p></td> 
       <td class="custom-top-td acenter" width="20.80%"><p style="text-align:center">0.8682</p></td> 
       <td class="custom-top-td acenter" width="18.76%"><p style="text-align:center">1.9924</p></td> 
       <td class="custom-top-td acenter" width="18.88%"><p style="text-align:center">7.032271</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="11.46%"><p style="text-align:center">BOD</p></td> 
       <td class="acenter" width="11.28%"><p style="text-align:center">365</p></td> 
       <td class="acenter" width="18.76%"><p style="text-align:center">2.6049</p></td> 
       <td class="acenter" width="20.80%"><p style="text-align:center">0.7570</p></td> 
       <td class="acenter" width="18.76%"><p style="text-align:center">0.5000</p></td> 
       <td class="acenter" width="18.88%"><p style="text-align:center">5.2000</p></td> 
      </tr> 
     </table>
    </table-wrap>
   </sec>
  </sec><sec id="s3">
   <title>3. Results</title>
   <sec id="s3_1">
    <title>
     <xref ref-type="bibr" rid="scirp.136703-"></xref>3.1. Modeling without Considering Seasonal Changes</title>
    <p>Due to the fact that the collected water quality indicator data was across the whole year, data modeling was carried out for the entire sample without considering seasonal change.</p>
    <p>The step of stationarity test was shown as follows <xref ref-type="bibr" rid="scirp.136703-6">
      [6]
     </xref>. ADF unit root test was performed on time series data to verify whether the time series data was stationary. If the test statistic was less than the critical value and the p-value was less than the significance level, which was usually 0.05, and the null hypothesis was rejected. The data will not have unit roots and was considered stationary, and d = 0 was determined. If the p-value was greater than 0.05, it was considered that the data was non-stationary and the time series needed to be differenced. After being differenced, ADF unit root test was performed until the data was stationary, and the value of d was determined accordingly.</p>
    <p>Using the Stata software command fuller, ADF unit root tests were performed on the time series of total nitrogen and BOD, and the results were shown in <xref ref-type="table" rid="table5">
      Table 5
     </xref>. It was evident that the p-values for both total nitrogen and BOD were below 0.05, indicating that these variables are stationary sequences and, therefore, do not require differentiation. Therefore, d = 0 was determined. <xref ref-type="table" rid="table5">
      Table 5
     </xref> showed ADF test statistic.</p>
    <table-wrap id="table5">
     <label>
      <xref ref-type="table" rid="table5">
       Table 5
      </xref></label>
     <caption>
      <title>
       <xref ref-type="bibr" rid="scirp.136703-"></xref>Table 5. The table of Augmented Dickey-Fuller (ADF) test statistics.</title>
     </caption>
     <table class="MsoTableGrid custom-table" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
       <td class="custom-bottom-td acenter" width="26.06%"><p style="text-align:center">Var.</p></td> 
       <td class="custom-bottom-td acenter" width="22.22%"><p style="text-align:center">ADF test statistic</p></td> 
       <td class="custom-bottom-td acenter" width="29.54%"><p style="text-align:center">Test statistic</p></td> 
       <td class="custom-bottom-td acenter" width="22.14%"><p style="text-align:center">Prob.*</p></td> 
      </tr> 
      <tr> 
       <td class="custom-top-td acenter" width="26.06%"><p style="text-align:center">TN (Total nitrogen)</p></td> 
       <td class="custom-top-td acenter" width="22.22%"><p style="text-align:center">ADF</p></td> 
       <td class="custom-top-td acenter" width="29.54%"><p style="text-align:center">−14.490</p></td> 
       <td class="custom-top-td acenter" width="22.14%"><p style="text-align:center">0.000</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="26.06%"><p style="text-align:center">BOD</p></td> 
       <td class="acenter" width="22.22%"><p style="text-align:center">ADF</p></td> 
       <td class="acenter" width="29.54%"><p style="text-align:center">−9.993</p></td> 
       <td class="acenter" width="22.14%"><p style="text-align:center">0.000</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="26.06%"><p style="text-align:center">Test critical values:</p></td> 
       <td class="acenter" width="22.22%"><p style="text-align:center">1% level</p></td> 
       <td class="acenter" width="29.54%"><p style="text-align:center">−3.451</p></td> 
       <td class="acenter" width="22.14%"><p style="text-align:center"></p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="26.06%"><p style="text-align:center"></p></td> 
       <td class="acenter" width="22.22%"><p style="text-align:center">5% level</p></td> 
       <td class="acenter" width="29.54%"><p style="text-align:center">−2.875</p></td> 
       <td class="acenter" width="22.14%"><p style="text-align:center"></p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="26.06%"><p style="text-align:center"></p></td> 
       <td class="acenter" width="22.22%"><p style="text-align:center">10% level</p></td> 
       <td class="acenter" width="29.54%"><p style="text-align:center">−2.570</p></td> 
       <td class="acenter" width="22.14%"><p style="text-align:center"></p></td> 
      </tr> 
     </table>
    </table-wrap>
    <p>After establishing the appropriate degree d, the parameters p and q in the ARIMA model were subsequently identified. In an ARIMA model, the PACF plot was used to identify the order p of the AR (autoregressive) component. If the PACF plot exhibited a significant drop-off in the correlation after a lag p, it could be assumed that the order p of the AR model was equal to that lag value. The ACF plot was mainly used to identify the order q of the MA model.</p>
    <p>The shaded regions in the auto-correlation function (ACF) and partial auto-correlation function (PACF) plots typically denote statistical confidence intervals, which assisted in assessing the significance of the correlation coefficients. In the process of determining the p and q values for an ARIMA model, it was common practice to identify the last lag that significantly exceeded the shaded region in both PACF and ACF plots. Nevertheless, the interpretation of the graphical representations may not be straightforward. Therefore, AIC values for each model were typically aggregated to facilitate a comprehensive assessment. The model with the lowest AIC value was regarded as the optimal fitting model. When the sample size was small, or when the objective of model selection was to achieve accurate predictions, AIC was frequently employed due to its relatively lower penalty for model complexity, which permitted greater flexibility in fitting the model to the data. Conversely, when the sample size was large or when the aim of model selection was to provide a robust explanation of the data, BIC may be more appropriate because it imposes a higher penalty for model complexity, thereby favoring simpler models. Consequently, this study adopted the AIC value as the evaluation criterion.</p>
    <fig id="fig3" position="float">
     <label>Figure 3</label>
     <caption>
      <title>Figure 3. ACF diagram and PACF diagram of TN without considering seasonal changes.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="" />
    </fig>
    <fig id="fig3" position="float">
     <label>Figure 3</label>
     <caption>
      <title>Figure 3. ACF diagram and PACF diagram of TN without considering seasonal changes.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/2860307-rId16.jpeg?20241021024730" />
    </fig>
    <fig id="fig3" position="float">
     <label>Figure 3</label>
     <caption>
      <title>Figure 3. ACF diagram and PACF diagram of TN without considering seasonal changes.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/2860307-rId17.jpeg?20241021024730" />
    </fig>
    <p>The ACF diagram and PACF diagram of TN without considering seasonal changes was shown in <xref ref-type="fig" rid="fig3">
      Figure 3
     </xref>. As shown in <xref ref-type="fig" rid="fig3">
      Figure 3
     </xref>, it can be determined that the parameter p was 2, and the initial judgment of the parameter q was 3, 4, or 5.</p>
    <p>Fitted the models and calculated the AIC and BIC values for each ARMA() specification.</p>
    <p>Individually fitted the ARIMA(2,0,3), ARIMA(2,0,4), and ARIMA(2,0,5) models and calculated their AIC and BIC values. As presented in <xref ref-type="table" rid="table6">
      Table 6
     </xref>, the AIC and BIC values for the ARIMA(2,0,3) model were the lowest; thus, it was preliminarily identified as the optimal fitting model.</p>
    <table-wrap id="table6">
     <label>
      <xref ref-type="table" rid="table6">
       Table 6
      </xref></label>
     <caption>
      <title>
       <xref ref-type="bibr" rid="scirp.136703-"></xref>Table 6. The AIC and BIC values for fitted model.</title>
     </caption>
     <table class="MsoTableGrid custom-table" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
       <td class="custom-bottom-td acenter" width="36.62%"><p style="text-align:center">ARIMA(p,d,q) model</p></td> 
       <td class="custom-bottom-td acenter" width="31.86%"><p style="text-align:center">AIC</p></td> 
       <td class="custom-bottom-td acenter" width="31.50%"><p style="text-align:center">BIC</p></td> 
      </tr> 
      <tr> 
       <td class="custom-top-td acenter" width="36.62%"><p style="text-align:center">(2,0,3)</p></td> 
       <td class="custom-top-td acenter" width="31.86%"><p style="text-align:center">788.3416</p></td> 
       <td class="custom-top-td acenter" width="31.50%"><p style="text-align:center">819.5407</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="36.62%"><p style="text-align:center">(2,0,4)</p></td> 
       <td class="acenter" width="31.86%"><p style="text-align:center">789.5414</p></td> 
       <td class="acenter" width="31.50%"><p style="text-align:center">824.6405</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="36.62%"><p style="text-align:center">(2,0,5)</p></td> 
       <td class="acenter" width="31.86%"><p style="text-align:center">791.3816</p></td> 
       <td class="acenter" width="31.50%"><p style="text-align:center">830.3806</p></td> 
      </tr> 
     </table>
    </table-wrap>
    <p>Predicted the residual r and conducted a white noise test on the residual r.</p>
    <p>The Ljung-Box Q statistic served as a diagnostic tool to assess whether the residuals of a time series exhibited auto-correlation. A p-value exceeding 0.05 suggested that the residuals can be considered white noise, indicating an absence of correlation among observations in the series. Thus, it implied that the sequence was purely random. As presented in <xref ref-type="table" rid="table7">
      Table 7
     </xref>, with a p-value of 0.506 &gt; 0.05, the residual series passed the white noise test, confirming that the ARIMA(2,0,3) model had effectively captured the dynamics of the time series. MSE 0.4</p>
    <table-wrap id="table7">
     <label>
      <xref ref-type="table" rid="table7">
       Table 7
      </xref></label>
     <caption>
      <title>
       <xref ref-type="bibr" rid="scirp.136703-"></xref>Table 7. Portmanteau test for white noise.</title>
     </caption>
     <table class="MsoTableGrid custom-table" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
       <td class="custom-bottom-td acenter" width="56.18%"><p style="text-align:center"></p></td> 
       <td class="custom-bottom-td acenter" width="43.80%"><p style="text-align:center">Test statistic</p></td> 
      </tr> 
      <tr> 
       <td class="custom-top-td acenter" width="56.18%"><p style="text-align:center">Portmanteau (Q) statistic</p></td> 
       <td class="custom-top-td acenter" width="43.80%"><p style="text-align:center">55.6912</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="56.18%"><p style="text-align:center">Prob &gt; chi2(40)</p></td> 
       <td class="acenter" width="43.80%"><p style="text-align:center">0.0506</p></td> 
      </tr> 
     </table>
    </table-wrap>
    <p>Using the ARIMA (2,0,3) model obtained above, the predict command was called to predict the values from Dec.1st, 2019 to Nov.30th, 2020.</p>
    <p>
     <xref ref-type="table" rid="table8">
      Table 8
     </xref> shows the MAE and MSE values for the model. MSE was 0.4853 and MAE was 0.5372. This indicates that the prediction error is relatively large.</p>
    <table-wrap id="table8">
     <label>
      <xref ref-type="table" rid="table8">
       Table 8
      </xref></label>
     <caption>
      <title>
       <xref ref-type="bibr" rid="scirp.136703-"></xref>Table 8. Evaluation metrics.</title>
     </caption>
     <table class="MsoTableGrid custom-table" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
       <td class="custom-bottom-td acenter" width="27.08%"><p style="text-align:center">Evaluation Metrics</p></td> 
       <td class="custom-bottom-td acenter" width="14.58%"><p style="text-align:center">Obs.</p></td> 
       <td class="custom-bottom-td acenter" width="14.58%"><p style="text-align:center">Mean</p></td> 
       <td class="custom-bottom-td acenter" width="14.60%"><p style="text-align:center">Std. Dev.</p></td> 
       <td class="custom-bottom-td acenter" width="14.58%"><p style="text-align:center">Min</p></td> 
       <td class="custom-bottom-td acenter" width="14.60%"><p style="text-align:center">Max</p></td> 
      </tr> 
      <tr> 
       <td class="custom-top-td acenter" width="27.08%"><p style="text-align:center">MSE</p></td> 
       <td class="custom-top-td acenter" width="14.58%"><p style="text-align:center">365</p></td> 
       <td class="custom-top-td acenter" width="14.58%"><p style="text-align:center">0.4853</p></td> 
       <td class="custom-top-td acenter" width="14.60%"><p style="text-align:center">0.8611</p></td> 
       <td class="custom-top-td acenter" width="14.58%"><p style="text-align:center">0.0001</p></td> 
       <td class="custom-top-td acenter" width="14.60%"><p style="text-align:center">10.1270</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="27.08%"><p style="text-align:center">MAE</p></td> 
       <td class="acenter" width="14.58%"><p style="text-align:center">365</p></td> 
       <td class="acenter" width="14.58%"><p style="text-align:center">0.5372</p></td> 
       <td class="acenter" width="14.60%"><p style="text-align:center">0.4441</p></td> 
       <td class="acenter" width="14.58%"><p style="text-align:center">0.0106</p></td> 
       <td class="acenter" width="14.60%"><p style="text-align:center">3.1823</p></td> 
      </tr> 
     </table>
    </table-wrap>
    <p>The fitting results of the relationship diagram between actual and predicted values were shown in <xref ref-type="fig" rid="fig4">
      Figure 4
     </xref>, where the line with the label of the circle represented the actual value and the line with the label of the triangle represented the predicted value.</p>
    <p>Subtracted the predicted value from the actual value to obtain the difference, and compared the difference with the actual value to obtain the deviation rate, as shown in <xref ref-type="fig" rid="fig5">
      Figure 5
     </xref>. From <xref ref-type="fig" rid="fig5">
      Figure 5
     </xref>, it can be seen that the deviation rate was mainly concentrated in (−40%, 30%). The results showed a few large prediction deviation without considering the seasonal change. Therefore, in order to decrease the prediction deviation, the seasonal change was considered at various months because of temperature change.</p>
    <fig id="fig4" position="float">
     <label>Figure 4</label>
     <caption>
      <title>Figure 4. The relationship diagram between actual and predicted values developed using the ARIMA model without condisering seasonal changes.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/2860307-rId18.jpeg?20241021024731" />
    </fig>
    <fig id="fig5" position="float">
     <label>Figure 5</label>
     <caption>
      <title>Figure 5. Deviation rate chart between predicted and actual values without considering seasonal changes.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/2860307-rId19.jpeg?20241021024731" />
    </fig>
   </sec>
   <sec id="s3_2">
    <title>
     <xref ref-type="bibr" rid="scirp.136703-"></xref>3.2. Modeling Considering Seasonal Changes</title>
    <p>The temperature in the Chengdu area exhibits seasonal variation throughout the year, with average temperatures as follows: 12˚C to 17˚C in spring, 20˚C to 28˚C in summer, 19˚C to 25˚C in autumn, and 6˚C to 12˚C in winter. Notably, winter temperatures consistently remain below 12˚C, a stipulation clearly outlined in China’s water supply and drainage regulations. This is due to the significant impact that temperatures below 12˚C have on microbial activity. Consequently, all the samples will be categorized into two periods: the winter period (December through March of the following year) and the Non-winter period (April through November). The final number of winter samples was 121, and the number of Non-winter samples was 244.</p>
    <fig id="fig6" position="float">
     <label>Figure 6</label>
     <caption>
      <title>Figure 6. ACF diagram and PACF diagram of TN (In winter).</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="" />
    </fig>
    <fig id="fig6" position="float">
     <label>Figure 6</label>
     <caption>
      <title>Figure 6. ACF diagram and PACF diagram of TN (In winter).</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/2860307-rId20.jpeg?20241021024732" />
    </fig>
    <fig id="fig6" position="float">
     <label>Figure 6</label>
     <caption>
      <title>Figure 6. ACF diagram and PACF diagram of TN (In winter).</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/2860307-rId21.jpeg?20241021024732" />
    </fig>
    <p>The ACF and PACF plots of TN in winter was shown in <xref ref-type="fig" rid="fig6">
      Figure 6
     </xref>. It can be determined that the parameter p was 1, and the initial judgment of the parameter q was 4 or 5 from <xref ref-type="fig" rid="fig6">
      Figure 6
     </xref>.</p>
    <p>The AIC and BIC values for fitted model was shown in <xref ref-type="table" rid="table9">
      Table 9
     </xref>. It can be determined that the AIC value of the ARIMA(1,0,5) model was the smallest, and it was initially determined to be the optimal fitting model from <xref ref-type="table" rid="table8">
      Table 8
     </xref>.</p>
    <table-wrap id="table9">
     <label>
      <xref ref-type="table" rid="table9">
       Table 9
      </xref></label>
     <caption>
      <title>
       <xref ref-type="bibr" rid="scirp.136703-"></xref>Table 9. The AIC and BIC values for fitted model.</title>
     </caption>
     <table class="MsoTableGrid custom-table" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
       <td class="custom-bottom-td acenter" width="38.98%"><p style="text-align:center">ARIMA(p,d,q) model</p></td> 
       <td class="custom-bottom-td acenter" width="32.00%"><p style="text-align:center">AIC</p></td> 
       <td class="custom-bottom-td acenter" width="28.98%"><p style="text-align:center">BIC</p></td> 
      </tr> 
      <tr> 
       <td class="custom-top-td acenter" width="38.98%"><p style="text-align:center">(1,0,4)</p></td> 
       <td class="custom-top-td acenter" width="32.00%"><p style="text-align:center">290.6683</p></td> 
       <td class="custom-top-td acenter" width="28.98%"><p style="text-align:center">313.0302</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="38.98%"><p style="text-align:center">(1,0,5)</p></td> 
       <td class="acenter" width="32.00%"><p style="text-align:center">290.3118</p></td> 
       <td class="acenter" width="28.98%"><p style="text-align:center">315.4739</p></td> 
      </tr> 
     </table>
    </table-wrap>
    <p>Predicted residuals, and conducted a white noise test on the residuals. It can be concluded that p = 0.9784 &gt; 0.05, and the residual sequence passed the white noise test, indicating that the ARIMA(1,0,5) model has been successfully fitted.</p>
    <p>Using the ARIMA (1,0,5) model obtained above, the predict command was called to predict the values from Dec.1st, 2019 to Mar.31st, 2020.</p>
    <p>
     <xref ref-type="table" rid="table10">
      Table 10
     </xref> shows the MAE and MSE values for the model. MSE was 0.5528 and MAE was 0.5753. Although the prediction error is still quite large, the degree of discreteness has been significantly reduced, which Standard deviation was 1.0581 and 0.4370 separately.</p>
    <table-wrap id="table10">
     <label>
      <xref ref-type="table" rid="table10">
       Table 10
      </xref></label>
     <caption>
      <title>
       <xref ref-type="bibr" rid="scirp.136703-"></xref>Table 10. Evaluation metrics.</title>
     </caption>
     <table class="MsoTableGrid custom-table" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
       <td class="custom-bottom-td acenter" width="26.24%"><p style="text-align:center">Evaluation Metrics</p></td> 
       <td class="custom-bottom-td acenter" width="14.74%"><p style="text-align:center">Obs.</p></td> 
       <td class="custom-bottom-td acenter" width="14.76%"><p style="text-align:center">Mean</p></td> 
       <td class="custom-bottom-td acenter" width="14.74%"><p style="text-align:center">Std. Dev.</p></td> 
       <td class="custom-bottom-td acenter" width="14.76%"><p style="text-align:center">Min</p></td> 
       <td class="custom-bottom-td acenter" width="14.76%"><p style="text-align:center">Max</p></td> 
      </tr> 
      <tr> 
       <td class="custom-top-td acenter" width="26.24%"><p style="text-align:center">MSE</p></td> 
       <td class="custom-top-td acenter" width="14.74%"><p style="text-align:center">121</p></td> 
       <td class="custom-top-td acenter" width="14.76%"><p style="text-align:center">0.5528</p></td> 
       <td class="custom-top-td acenter" width="14.74%"><p style="text-align:center">1.0581</p></td> 
       <td class="custom-top-td acenter" width="14.76%"><p style="text-align:center">0.0000</p></td> 
       <td class="custom-top-td acenter" width="14.76%"><p style="text-align:center">9.5173</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="26.24%"><p style="text-align:center">MAE</p></td> 
       <td class="acenter" width="14.74%"><p style="text-align:center">121</p></td> 
       <td class="acenter" width="14.76%"><p style="text-align:center">0.5753</p></td> 
       <td class="acenter" width="14.74%"><p style="text-align:center">0.4730</p></td> 
       <td class="acenter" width="14.76%"><p style="text-align:center">0.0055</p></td> 
       <td class="acenter" width="14.76%"><p style="text-align:center">3.0850</p></td> 
      </tr> 
     </table>
    </table-wrap>
    <p>The fitting results were shown in <xref ref-type="fig" rid="fig7">
      Figure 7
     </xref>, where the line with the label of circle represented the actual value and the line with the label of triangle represented the predicted value.</p>
    <fig id="fig7" position="float">
     <label>Figure 7</label>
     <caption>
      <title>Figure 7. The relationship diagram between actual and predicted values developed using the ARIMA model in winter from 1 Dec.1st, 2019 to Mar.31st, 2020.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/2860307-rId22.jpeg?20241021024732" />
    </fig>
    <fig id="fig8" position="float">
     <label>Figure 8</label>
     <caption>
      <title>Figure 8. Deviation rate chart between predicted and actual values in winter from 1 Dec.1st, 2019 to Mar.31st, 2020.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/2860307-rId23.jpeg?20241021024732" />
    </fig>
    <p>From <xref ref-type="fig" rid="fig8">
      Figure 8
     </xref>, it can be seen that the deviation rate was mainly concentrated in (−30%, 20%), and only 12 of the predicted points were far off from the above range. The sample points with large deviation value accounted for 9.92 % of total sample. Especially, Most of the deviation values were negative, which can be beneficial for ensuring that the effluent meets the discharge standard.</p>
    <fig id="fig9" position="float">
     <label>Figure 9</label>
     <caption>
      <title>Figure 9. ACF diagram and PACF diagram of TN (In Non-winter).</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/2860307-rId24.jpeg?20241021024733" />
    </fig>
    <p>The ACF and PACF plots of TN in Non-winter was shown in <xref ref-type="fig" rid="fig9">
      Figure 9
     </xref>. As shown in <xref ref-type="fig" rid="fig9">
      Figure 9
     </xref>, it can be determined that the parameter p was 1, and the initial judgment of the parameter q was 1 or 2.</p>
    <p>The AIC and BIC values for fitted model was shown in <xref ref-type="table" rid="table11">
      Table 11
     </xref>. As shown in <xref ref-type="table" rid="table9">
      Table 9
     </xref>, the AIC value of the ARIMA(1,0,2) model was the smallest, and it was initially determined to be the optimal fitting model.</p>
    <table-wrap id="table11">
     <label>
      <xref ref-type="table" rid="table11">
       Table 11
      </xref></label>
     <caption>
      <title>
       <xref ref-type="bibr" rid="scirp.136703-"></xref>Table 11. The AIC and BIC values for fitted model.</title>
     </caption>
     <table class="MsoTableGrid custom-table" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
       <td class="custom-bottom-td acenter" width="42.56%"><p style="text-align:center">ARIMA(p,d,q) Model</p></td> 
       <td class="custom-bottom-td acenter" width="29.74%"><p style="text-align:center">AIC</p></td> 
       <td class="custom-bottom-td acenter" width="27.68%"><p style="text-align:center">BIC</p></td> 
      </tr> 
      <tr> 
       <td class="custom-top-td acenter" width="42.56%"><p style="text-align:center">(1,0,1)</p></td> 
       <td class="custom-top-td acenter" width="29.74%"><p style="text-align:center">507.0278</p></td> 
       <td class="custom-top-td acenter" width="27.68%"><p style="text-align:center">524.5136</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="42.56%"><p style="text-align:center">(1,0,2)</p></td> 
       <td class="acenter" width="29.74%"><p style="text-align:center">505.8516</p></td> 
       <td class="acenter" width="27.68%"><p style="text-align:center">526.8346</p></td> 
      </tr> 
     </table>
    </table-wrap>
    <p>Based on ARIMA(1,0,1) and ARIMA(1,0,2) models, the residual series was predicted and the white noise test was conducted on the residual series, as shown in <xref ref-type="table" rid="table12">
      Table 12
     </xref>.</p>
    <table-wrap id="table12">
     <label>
      <xref ref-type="table" rid="table12">
       Table 12
      </xref></label>
     <caption>
      <title>
       <xref ref-type="bibr" rid="scirp.136703-"></xref>Table 12. Portmanteau test for white noise.</title>
     </caption>
     <table class="MsoTableGrid custom-table" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
       <td class="custom-bottom-td acenter" width="39.54%"><p style="text-align:center">ARIMA(p,d,q) model</p></td> 
       <td class="custom-bottom-td acenter" width="35.30%"><p style="text-align:center"></p></td> 
       <td class="custom-bottom-td acenter" width="25.12%"><p style="text-align:center">Test statistic</p></td> 
      </tr> 
      <tr> 
       <td rowspan="2" class="custom-top-td acenter" width="39.54%"><p style="text-align:center">(1,0,1)</p></td> 
       <td class="custom-top-td acenter" width="35.30%"><p style="text-align:center">Portmanteau (Q) statistic</p></td> 
       <td class="custom-top-td acenter" width="25.12%"><p style="text-align:center">64.2148</p></td> 
      </tr> 
      <tr> 
       <td class="custom-bottom-td acenter" width="35.30%"><p style="text-align:center">Prob.</p></td> 
       <td class="custom-bottom-td acenter" width="25.12%"><p style="text-align:center">0.0089</p></td> 
      </tr> 
      <tr> 
       <td rowspan="2" class="custom-top-td acenter" width="39.54%"><p style="text-align:center">(1,0,2)</p></td> 
       <td class="custom-top-td acenter" width="35.30%"><p style="text-align:center">Portmanteau (Q) statistic</p></td> 
       <td class="custom-top-td acenter" width="25.12%"><p style="text-align:center">60.4527</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="35.30%"><p style="text-align:center">Prob &gt; chi2 (40)</p></td> 
       <td class="acenter" width="25.12%"><p style="text-align:center">0.0199</p></td> 
      </tr> 
     </table>
    </table-wrap>
    <p>Due to p-values all being less than 0.05 and the residual sequence was not white noise and has not passed the test, indicating that the ARIMA(1,0,2) model has been successfully fitted. The model needs to be modified.</p>
    <p>Considering that the data obtained from sewage treatment plant may be closely linked to individuals’ daily routines and work cycles, S = 5 or 7 was adjusted seasonally.</p>
    <p>As shown in <xref ref-type="table" rid="table13">
      Table 13
     </xref>, the AIC value of SARIMA (1,0,2,7) was the smallest, and it was preliminarily determined that it was the optimal fitting model.</p>
    <table-wrap id="table13">
     <label>
      <xref ref-type="table" rid="table13">
       Table 13
      </xref></label>
     <caption>
      <title>
       <xref ref-type="bibr" rid="scirp.136703-"></xref>Table 13. The AIC and BIC values for fitted model.</title>
     </caption>
     <table class="MsoTableGrid custom-table" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
       <td class="custom-bottom-td acenter" width="38.30%"><p style="text-align:center">SARIMA(p,d,q,s) model</p></td> 
       <td class="custom-bottom-td acenter" width="31.66%"><p style="text-align:center">AIC</p></td> 
       <td class="custom-bottom-td acenter" width="30.00%"><p style="text-align:center">BIC</p></td> 
      </tr> 
      <tr> 
       <td class="custom-top-td acenter" width="38.30%"><p style="text-align:center">(1,0,2,5)</p></td> 
       <td class="custom-top-td acenter" width="31.66%"><p style="text-align:center">508.1263</p></td> 
       <td class="custom-top-td acenter" width="30.00%"><p style="text-align:center">539.6008</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="38.30%"><p style="text-align:center">(1,0,2,7)</p></td> 
       <td class="acenter" width="31.66%"><p style="text-align:center">505.7993</p></td> 
       <td class="acenter" width="30.00%"><p style="text-align:center">537.2738</p></td> 
      </tr> 
     </table>
    </table-wrap>
    <p>Predicted residuals, and conducted a white noise test on the residuals. It can be concluded that p = 0.1589 &gt; 0.05, and the residual sequence passed the white noise test, indicating that the SARIMA(1,0,2,7) model had been successfully fitted.</p>
    <p>
     <xref ref-type="table" rid="table14">
      Table 14
     </xref> shows the MAE and MSE values for the model. MSE was 0.4313 and MAE was 0.5131. Standard deviation was 0.6611 and 0.4108 separately. This indicates that the predictive error is relatively reduced, and the degree of dispersion is also decreasing.</p>
    <table-wrap id="table14">
     <label>
      <xref ref-type="table" rid="table14">
       Table 14
      </xref></label>
     <caption>
      <title>
       <xref ref-type="bibr" rid="scirp.136703-"></xref>Table 14. Evaluation metrics.</title>
     </caption>
     <table class="MsoTableGrid custom-table" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
       <td class="custom-bottom-td acenter" width="26.66%"><p style="text-align:center">Evaluation Metrics</p></td> 
       <td class="custom-bottom-td acenter" width="14.66%"><p style="text-align:center">Obs.</p></td> 
       <td class="custom-bottom-td acenter" width="14.66%"><p style="text-align:center">Mean</p></td> 
       <td class="custom-bottom-td acenter" width="14.66%"><p style="text-align:center">Std. Dev.</p></td> 
       <td class="custom-bottom-td acenter" width="14.66%"><p style="text-align:center">Min</p></td> 
       <td class="custom-bottom-td acenter" width="14.66%"><p style="text-align:center">Max</p></td> 
      </tr> 
      <tr> 
       <td class="custom-top-td acenter" width="26.66%"><p style="text-align:center">MSE</p></td> 
       <td class="custom-top-td acenter" width="14.66%"><p style="text-align:center">244</p></td> 
       <td class="custom-top-td acenter" width="14.66%"><p style="text-align:center">0.4313</p></td> 
       <td class="custom-top-td acenter" width="14.66%"><p style="text-align:center">0.6611</p></td> 
       <td class="custom-top-td acenter" width="14.66%"><p style="text-align:center">0.0000</p></td> 
       <td class="custom-top-td acenter" width="14.66%"><p style="text-align:center">3.8424</p></td> 
      </tr> 
      <tr> 
       <td class="acenter" width="26.66%"><p style="text-align:center">MAE</p></td> 
       <td class="acenter" width="14.66%"><p style="text-align:center">244</p></td> 
       <td class="acenter" width="14.66%"><p style="text-align:center">0.5131</p></td> 
       <td class="acenter" width="14.66%"><p style="text-align:center">0.4108</p></td> 
       <td class="acenter" width="14.66%"><p style="text-align:center">0.0029</p></td> 
       <td class="acenter" width="14.66%"><p style="text-align:center">1.9602</p></td> 
      </tr> 
     </table>
    </table-wrap>
    <p>The fitting results were shown in <xref ref-type="fig" rid="fig10">
      Figure 10
     </xref>, where the line with the label of circle represented the actual value and the line with the label of triangle represented the predicted value.</p>
    <fig id="fig10" position="float">
     <label>Figure 10</label>
     <caption>
      <title>Figure 10. The relationship diagram between actual and predicted values developed using the ARIMA model in Non-winter from Apr.1st,2020 to Nov.30th, 2020.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/2860307-rId25.jpeg?20241021024733" />
    </fig>
    <fig id="fig11" position="float">
     <label>Figure 11</label>
     <caption>
      <title>Figure 11. Deviation rate chart between predicted and actual values in Non-winter from 1 Apr.1st, 2020 to Nov.30th, 2020.</title>
     </caption>
     <graphic mimetype="image" position="float" xlink:type="simple" xlink:href="https://html.scirp.org/file/2860307-rId26.jpeg?20241021024733" />
    </fig>
    <p>
     <xref ref-type="fig" rid="fig11">
      Figure 11
     </xref> showed the deviation rate between predicted and actual values. From <xref ref-type="fig" rid="fig11">
      Figure 11
     </xref>, it can be seen that the deviation rate was mainly concentrated in (−35%, 20%). There were eight predicted value was in (20%, 30%), which accounted for 3.28% of total sample, and eleven predictions had large negative deviations of more than −35%. Firstly, Most of the deviation values were negative, which can be beneficial for ensuring that the effluent meets the discharge standard. Secondly, the days which has most of nagetive deviation was during from June to September, which the temperature were high and microbe had high activity.</p>
   </sec>
  </sec><sec id="s4">
   <title>
    <xref ref-type="bibr" rid="scirp.136703-"></xref>4. Conclusions</title>
   <p>Using the ARIMA model to predict TN effluent, a full sample analysis was firstly conducted without considering seasonal factors, and data from winter and Non-winter were analyzed separately. The simulation conclusions were as follows:</p>
   <p>1) For the entire sample data considering seasonal changes, the deviation rate of the difference between predicted and actual values and the proportion of actual values was concentrated in (−40%, 30%), with a few were far off from the above range. The Deviation without considering the seasonal changes was high. As for considering the seasonal changes, for winter data, the deviation rate was concentrated at (−30%, 20%). For Non-winter data, the deviation rate was concentrated at (−35%, 20%). Both of the deviation decreased to a certain extent.</p>
   <p>2) The ARIMA model can be used to predict the trend of TN data during the operation of sewage treatment plant, which was helpful for predicting operating conditions and adjusting operating strategies<sup>2</sup>. In particular, when a negative bias exists—defined as our predicted values surpassing the actual values—these predictions may still possess utility for practical applications. Consequently, despite the significant prediction bias, they retain a degree of reference value in real-world contexts.</p>
   <p>However, due to the use of linearization in the ARIMA model, the deviation was relatively large <xref ref-type="bibr" rid="scirp.136703-7">
     [7]
    </xref> <xref ref-type="bibr" rid="scirp.136703-8">
     [8]
    </xref>. Moreover, this paper only considers the influence of BOD on TN removal process. In fact, ammonia nitrogen concentration and dissolved oxygen concentration were important factors affecting TN removal efficiency. Consequently, future efforts will involve conducting multiple factor analyses and nonlinear modeling to enhance prediction accuracy.</p>
  </sec><sec id="s5">
   <title>5. Programming Code</title>
   <p>sum TN</p>
   <p>sum BOD</p>
   <p>dfuller TN</p>
   <p>dfuller BOD</p>
   <p>ac TN</p>
   <p>pac TN</p>
   <p>arima TN BOD, ARIMA(p,d,q)</p>
   <p>estat ic</p>
   <p>predict r,res</p>
   <p>wntestq r</p>
   <p>arima TN BOD, ARIMA(p,d,q) SARIMA(p,d,q,s)</p>
   <p>estat ic</p>
  </sec><sec id="s6">
   <title>NOTES</title>
   <p><sup>1</sup>Ammonia nitrogen and other factors do have an impact on TN removal, but due to data acquisition and other reasons, this study did not consider them with reasons descripted in 2.2.2.</p>
   <p><sup>2</sup>Because intervals with larger deviations tend to show negative deviations. Nevertheless, if our predicted values exceed the actual values, they may still hold utility for practical applications. Consequently, despite the considerable prediction bias, these predictions retain some degree of reference value in real-world scenarios.</p>
  </sec>
 </body><back>
  <ref-list>
   <title>References</title>
   <ref id="scirp.136703-ref1">
    <label>1</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Newhart, K.B., Holloway, R.W., Hering, A.S. and Cath, T.Y. (2019) Data-Driven Performance Analyses of Wastewater Treatment Plants: A Review. Water Research, 157, 498-513. &gt;https://doi.org/10.1016/j.watres.2019.03.030 
    </mixed-citation>
   </ref>
   <ref id="scirp.136703-ref2">
    <label>2</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Liu, J., Li, T., Li, J. (2018) Prediction of Effluent Total Nitrogen Concentration in a Wastewater Treatment Plant Using a Particle Swarm Optimization-Support Vector Regression Model. Chinese Journal of Environmental Engineering, 12, 119-126.
    </mixed-citation>
   </ref>
   <ref id="scirp.136703-ref3">
    <label>3</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Lin, J.M., Chen, J.L., Lin, J.J., et al. (2019) The Simulation and Prediction of TN in Sewage Treatment Effluent Using BP Neural Network and ARIMA Model. Journal of Environmental Engineering Technology, 9, 573-578.
    </mixed-citation>
   </ref>
   <ref id="scirp.136703-ref4">
    <label>4</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Yao, Y.F., Jing, Y.S., Wang, L.Y., et al. (2023) Prediction Method of Total Nitrogen in Wastewater Treatment Plant Based on Integrated Model. Industrial Water Treatment, 43, 187-194.
    </mixed-citation>
   </ref>
   <ref id="scirp.136703-ref5">
    <label>5</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Jin, Q.L. (2021) Study of Effluent Quality Prediction by ANN Model in WWTP. Master’s Thesis, Tianjin University.
    </mixed-citation>
   </ref>
   <ref id="scirp.136703-ref6">
    <label>6</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Gu, J., Wang, J., Deng, J.H., et al. (2020) Water Quality Prediction Based on ARIMa Model and BP Neural Network Algorithm. Water Purification Technology, 39, 73-82．
    </mixed-citation>
   </ref>
   <ref id="scirp.136703-ref7">
    <label>7</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Li, C.W. (2018) Prediction of Effluent Total Nitrogen in Wastewater Treatment Plant Based on BP Neural Network Model. Master’s Thesis, Huazhong University of Science and Technology.
    </mixed-citation>
   </ref>
   <ref id="scirp.136703-ref8">
    <label>8</label>
    <mixed-citation publication-type="other" xlink:type="simple">
     Wang, R. (2012) Prediction of Wastewater Treatment Based on Genetic Algorithm Optimization BP Artificial Neural Network. Master’s Thesis, South China University of Technology.
    </mixed-citation>
   </ref>
  </ref-list>
 </back>
</article>