Regulatory Implications of Integrated Real-Time Control Technology under Environmental Uncertainty

Integrated real-time control (RTC) of urban wastewater systems, which can automatically adjust system operation to environmental changes, has been found in previous studies to be a cost-effective strategy to strike a balance between good surface water quality and low greenhouse gas emissions. However, its regulatory implications have not been examined. To investigate the effective regulation of wastewater systems with this technology, two permitting approaches are developed and assessed in this work: upstream-based permitting (i.e., environmental outcomes as a function of upstream conditions) and means-based permitting (i.e., prescription of an optimal RTC strategy). An analytical framework is proposed for permit development and assessment using a diverse set of high performing integrated RTC strategies and environmental scenarios (rainfall, river flow rate, and water quality). Results from a case study show that by applying means-based permitting, the best achievable, locally suitable environmental outcomes (subject to 10% deviation) are obtained in over 80% of testing scenarios (or all testing scenarios if 19% of performance deviation is allowed) regardless of the uncertain upstream conditions. Upstream-based permitting is less effective as it is difficult to set reasonable performance targets for a highly complex and stochastic environment.


INTRODUCTION
In the quest for a sustainable future, critical infrastructures such as urban wastewater systems (UWWSs, i.e., sewers and wastewater treatment plants (WWTPs)) need to concurrently achieve good environmental water quality, low greenhouse gas (GHG) emissions, and efficient resource (e.g., chemicals, energy) consumption. 1−4 It is common to find "dumb" WWTPs with fixed operation throughout the year under great variation of system inputs (e.g., wastewater inflow rate can increase by six times when it rains 5 ) and the receiving waterbody (e.g., the 95th percentile river flow rate can be tens to hundreds of times the 5th percentile 6,7 ). This inevitably leads to overtreatment of wastewater in some occasions yielding excessive GHG emissions and resource usage and under-treatment in some other occasions not fulfilling the demand of the recipient. To address this, the operation of WWTPs needs to be both flexible and responsive and a promising approach to this is to "smarten" system operation by employing integrated real-time control (RTC). 8−12 This technology can be used to adjust system operation automatically in real-time (seconds to hours) based on the monitoring of environmental and system changes so that more intensive wastewater treatment is applied under less favorable conditions and vice versa. It can be jointly used with local or global RTC in WWTP whereby actions in one process unit are determined by measurements in the same or other unit(s) within the WWTP rather than by conditions in the sewer and/or the receiving waterbody as in integrated RTC. 11 Our previous modeling study 9 has shown that by coordinated and optimal (fixed) operation of an activated sludge WWTP with the sewer, 8% of energy costs can be saved compared to the baseline operation; an additional 7% of energy consumption can be reduced without violating the environmental water quality standards by decreasing air flow rate in the WWTP when wastewater load from the sewer is low and river flow is high. As more intensive wastewater treatment is applied under heavy rainfall or low river flow, the application of integrated RTC can also mitigate spikes of pollutant concentration in the recipient (e.g., caused by combined sewer overflows (CSOs)). Compared to other flexible operational approaches with longer response time steps (i.e., seasonal/monthly/daily aeration), integrated RTC entails reduced cost, lower environmental risk (mitigated pollution spikes), and higher resilience (timely intervention against adverse situations). 9 Successful implementations of integrated RTC have been reported in the Netherlands, 13,14 Denmark, 15,16 Germany, 17 and other countries 18,19 as a novel and cost-effective solution to deliver a better water environment. However, they mainly focus on improving effluent quality by exploiting the storage/treatment capacity of UWWSs or on reducing CSOs to more sensitive recipients. Few (if any) of the current practices monitor and utilize the temporal variability of the environmental assimilation capacity.
A key barrier to the adoption of the recipient responsive integrated RTC is the potential conflict with the traditional permitting policy on wastewater effluent discharges. As with other new technologies, the diffusion of this form of integrated RTC is influenced by various factors such as technical maturity (e.g., reliability and robustness of equipment) 8 and applicability (e.g., compatibility with existing infrastructure), 11 operational/managerial requirements, 11 financial investments, 20 social acceptance, 11 and regulatory risks (compliance of existing policies). 20,21 The technological barrier can be overcome as the recipient responsive integrated RTC uses similar instruments (sensors, controllers, and actuators) and control algorithms to those of current RTC practices. 11 Moreover, rapid technology development is ongoing as evidenced by the increased reliability of in situ nutrient sensors, 22 improved data interpretation by multivariate calibration of sensors 23 and application of advanced data analytics, 24 and enhanced remote data transmission across systems empowered by the Internet of Things (IoT). 19 The establishment of an RTC system involves considerable investment and commitment, yet it is still a cost-effective strategy compared to the traditional capital-intensive scheme, for example, $100 million sewer expansion was avoided by installing $6 million RTC system in South Bend, IN. 25 Further, this technology can open up more opportunities by the enriched insights on system performance. Field trial and demonstration of the technology shall provide more confident information on its cost and benefits and boost its social acceptance. Yet as the goal of system control moves toward direct, overall environmental performance, greater fluctuations in effluent water quality are likely to occur in accordance with the changing environment. This is not detrimental to the recipient as relaxed treatment is only allowed under high environmental assimilation capacity, but it increases risk of violating the fixed numerical permit. In the conventional regulatory framework, WWTP effluent discharge permit is developed based on annual (flow rate and water quality) statistics of effluent and upstream river for achieving a predefined downstream river water quality. As such, only one aspect of environmental impacts (i.e., water quality) is considered; moreover, the regulation mainly focuses on WWTP effluent while other pollution sources such as CSOs that jointly determine the environmental water quality are weakly controlled. Therefore, the traditional permitting approach is not suitable for the regulation of the recipient responsive integrated RTC,and a different permitting approach is needed to ensure that this technology is operated to its full potential, that is, optimal and coordinated operation of sewer and WWTP is applied and multiple environmental outcomes are delivered in a balanced manner.
A fit-for-purpose permitting policy should be environmentally protective, technically achievable, and robust under uncertainty. Despite the environmental and economic benefits of the recipient responsive integrated RTC being comprehensively analyzed and demonstrated in previous studies, there is a limit to its capability, like any other technology. For example, although integrated RTC aims at direct environmental outcomes, the actual achievable results are determined by many factors especially the upstream river water quality and flow rate (affecting dilution ratio of wastewater effluent), which are highly dynamic and stochastic. 20,26,27 Hence, it is essential to first understand the potential of this integrated RTC in a changing and uncertain environment so that rational regulatory targets can be set. Integrated modeling of UWWS and the receiving river 8,28,29 is a useful tool to simulate the interactions between the environment and the UWWS. It has been employed for the evaluation of integrated RTC in previous studies; however, only single sets of input data were used, which are insufficient to represent the stochastic nature of the environment. As such, comprehensive integrated system simulations fed by large environmental input data sets need to be conducted to support the permitting studies.
Built on the evidence base provided by comprehensive system simulations, a new permitting approach can be explored. Due to the strong influence of natural stochastic processes and upstream wastewater discharges on downstream environmental water quality, it would be unfair to wastewater service providers (WWSPs) if the traditional outcome-focused regulatory approach is applied to set fixed permit limits on the final environmental outcomes. Upstream-based permitting, 20 a variation of the conventional approach by setting different downstream environmental targets for different upstream conditions, is a more reasonable option. As such, the influence from upstream river to downstream performance can be recognized in the appraisal of the effectiveness of wastewater treatment. Yet no studies have been reported on the operationalization of this regulatory concept; also, its viability for the oversight of this integrated RTC depends on whether the best achievable outcomes can be reliably estimated for various background conditions. Means-based permitting is another regulatory approach which mandates the installation and/or operation of a technology (i.e., mean) instead of the end state (i.e., outcome). 29,30 Previous studies suggested this approach is especially effective in promoting best practices where the desirable final outcomes cannot be practically monitored or quantified without deep uncertainty. 29,31 For example, the prescription of the integrated operational plan of an UWWS has been found to be effective in regulating the overall system discharges,that is, CSOs (weakly and ineffectively monitored) and WWTP effluent. This regulatory option seems promising for the implementation of the recipient responsive integrated RTC as this control technology is built on the integrated operation of UWWSs and it is difficult to prescribe targets on downstream river water quality as mentioned earlier. Nevertheless, its applicability remains to be explored, that is, if there exists at least one RTC strategy for an UWWS that produces superior, desirable performance under most environmental situations.
To fill the research gaps discussed above, this study investigates the viable form(s) of permitting for effective regulation of the operation of the recipient responsive integrated RTC in UWWSs under stochastic environmental changes. The performance of two representative and promising approaches, that is, upstream-based and means-based permitting, are examined in achieving satisfactory and balanced overall environmental benefits under various conditions. To provide a sound basis for the permitting studies, the best performing RTC strategies are developed based on integrated UWWS modeling and multiobjective optimization and are assessed by a range of environmental scenarios for uncertainty analysis. By applying to a case study, the reliability and robustness of the two permitting approaches are evaluated and discussed.

METHODOLOGY
An analytical framework is established for the development and appraisal of the two proposed permitting approaches as presented in Figure 1. Numerical simulation and multiobjective optimization and scenario analysis are first conducted in parts I and II, respectively, to generate the optimal integrated RTC strategies and their performance under various environmental conditions. Based on (part of) the generated performance database, permits by the two different regulatory approaches are developed in part III. The rest of the performance data sets are employed to assess reliability of the permitting approaches in the final part; the variation in reliability (i.e., robustness) if different databases are used for permit development/assessment is also evaluated, as highlighted by the red dashed lines. Details of the four parts are described as follows.

Integrated UWWS Modeling and Optimization.
Integrated UWWS modeling is employed for detailed simulation of the hydraulic and biochemical processes in the collection, transportation and treatment of combined sewerage (i.e., rainfall runoff and domestic wastewater) in an UWWS and assimilation of wastewater discharged to the receiving water. 8,28,29 The sewer, WWTP, and river are represented individually by different mathematical models and connected by converter models for synchronous simulation. 32 The software platform SIMBA 32,33 is employed for integrated modeling in this study, though other platforms can also be used such as WEST, 14,34 SYNOPSIS, 8 and CITY DRAIN 35 as reported in literature. The control system is incorporated in the modeling and is appraised by dynamic simulations. As the catchment, UWWS and river are represented in an integrated manner, direct assessment can be made on the various impacts of the operation of an UWWS.
The control framework, that is, which variables are monitored for the control of which operational variable(s) (an example is provided in the following paragraph), and performance objectives are defined by decision-makers according to local needs. Optimization of RTC strategies is then conducted to quantify the variables in the control scheme toward maximizing the performance results. As a good RTC scheme needs to be built on a good operational scheme, the settings of fixed system operation in the UWWS are optimized together with the control scheme. Nondominated Sorting Genetic Algorithm−II (NSGA-II), 36 a popular evolutionary algorithm for multiobjective optimization, is employed in this study. By mimicking the natural selection and evolution process, NSGA-II starts with a population of candidate RTC strategies, which continuously evolves in each generation toward achieving better optimization objective values. The optimal RTC strategies are then assessed for their performance under different environmental scenarios (part II) to support permit development (part III) and appraisal (part IV) as described in Sections 2.2, 2.3, and 2.4, respectively. Figure 1 illustrates the framework using the control scheme employed for the case study in Section 3, where the upstream river water quality, wastewater inflow, and temperature are monitored in real-time to guide the operation of aeration rate in the UWWS, as illustrated by the dashed arrows in part I (i.e., "information flow"). "If−Then" rules are used as the control algorithm, where control actions are defined in the consequence (i.e., "Then") statement corresponding to criteria in the conditional (i.e., "If") statement. 8,9 The formulation of the control rules is illustrated in part III of Figure 1. Based on a  one-year simulation (in general, permit is developed and assessed on a yearly basis in practice) with input data set #0, values of the monitoring and/or control variables (i.e., X 1 , X 2 , and X 3 , and Y, which refer to the threshold value for poor/ good river water quality, low/high wastewater inflow rate, low/ high temperature, and aeration tier value in the case study, respectively) and fixed operational settings are optimized to improve environmental water quality and reduce GHG emissions and operational cost (i.e., the performance objectives, which correspond to the three axis of the figure in part II). As more than one goal is pursued, k (k > 1) optimal RTC strategies are produced which either delivers superior result in certain objective(s) or balanced results on all objectives. No strategy is dominated or outperforms the others in all objectives. 36 2.2. Scenario Analysis. As shown in part II of Figure 1, the k optimal strategies are appraised under n scenarios with different input data sets (river flow rate and water quality and rainfall) to analyze their performance under an uncertain environment. As detailed (time intervals in minutes) environmental monitoring data especially on water quality parameters is of limited availability, random sampling is employed to generate a sufficient number of input data sets. This is achieved by mixing and matching data collected at different places or years, that is,a one-year time series data is randomly selected from all available ones of each input variable to combine them into a single data set. For example, n (1 ≤ n ≤ 500) input data sets can be generated by random sampling if there are 5, 10, and 10 time series data for three input variables, respectively. Driven by human activities, dry weather flow (DWF) to the WWTP usually shows recurring daily patterns insignificantly influenced by environmental changes; 5,8 hence, the same diurnal patterns are applied to the flow rate/water quality of DWF in all simulations.
The first m scenario analyses (i.e., data sets #1 to #m in Figure 1) provide the training data for deriving permits (illustrated by the arrow pointing from part II to part III) and the other n-m scenarios for testing the reliability (i.e., the arrow from part II to part IV). Random sampling is conducted to select different data sets for permit development/assessment, which is repeated for q times by the cross-validation technique 37 as illustrated by the red dashed box in part II of Figure 1. As such, the robustness of the permitting approaches against the selection of input data sets can be assessed as presented in Section 2.4.

Permit Development.
To develop the permits, the k RTC strategies are first ranked in all m scenarios as the best strategy in one scenario may not yield superior outcomes in another. In each scenario, the best performance results are used to develop upstream-based permitting and the corresponding RTC strategy is recorded for the derivation of means-based permitting. As multiple strategies will be nondominated in cases with multiple objectives, criteria are defined to select a single, most desirable RTC strategy in each scenario to facilitate permit development. The criteria can be maximization of system performance in one objective (i.e., one aspect of performance is valued more than others) or a converted single objective by assigning weights to different objectives, and/or meeting predefined limits on certain/all performance objective(s). The definition of the criteria depends not only on the preferences of stakeholders but also on the potential of the existing infrastructures which can be estimated from the scenario analyses.
Among the p (1 ≤ p ≤ min (k, m)) high performing RTC strategies selected from the m simulations, the one that appears in the largest number of scenarios is the most promising solution and is chosen as the means-based permit. For upstream-based permitting, the performance of the selected RTC strategy is recorded against the corresponding upstream condition in each scenario, and a regression analysis is then conducted between the upstream data and performance results of the m scenarios. Based on the fitted function, the (50% or 95%) prediction interval 38 is prescribed as the upstream-based permit, that is, the upper and lower limits of expected system performance (e.g., downstream river water quality, energy cost, and GHG emissions as represented by "WQ DS ", "Cost", and "GHG" in part III of Figure 1) for any given upstream environmental condition (e.g., upstream river water quality as represented by "WQ US " in Figure 1).
2.4. Appraisal of Permitting Approaches. Reliability is assessed by comparing the best achievable outcomes among the k strategies in each testing scenario with the performances of the permitted RTC strategy for means-based permitting or with the permitted performances for upstream-based permitting. Reliability of means-based permitting is defined as the percentage of scenarios where the permitted RTC strategy provides the best performance or worse but of acceptable level of deviation in performance. Reliability of upstream-based permitting is measured by the percentage of scenarios where the best achievable performance value falls within the prescribed permit range. q random runs are made, and the average and range of the reliability values show the robustness of the permitting approaches.

CASE STUDY
3.1. Study Site and Its Assessment. The proposed permitting approaches are appraised using a well-studied semihypothetical case, which consists of seven urban subcatchments, a combined sewer system adapted from a literature standard, 39 an activated sludge WWTP based on the Norwich (UK) treatment work, and a hypothetical river. 8,9,28,40 Detailed description of the case study site and its modeling are presented in Supporting Information (SI) Section S1.
Total (un-ionized and ionized) ammonia is the pollutant of particular concern, although processes related to other water quality parameters such as BOD 5 , suspended solids, and DO are also simulated. The total ammonia concentration, in 90th percentile and 99th percentile values as regulated by the EU Water Framework Directive (WFD), 41,42 is assessed at a river reach one kilometer downstream of the discharge of WWTP effluent. There is limited chemical usage in the operation of the studied UWWS, thus energy consumption is used to represent operational cost in this study. As energy consumption is also a reasonable indicator of GHG emissions, 4,43 energy cost is used to indicate both GHG emissions and operational cost in this work. As such, the control schemes are optimized against three objectives in this study, which are the 90th percentile and 99th percentile total ammonia concentration in the river (hereafter referred to as "90%ile AMM" and "99%ile AMM"), and the energy cost entailed in the operation of the UWWS (calculation method provided in SI Section S2).
3.2. Operational and Control Schemes. Following our previous study on integrated RTC, 9 the control scheme is formulated in the "If−Then" rules (provided in SI Section S4) as illustrated below. WWTP inflow rate is monitored for system control as increased inflow (e.g., under wet weather) means higher load to be treated which usually compromises the treatment efficiency if no enhanced effort is applied. Temperature is also monitored as it has a strong influence on the biological treatment efficiency. River water quality is used to represent upstream conditions due to its direct impact on downstream water quality. River flow rate is not used for guiding integrated RTC in this study; however, its influence is examined and discussed as described in Sections 3.3 and 4.5. Based on a preliminary assessment, the threshold values in the antecedent, conditional statement are determined as in the example above to classify good/not-so-good upstream river water quality, dry/ wet weather, and winter/nonwinter period. Although there are eight possible combinations of the states of the three variables in the conditional statement, two aeration tiers (i.e., Y) are used in this study. This can improve the efficiency of the optimization of the tier values with limited compromise in reliability as suggested by a preliminary analysis presented in SI Section S3. The time step for the control is 15 min. The two aeration tier values as well as key operational settings in the UWWS are optimized by NSGA-II to minimize the downstream total ammonia concentration and energy consumption based on a one-year simulation. Details of the optimized operational and control variables and their feasible value ranges are presented in SI Section S5.
3.3. Input Data Sets and Parameter Settings. A oneyear input data set from a monitoring site in the Midlands, UK, is employed for operational and control optimization. For the uncertainty analysis, 100 (n = 100) input data sets are generated by random sampling of 40, 40, and 6 one-year 15 min increment time series of rainfall, river water quality and river flow rate, respectively, collected from different sites and years (2008−2018) in the UK. 44 The six river flow rate data series have the same pattern but at different scales, as they are based on a single one-year time series (i.e., the same one for control optimization) but multiplied by different coefficients (i.e., scaled up or down) so that the ratios between average river flow rate and wastewater discharge rate are 1.5, 3, 4.5, 6, 7.5, and 15, respectively. Thereby, the impact of dramatic variations in river flow rate, which is not impossible especially under climate change, can be simulated and assessed. River water quality has much smaller fluctuations than river flow rate, as represented in annual statistical parameters. As such, the 40 different river water quality data series are scaled so that their median values are similar to that of the input data set used for control optimization (0.1 NH 3 −N mg/L). Eighty (m = 80) of the 100 scenarios are used to develop permits, while the other 20 scenarios for testing the reliability of the permitting

RESULTS AND DISCUSSION
The integrated RTC strategies developed by the multiobjective optimization algorithm are analyzed in Section 4.1, which provide insights on the relationships between the performance objectives and a basis for setting reasonable regulatory targets embodied in the two permitting approaches as presented in Section 4.2. The development processes and reliability of means-based permitting and upstream-based permitting are described in Sections 4.3 and 4.4, respectively. The evaluation of the robustness of the two permitting approaches is presented in Section 4.5. Discussion on the comparison of the two approaches and the implications for real-life implementation is provided in Section 4.6. 4.1. Performance of Integrated RTC Strategies. 49 (k = 49) integrated RTC strategies are found to be nondominated in the multiobjective optimization. They all comply with the legislative constraints on total ammonia concentration but still show diverse performances as presented by the colored dots in Figure 2a ("Optimization results"). A clear trade-off can be seen between operational cost and 90%ile AMM as the pollutant concentration becomes higher when cost decreases, that is, higher cost is required to achieve better environmental water quality. The color of the dots represents 99%ile AMM and transits from blue to red with increasing 90%ile AMM, suggesting the positive correlation between 90%ile AMM and 99%ile AMM. The relationships (trade-off or positive correlation) between the three objectives are unchanged under different environmental scenarios. This is because their correlation coefficients r between cost and 90%ile AMM, cost and 99%ile AMM, and 90%ile AMM and 99%ile AMM lie The performances of the control schemes can vary greatly in different scenarios. This can be suggested from Figure 2a where the results of the 49 RTC strategies in the 100 scenarios are presented in gray circles (i.e., "uncertainty analysis results"). Results of 99%ile AMM are not shown so that the "optimization results" can be clearly seen. Figure 2a shows the wide value range in 90%ile AMM compared to that of the "optimization results". To quantify the variation, nondominated sorting is conducted to select nondominated optimal strategies in each scenario and the performance boundaries (i.e., minimum and maximum values) of the optimal strategies are summarized by boxplots in Figure 2b. Each boxplot is based on 100 minimum/maximum results in one performance objective. The maximum and minimum values, the 25th percentile and 75th percentile and 50th percentile values of each 100 values are presented by the upper and lower whiskers, the lower and upper bounds of box and the black line within the box, respectively. The environmental standard limits for 90%ile AMM (0.3 NH 3 −N mg/L) and 99%ile AMM (0.7 NH 3 −N mg/L) cannot be met even by the best performing RTC strategies in many scenarios. This clearly shows the significance of natural background dynamics in affecting environmental quality compliance.
Compared to the "optimization results" marked as red diamonds in Figure 2b, the minimum and maximum operational cost of the optimal RTC strategies vary within [−0.3%, 0.3%] and [−1.1%, 2.3%], respectively. This corresponds to the results presented in Figure 2c,d, where the minimum (red filled triangles) and range (red unfilled triangles) of operational cost show minor change with the upstream water quality. Moreover, the variation in the cost of single RTC strategies in the uncertainty analysis is between −5.2% and 5.3% (not presented in figures). This shows that energy consumption is, at the face value, insignificantly affected by environmental changes especially in comparison with the fluctuation in downstream river water quality as presented later in this section. However, the level of fluctuation is comparable to that of the savings this technology can bring, for example, 7% of energy saving as mentioned in the introduction section. This suggests the obvious impact of the dynamic environment on the energy consumption, however its proportion to the total amount is low as a considerable amount of energy input is necessary for the running of the treatment process even under the optimal way of operation.
By contrast, the variations in the minimum and maximum total ammonia concentrations are much bigger, which are between [−37%, 78%] and [−26%, 147%] for 90%ile AMM and [−20%, 612%] and [23%, 499%] for 99%ile AMM. The great variations in 99%ile AMM are largely caused by the change in upstream conditions as the correlation coefficients between the upstream 99%ile AMM and the minimum and the range in downstream 99%ile AMM are 0.92 and −0.53, respectively. The minimum downstream 99%ile AMM is close to the upstream 99%ile AMM value, as can be seen in Figure   Figure 3. Illustration of the selection of desirable, optimal RTC strategy for permitting.  Figure 2c). Moreover, the difference in 90%ile AMM by various RTC strategies can be comparable to that of the upstream 90%ile AMM. This indicates the strong influence of the operational and control scheme of UWWSs on 90% AMM (but not on 99% AMM). 4.2. Selection of Optimal RTC Strategies for Permitting. Due to the high sensitivity of downstream water quality to upstream changes as shown in Section 4.1, it is impossible to apply the traditional outcome-based permitting approach and set fixed limits on all performance outcomes. This highlights the significance of the permitting studies in this work.
As the operational cost of an RTC scheme is subject to minor change under different environmental scenarios, a threshold limit of cost can be set by stakeholders to restrict system performance in this aspect. £0.77 million is used in this work which is approximately the average of the median values of the two boxplots in the first subplot of Figure 2b. Among the RTC strategies that yield lower operational cost than the threshold, the one that produces the highest environmental water quality is selected for permitting. As such, the RTC strategy that can provide the best and balanced environmental outcomes that suits the local needs can be identified and used. Note that other screening criteria can be used as long as one RTC strategy can be selected in each scenario.
The screening process is illustrated in Figure 3 using results from one scenario. The performances of the optimal RTC strategies are plotted against the three objectives in Figure 3a and against the pair of objectives between cost and 90%ile AMM/99%ile AMM in Figure 3b,c. Strategies below the blue surface in Figure 3a (the threshold for operational cost), which correspond to the dots below the dashed lines in Figure 3b,c, are assessed further for their environmental water quality. The strategy presented in the red triangle ("Sol (min 99%ile)") yields the lowest 99%ile AMM; however, its 90%ile AMM is slightly higher than the strategy shown as the red square ("Sol (min 90%ile)"). This highlights that a conflict can exist between the two statistical parameters on total ammonia concentration, despite their strong correlation in general. As the difference between 90%ile AMM is much smaller than that of 99%ile AMM, as observed in this scenario run (Figure 3b,c) and others, 99%ile AMM is used as the key criteria for the selection of RTC strategy for permitting. As such, permits are developed based on strategies that can provide the best overall environmental water quality while satisfying the restriction on operational cost. 4.3. Means-Based Permitting and Its Reliability. Fourteen RTC strategies are selected in the 80 scenarios for permit development, which show superior results in 17, 14, 13, 9, 7, 6, 4, 4, 1, 1, 1, 1, 1, and 1 scenarios, respectively. The settings of the 14 RTC strategies are provided in SI Section S6. The top two high performing RTC strategies have very similar features compared with others, for example, overflow thresholds are relatively high and storm tank emptying rates are low. As such, the storage capacity in the UWWS is fully utilized reducing overflow spills; also the storm tank is emptied at a low rate to reduce the hydraulic shock to the treatment process. The second top strategy has a larger low tier aeration rate; hence, it is prone to exceed the limit on energy cost. As strategy No. 14 performs the best in the largest number of scenarios, it is the most desirable RTC strategy, and its control rules/settings are prescribed as the permit for this case study.
The performance of the permitted RTC strategy is compared to the best performances in the 20 testing scenarios, identified according to the same criteria described in Section 4.2. The percentages of deviation in cost, 90%ile AMM, and 99%ile AMM are plotted in Figure 4a in white diamonds, green squares, and red triangles, respectively. It can be seen that the permitted strategy is the best solution in five testing scenarios where the three symbols overlap at y value of zero; in scenario No. 10, its 99%ile AMM is slightly higher (0.05%) than the optimal solution but the cost and 90%ile AMM are both lower. Based on the performance results in Figure 4a, the reliability of means-based permitting can be derived, which is dependent on the acceptable level of deviation in system performance as shown in Figure 4b. For example, the reliability is 25% (i.e., × 100 5 20 ) if no deviation is allowed. The reliability becomes 30%, 70%, 75%, 80%, 90%, 95%, or 100% if 1%, 5%, 7%, 8%, 9%, 10%, or 15% of performance deviation (only higher values, i.e., worse performances, are accounted as deviation) are acceptable, respectively. 4.4. Upstream-Based Permitting and Its Reliability. As river water quality is the only upstream condition factor incorporated in the control algorithm, downstream performance is prescribed as a function of upstream water quality. For each testing scenario, the best achievable, desirable downstream 90%ile or 99%ile total ammonia concentration is presented against the upstream river quality value by a gray dot in Figure 5a,b. As the data points suggest a linear correlation, they are fitted to linear functions and the 50% (solid lines with gray colored fillings) or 95% (dashed lines) confidence interval (CI) of the fitted functions is set as the upstream-based permit. The top and bottom lines of the 50% or 95% CI are almost parallel to each other as can be seen from the summary of interval ranges at different upstream water quality (i.e., the "Interval range" column marked in Figure 5). The higher the level of confidence, the wider the value range for the permit. For example, if 90%ile AMM at upstream is 0.15 NH 3 −N mg/ L, the permit for the downstream 90%ile AMM is [0.22, 0.36] NH 3 −N mg/L if using the 50% CI or [0.16, 0.42] NH 3 −N mg/L if the 95% CI is employed. As environmental changes have limited impacts on operational cost of the UWWS, £0.77 million is set as the permit for any upstream conditions but a minor range of deviation (e.g., 5% as suggest in Section 4.1) can be allowed.
The permits are compared against the best performance results in the 20 testing scenarios (red triangles in Figure 5) to Environmental Science & Technology pubs.acs.org/est Policy Analysis assess the reliability of the upstream-based permitting approach. Results on the reliability are marked in Figure 5, which is derived by counting the percentage of red triangle data points that fall within the CIs; those that are below the CIs are not considered to be desirable as higher river quality is likely to yield higher GHGs. The reliability of the permit on 90%ile AMM is 70% if the 50% CI is used, which increases to 80% if the 95% CI is permitted. The reliability of the permit on 99%ile AMM is 65% or 100% if the 50% or 95% CI is used. As the permit on operational cost is a requirement rather than a prediction, it is not considered in the assessment of the reliability of upstream-based permitting. However, the necessity of incorporating cost limit in the permit is discussed in Section 4.5. 4.5. Robustness of the Permitting Approaches. Figure  6 shows the change in the reliability of the two permitting approaches in the 200 random runs, based on which the robustness (average reliability) values can be obtained as marked in red diamonds in Figure 6a and in the legend of Figure 6b. Each boxplot in Figure 6a is based on 200 reliability values by the random runs. The reliability of means-based permitting can vary as great as 50% for low levels of performance deviation. The average reliability is 22%, 53%, 85%, 97% or 100% if 0%, 5%, 10%, 15%, or 19% of performance deviation is allowed, respectively, all of which are slightly lower than those obtained in Section 4.3 (i.e., 25%, 65%, 90%, 95%, and 100%, respectively). The reliability of upstream-based permitting is also sensitive to the use of data sets, especially if the 50% CI is employed for permitting. The reliability range between [75%, 100%], [80%, 100%], [40%, 95%], and [40%, 95%] for 90%ile AMM&95% CI, 99%ile AMM&95% CI, 90%ile AMM&50% CI, and 99%ile AMM&50% CI, respectively. Their average reliability values are 92%, 96%, 69%, and 68%, respectively, which are close to    Figure 6b (especially those related to the 50% CI), the value range of an upstream-based permit is quite wide (i.e., large x value in Figure 6b) rendering the environmental protectiveness of this permitting approach in doubt. As such, the best achievable, desirable performances in each testing scenario are compared with the upper permit values (i.e., the less stringent boundaries) for deeper understanding of the upstream-based permitting. Figure 7a illustrates how the calculation is made using the red triangle with coordinate values of x 0 and y 0 , which represents the best performing RTC strategy in one testing scenario. Comparisons are made between y 0 and y 1 or y 2 (i.e., the upper permit values based on the 50% or 95% CI), and the results of  Figure 7c,d although they are based on maximally 100 scenarios. This is because the confidence intervals change when different scenarios are selected for permit development, that is, y 1 and y 2 would vary in different random runs resulted from the change in l 1 and l 2 in the example in Figure 7a. Results in Figure 7d are lower than but similar to (e.g., the distribution of the data points, color pattern) those in Figure  7c, which can be expected as the upper line of the 95% CI is above and almost parallel to that of the 50% CI as shown in Figure 7a. The performance deviation in 90%ile and 99%ile AMM lie between [−58%, 47%] and [−63%, 34%], respectively, against the 50% CI based permit and [−65%, 25%] and [−70%, 17%], respectively, against the 95% CI based permit. A high, positive deviation value indicates the permit is too strict and is not technically achievable or can only be met using operational schemes that emit more GHG emissions than desired, while a high, negative deviation value suggests the permit is too relaxed which poses an environmental threat.
To illustrate the real-life implications of the upstream-based permitting from another perspective, the RTC strategies (out of the 49 high performing RTC strategies) that comply with both 90%ile and 99%ile AMM permit limits in each of the 4000 testing cases are identified, and the results are summarized in Figure 7b. The black dot or red diamond at x = 0 show that the permit (base on 50% or 95% CI) is not technically achievable in 705 or 100 testing cases (i.e., y = 705 or 100). On the other hand, all the 49 RTC strategies can meet the permit in 105 or 1831 testing cases (i.e., the y value of the black dot/red diamond is 105 or 1831 at x = 49); yet many RTC strategies do not meet the constraint on operational cost as shown in Figure 3 and Section 4.2. This clearly shows that overly high GHG emissions are possible if they are not regulated in the upstream-based permitting.
A clear color pattern is exhibited horizontally in Figure 7c,d, that is, higher performance deviation in 90%ile AMM (not 99%ile AMM) at lower dilution ratio (the dot color is dark blue at larger x value). This shows that 90%ile AMM is strongly influenced by the river flow rate, and the permit limit on 90%ile AMM tends to be overly tight with lower dilution ratios and vice versa. This suggests the potential to improve the proposed upstream-based permitting by prescribing different permits for different levels of upstream river flow rate. However, the environmental outcomes become highly uncertain under low river flow rate, as can be seen from the wide distribution of dark blue points in Figure 7b,c. As such, the limitation in the upstream-based permitting is evident for low river flow conditions, where effective and reasonable regulation is mostly needed. As such, the upstream-based permitting may not be beneficial to both the WWSPs and the regulators/environment. 4.6. Smart Permitting for Integrated RTC. The purpose of applying the integrated RTC technology is to deliver the best achievable, balanced environmental outcomes against the  Results demonstrate that it is not reasonable to apply the traditional outcome-based permitting and prescribe permit limits on downstream river water quality as it is strongly influenced by the upstream conditions (especially 99%ile AMM). It is beyond the capability of the integrated RTC technology (and even any other technologies) to achieve a predefined downstream environmental target under any conditions. UWWS discharges are found to be a significant factor in influencing 90%ile AMM; moreover, a linear function can be reasonably established between the upstream and downstream 90%ile AMM based on the optimal and desirable integrated RTC strategies. As such, upstream-based permitting seems to be promising for the regulation of UWWSs applying recipient responsive integrated RTC. However, results show that 90%ile AMM is also influenced by the dilution capacity of the environment, and the upstream-based permit based on input data sets covering all flow regimes tends to be too relaxed to be environmentally protective if the river flow rate is high and too strict to be technically achievable under low river flow conditions. This approach can be improved by setting different permits for different flow regimes; however, its performance under low dilution ratio conditions is likely to be unsatisfactory and needs to be addressed in future studies.
The means-based permitting, which prescribes the control scheme and settings to be followed, is an unconventional regulatory approach especially for the wastewater industry. However, this work suggests that it is actually a viable and more reasonable approach for the regulation of integrated RTC than the traditional outcome-focused approach. Although the permitted RTC strategy is not likely to provide exactly the best achievable results in all/most situations, the performance is still satisfactory. In the case study of this work, the reliability can be over 80% if 10% of performance deviation from the best achievable outcomes is allowed.
The upstream-based permitting provides more flexibility in system operation (favorable to WWSPs) and less managerial burden to the regulators. For example, for means-based permitting, there is a need to validate the accuracy of the integrated UWWS model and the representativeness of the input data sets in permit development and to carefully audit for the review of permit compliance. However, it is difficult to predict the best achievable river water quality under the stochastic river dynamics. As such, the upstream-based permitting is likely to pose a high risk to both the WWSPs and the environment. By contrast, the uncertainty in the performance of the integrated RTC technology is much lower. We found that the comparative performance of different RTC strategies is subject to minor changes at different environ-mental conditions, which is key to the reliable and robust performance of the means-based permitting. By applying the proposed framework of permit development, a control scheme that balances the different (even conflicting) environmental objectives and suit local needs can be identified and permitted. For practical implementation of the means-based permitting, the prescribed control settings may be allowed to vary within a limited range as proposed by prior studies, 29