Integrated model predictive control of water resource recovery facilities and sewer systems in a smart grid

An integrated model predictive control (MPC) strategy to control the power consumption and the ef ﬂ uent quality of a water resource recovery facility (WRRF) by utilizing the storage capacity from the sewer system was implemented and put into operation for a 7-day trial period. This price-based MPC reacted to electricity prices and forecasted pollutant loads 24 hours ahead. The large storage capacity available in the sewer system directly upstream from the plant was used to control the incoming loads and, indirectly, the power consumption of the WRRF during dry weather operations. The MPC balances electricity costs and treatment quality based on linear dynamical models and predictions of storage capacity and ef ﬂ uent concentrations. This article ﬁ rst shows the modelling results involved in the design of this MPC. Secondly, results from full-scale MPC operation of the WRRF are shown. The monetary savings of the MPC strategy for the speci ﬁ c plant were quanti ﬁ ed around approximately 200 DKK per day when fully exploiting the allowed storage capacity. The developed MPC strategy provides a new option for linking WRRFs to smart grid electricity systems.


INTRODUCTION
The transition towards an increasing share of renewable energy sources is an essential step to reduce CO 2 emissions and mitigate severe climate change.This transition requires the implementation of smart grids; that is, making electrical grids able to cope with highly fluctuating sources (such as wind and solar power) while being able to match supply and demand ( Jørgensen et al. ).This can be obtained by either storing the electricity for later use or by modifying the consumption accordingly.Since energy storage is currently very expensive, a cheaper alternative is to modify the power consumption of flexible consumers by using intelligent control and communication methods (Madsen et al. ).The fluctuations in the electricity prices provide economic incentives to implement flexible controls of electricity consumption.This concept is also referred to as Demand Response (Palensky & Dietrich ; O'Connell et al. ).
As discussed in Olsson (), there is a great potential for interactions between the energy and the water sector.Integrated operation of urban wastewater systems or minimization of energy consumptions have been investigated by, for example, Kroll et al. (), who found that synchronizing sewer storage volume with WRRF aeration control led to savings of 2.5% in total energy and improved TN effluent as well as CSO activity.When looking at applications of Demand-Response systems, examples are mostly found for water supply systems, with examples focusing on energy optimization of wellfield operation for groundwater extraction (Bauer-Gottwein et al. ), or for pumping and treatment (Zimmermann et al. ).Wastewater transport and treatment can also potentially be integrated into a smart grid due to their large and geographically distributed consumption (Thompson et al. ; Reinhofer-Gubisch & Pucker ; Kirchem et al. ).
The idea of including electricity prices into control and operation of water resource recovery facilities (WRRFs) was first mentioned in Tassou () over three decades ago.Aymerich et al. (, ) simulated the minimization of aeration costs based on varying energy tariffs through an ammonium controller and a modified BSM1 model (Gernaey et al. ).Savings were in the range of 4-11% while maintaining effluent quality, and storing peak flows in expensive energy periods resulted in 13% savings.Stentoft et al. (a) showed up to 21% reduction in costs of effluent taxes and electricity by using variable electricity prices in a model predictive control (MPC) strategy as compared with a rule-based control.Brok et al. () showed a methodology to incorporate flexibility in aeration control for providing flexibility on short term electricity markets (i.e.providing regulating power capacity).These controls sometimes increased the total energy consumption, but lowered the total cost when moving the peak consumption to cheaper operating hours, and the savings depend on various performance criteria.In practice, connecting a WRRF within Demand-Response systems requires the ability to buffer the incoming wastewater and delay wastewater treatment to periods with cheaper electricity prices while complying with environmental discharge regulations.This implies the ability to store wastewater during high-price periods.This storage is usually available in combined sewer systems, which are designed to cope with the high flows taking place during wet weather periods.In fact, combined sewer systems are in dry weather conditions during most of their operational time; that is, there is an excess storage capacity that can be used to delay power consumption for pumping and treatment.Also, an integrated MPC is needed in order to comply with environmental discharge limits, avoid an increase in flooding risk, and minimize the WRRF operational costs based on forecasts of incoming pollutant loads and future electricity prices.Although there are several applications of MPC in combination with Demand Response in, for example, chemical manufacturing plants (Mendoza-Serrano & Chmielewski ) or supermarket refrigeration (Hovgaard et al. ), no examples are yet found in literature for integrated urban wastewater systems.
In this paper, we propose an integrated MPC strategy connecting WRRFs and sewer systems and offering flexible energy consumption in a smart grid system.We apply a Demand-Response control to exploit the excess storage capacity in the sewer system in order to change the WRRF power consumption according to electricity prices.Because of this Demand-Response setup, the method will be directly applicable in the remaining part of the Nordic electricity market.Furthermore, it is believed that only a few modifications in the correspondence time and prediction horizon will be needed to apply in other markets worldwide.Since the major energy-demanding process is wastewater aeration to remove nitrogen, we consider the total nitrogen in the effluent as a measure of treatment quality.We show how to implement an MPC strategy that changes the inlet flow to the WRRF and minimizes the electricity costs while keeping effluent quality within regulatory limits.After testing the strategy in a simulation study, we provide results and evaluate the performance from actual operation of the Kolding WRRF, Denmark.

Case study
The Kolding integrated catchment The integrated MPC was developed and tested for the integrated system (combined sewer and WRRF) in Kolding, Denmark.The hydraulic performance and the availability of storage volumes in the combined sewer system for control purposes was investigated in Bjerg et al. ().Wastewater from the Kolding urban area is conveyed to a pumping station, which pumps it to the 125,000 PE WRRF located 8 km away.There are 21 storage basins spread across the catchments, with a total storage volume of 30,000 m 3 .However, for this initial study, only a large storage pipe located upstream of the plant inlet (with a volume of approximately 6,000 m 3 ) is considered.A water level sensor is located in the pipe and used to estimate the stored water volume.
The Kolding WRRF utilizes the BioDenitro process (Bundgaard et al. ) for N removal, with two alternating aeration tanks for each of the two plant lines.The maximum power capacity for the biological aeration process is 720 kW, and aeration is responsible for at least 60% of the power consumption of the WRRF, in line with similar values found in literature (Plappally & Lienhard ; Gu et al. ).
The plant electricity bill is currently paid via a retailer, EnergiDanmark, and a small part of the price changes every hour.This hourly price is known 12 to 36 hours ahead and originates from the power exchange NordPools day-ahead market.The estimated yearly consumption of the Kolding is 2.7 GWh.

Electricity price
In Denmark, larger consumers with an annual energy consumption above 100 MWh are billed an hourly time-varying electricity price, the Elspot price.This price is settled every day at noon for the coming day from midnight to midnight in the different geographical areas of the electricity market.Consequently, after settlement at noon, the price is known 36 hours ahead.Before settlement at noon, the price is known and fixed at least 12 hours ahead.Our prediction horizon is N p ¼ 24 hours, so consequently we need forecasts of the price from midnight to noon where the price is known less than 24 hours ahead.EnergiDanmark, the Balance Responsible Party of Kolding WRRF, provides online forecasts of the price.Modelling and forecasting this price is not part of this work, but details can be found in Jónsson et al. ().Due to the composition of the Danish electricity system, wind power plays a major role in price fluctuations (Jónsson et al. ); that is, a higher share of renewables sources results in lower electricity prices.

Effluent concentration limits and taxation
The maximum allowed discharge concentration for total nitrogen is S N,max 8 mgN/l.In addition, the Danish legislation imposes taxation on pollutant loads discharged by WRRFs, with the fee for total nitrogen set at p fee ¼ 30 DKK/kgN for 2019-2020.The taxed annual loads are calculated based on 24-hr composite samples that are collected at fixed intervals (2-4 weeks according to the plant capacity).These discrete concentration values are combined and then multiplied by the total annual discharged volume.

Overall MPC strategy
In model predictive control of integrated sewer and wastewater systems, the optimal control is recursively recalculated over a specified, finite time horizon (here N p ¼ 24 hours) based on current and updated information about the state of the system as well as information about future inputs to the system.For this purpose, an MPC model with associated forecasts of the inlet flow, effluent quality and power consumption is needed, and an MPC optimization model, needs to be specified.The MPC operates only in dry weather conditions.When rainfall is predicted by Numerical Weather Predictions (similarly to the example presented by Courdent et al. ()), the integrated system switches to a rule-based wet-weather control, aiming at minimizing the risk of combined sewer overflows.

System conceptualization
The Kolding integrated wastewater system is schematized in Figure 1.The storage pipe upstream from the pumping station is described by the volume V, while its inflow is defined as qin (t).The only actuator controlled by the MPC is the pumping station, and the control strategy defines setpoints for the outflow q(t) from the pumping station (i.e. the inflow to the WRRF).The MPC only controls the pumps that are normally active during dry weather and hence, for full-scale tests, the upper bound on q(t) is lower than the true.The WRRF is described as a noncontrollable unit that removes the nitrogen in the incoming wastewater load; that is, aeration is controlled by the existing WRRF control.The WRRF effluent concentration is defined as S N (mg/l).
The total energy consumption u is the sum of the energy consumption for pumping ( u pump) and aeration (u WRRF ), both expressed as kW.
The water balance in the storage volume V [l] is defined as: The volume and the flow are physically limited and must lie within some operator-specified bounds to avoid an increased risk of overflows and flooding.

Dry weather inlet flow forecast
The diurnal inlet flow during dry weather to the storage pipe qin (t) is often modelled as a second order Fourier series (Langergraber et al. ).Using a period of T ¼ 24 h, the model is locally linear with frequency ɷ ¼ 2π/T.The parameters a and the flow q in can be estimated for each time step as a least squares optimization problem: The flow constraints (q min in , q max in ) ensure positive flows.Exponential weights W are used to prioritize the newest measurements in the parameter estimation dataset (e.g.Madsen ).Wet weather periods are removed from the estimation data set by eliminating inlet flows above a certain threshold.This approach is useful for describing slowly varying parameters, and the model adapts to changing conditions and long term variation in the parameters.The estimate is run with same frequency as the MPC (hourly time steps).

Effluent quality model
The main control inputs of the BioDenitro process are phase time and aeration intensity (Isaacs et al. ).The effect of these on nutrient removal can be modelled effectively using real-time nutrient measurements in the data-driven modelling framework suggested in Stentoft et al. ().However, as the investigated MPC controls the effluent quality and the power consumption by manipulating the plant inflow q(t) and hence not the before-mentioned signals.Therefore, the MPC requires an even simpler model that does not use online nutrient measurements but yet describes the short term nitrogen removal processes over the time horizon used for optimization (here, 24 hours).Based on hourly time steps, the following linear model was found by visual inspection to fit the effluent concentrations in a satisfactory manner: where θ i are coefficients to be estimated.The total effluent nitrogen concentration S N is approximated by using the 2-min concentration measurements of NH 4 and NO 3 from the aeration tank.These measurements are resampled to hourly values and then used as a model estimation data set.
The coefficients θ i and the current total N (S N ) concentration are continuously estimated by using Maximum Likelihood Estimation and a Kalman Filter (Kristensen et al. ).
These methods are implemented in the R-package ctsmr (Juhl et al. ; R Core Team ).The Kalman Filter also estimates the missing observations in the dataset.
During normal pump operations, flow and effluent concentrations appear to be correlated and to show a daily pattern.However, this correlation decreases once the MPC is implemented.Storing wastewater in the storage volume V may furthermore build up the NH 4 concentration in a non-linear way that is not taken into account in Equation (3).However, since no water quality measurements are available in the combined sewer system to model such behaviour, this was neglected in this first version of the MPC.

Power consumption model
Figure 2 shows measurements of the pumping flow rate q(t) along with the corresponding pump power consumption u pump .While the pumping power consumption for a single pump usually grows quadratically with flow, the pumping station in Kolding includes a set of pumps that operate in different flow setpoint intervals.This leads to a more complex relationship between flow and power consumption, which is still, considering the local and short-term dynamics, approximately linear: where θ u are coefficients to be estimated.
Similar to Bjerg et al. (), a linear relationship is assumed between flow and power consumption at the WRRF: (5) with θ u ¼ 0.174 k Wh/m 3 .

MPC optimization model
A

Minimizing electricity cost
The controlled pump flow rate q(t) is formulated as a vector q ∊ R Np over the prediction horizon of N p samples (with sampling period of 1 hour and N p ¼ 24).So q contains one flow setpoint for each hour the next 24 hours.After finding the optimal flow set points, only the first value for the current time step is sent to the pumping station and actuated.This process is repeated in the following time step when new measurements and predictions are available, providing closed-loop feedback and adjusting for model and prediction errors.
The following optimization problem defines the MPC that calculates the optimal pumping flow rate setpoints given a forecast of electricity prices and inlet flow: q min q q max (6f) Δq min Δq Δq max (6g) where P* elspot is the Elspot price forecast; u is the total power consumption that should be minimized over the price; q min and q max are the flow setpoint constraints ([0, 900] l/s); V min and V max are the storage volume constraints, which were set to [1,500, 5,500] m 3 in the demonstration period; Δq min and Δq max limit the hourly changes in flow set points.These act as a tuneable smoothening effect of the controlled flow that prevents hydraulic waves to the WRRF, and they were set to Δq max ¼ q max /5 and Δq min ¼ Àq max /5.
If the volume exceeds the capacity, a slack variable ρ ∊ R Np accounts for the overflow volume in dry weather (i.e. to avoid unwanted spills of the stored wastewater).This is heavily penalized in the objective function by using a high cost (ρ ¼ 1,061).The slack variable is not only a measure of the overflow, it also makes sure that the optimization problem is feasible even though a small overflow might exceed the constraints, for example due to uncertainty in the dry weather flow or noisy volume measurements near the constraints.The volume measurement error is assumed to be negligible compared to the volume size, and thereby no data assimilation is included to update the modelled storage volume.MPC aiming at reducing CSO in wet weather typically adopt additional terms to increase robustness (e.g.penalization of stored volumes).These would however be in direct contrast with the objective of the proposed approach, which only operates in dry weather.

Minimizing electricity cost and respecting regulatory effluent quality limits
In the MPC problem, the effluent concentration S N is assumed to be a continuous variable that must be minimized.The average effluent concentration is: where the plant effluent is assumed to equal the influent to the plant, q(t).The nitrogen load mN used for taxation can then be expressed as: Combining the flow weighted effluent quality model (Equation ( 3)) with the MPC optimization model (Equation ( 6)) results in the following problem: subject to: S N S max N (9b) (3), (6b), (6c), (6d), (6e), (6 f), (6g) (9c) The objective function has a non-linear term mN (q) defined in Equation ( 8) as the product between two of the optimization variables.This nonlinear term is replaced by an impulse response model of Equation ( 3) with impulse response matrix H u .The objective term then changes to P fee mN (q) ¼ P fee q T H u (θ)q þ p T 0 q (10) with the constant vector p 0 ¼ (H 0 x 0 þ H d d)p fee .This transforms the problem from Equation ( 9) into a Quadratic Programming (QP) problem.The MPC now reflects the most important economic operation costs.

Solving the MPC optimization problem
A MPC problem can be formulated on a more general form as: The MPC problem described previously in ( 6) has only a linear objective term (i.e.H ¼ 0 in Equation ( 11a)), and it can be solved by using a Linear Programming (LP) solver in R (Berkelaar et al. ).Consequently, the differential Equation (6b) can be rewritten as a sum of matrix vector multiplications; that is, the impulse response model (Prasath & Jørgensen ).This impulse response model fits into the solver as the linear matrix inequality (11b).This implies that the MPC optimization problem (Equation ( 9)) can be managed by converting it to a standard Quadratic Programming (QP) form (11) where the optimization variables are augmented in x ¼ [q T ; u T ; s T ] T .This problem can be solved by using a QP solver, which finds the optimal x that minimizes the objective function.The QP solver from the Rlibrary quadprog (Goldfarb & Idnani ; R Core Team ) was used in this study.Running this solver on the WRRF control system hardware solves this relatively small convex MPC problem in milliseconds.

Electricity savings
The MPC described in Equation ( 6) (focusing only on electricity cost minimization) was simulated by using the measured inlet flows from a 160 day period starting on 1 September 2015.Electricity prices and future inlet flows were assumed to be known; that is, these simulations indicate the upper bound for the performance of the MPC.

Effluent quality and electricity savings trade-off
The trade-off between electricity costs and effluent quality was investigated by using the MPC from Equation ( 9) with a different objective function: In this formulation, a tuneable parameter α ∊ [0; 1], weighting the trade-off between the effluent quality and electricity cost savings for one particular day, is introduced.When α ¼ 1, only the effluent quality is maximized.When α ¼ 0, the power consumption is moved to the cheapest period possible without taking effluent quality into account.

Full-scale demonstration
The MPC was tested in full-scale operations for 2 and 5 days in November and September 2015, respectively.

Dry weather inlet flow forecast
An example of the fitted inlet flow forecast model is shown in Figure 3, which shows the hourly measurements of the inlet flow q in (t) over one day, along with fitted the Fourier series model and the expected future (i.e.forecasted) inlet flow for the next 24 hours.

Electricity savings
Figure 4 shows the daily savings obtained for the 160 days simulation period with average daily savings of 170 DKK/day relative to the normal operation where the dry weather flow is sent directly to the WRRF. Figure 5 shows the value of potentially using additional storage basins across the catchments and thereby increasing the storage volume and increasing the maximum pump flow q max from Equation (6f).After a certain volume, the increase in the savings slowly decline.The savings can also be boosted by increasing the allowed maximum flow.Indeed, to fully exploit the storage capacity available in the system (above 30,000 m 3 ), a high q max should be used.This is particularly interesting, as most implementations of the algorithm will require considerations of the upper bound on the volume, V max .In this context, V max close to the actual physical limit for CSOs means that the system is not very robust against unpredicted events, without providing significant improvements in terms of savings.Hence, changing V max represents a trade-off between savings and robustness.Note that the effluent concentrations are not included in this approach, and hence the regulatory fee is not included in the savings.This is however discussed using (12) in the next section.

Effluent quality and electricity savings trade-off
Figure 6 shows the trade-off between effluent quality and electricity costs when α is varied between 0 and 1.The savings and effluent quality were calculated for a single openloop trajectory that provided the optimal flow setpoints over one day.However, the MPC optimization model in Equation ( 9) has real prices as weights in the objective function and it is not tuneable.However, it is possible to find the point when the weights are equal to the actual prices; that is, the current regulatory fee p fee ¼ 30 DKK/kg and the Elspot prices for that chosen day.As expected, the higher regulatory fee reduces the potential electricity cost savings on the particular day, as shown in Figure 6, but it reduces the emission of nitrogen to the environment.This is because a higher regulatory fee implies a lower weight on the electricity prices in the optimization of the economical objective function ( 12), and hence the daily savings in electricity costs are lowered.However, it is noted that the total savings (including electricity and fee) might not be equally lowered.

Full-scale demonstration
Figure 7 shows how the MPC optimization aimed at minimizing electricity costs (Equation ( 6)) controlled the flow in full-scale operation for 2 and 5 days in November and September 2015.The MPC adjusted the flow setpoint q based on the predictions of both the electricity price and the incoming flow.It did not take the effluent quality into account, but it did include the power consumption.
The uppermost plot in Figure 7(a) shows how the flow setpoint is high during periods with low electricity prices and low during periods with high electricity prices.The middle plot shows the volume and the volume constraints.The lower bound is violated a few hours during two of the days.The main reason is the uncertainty in volume measurements at low storage volume.
The uncertainty in volume measurements also influences the estimation of low inlet flows: in fact, this was negative during these periods (bottom plot).The controller truncated all inlet flows below zero and did not account for this error.
Other factors impacting the constraint violations were inlet flow forecast errors and rate of flow setpoint change limitations.Faster sampling time and robust handling of uncertainty could eliminate some constraint violations.One computationally efficient way of dealing with this uncertainty is simply to tighten the volume constraints a bit.The error in flow forecasts might also lead to suboptimal control actions.This is for instance likely to be the case in Figure 7(a) at hour 37.Here pumping is reduced only to increase pumping in the following hour where electricity is more expensive.However, looking at the actual inflow in this period, it seems to follow a diurnal variation poorly.
The other test period depicted in Figure 7(b) also shows some problems with constraint violations.However, from  the bottom plot it is obvious that the volume constraint violation was caused by sharp spikes in the dry weather flow (e.g.wastewater discharges deviating from typical daily profiles) that are not accounted by the dry weather forecast model.This stresses the fact, that for the general application of this methodology, V max must be chosen wisely by including a safety margin to account for uncertainty in the inlet forecast model.In this test period, the minimum allowed flow setpoint for q was 160 l/s.Consequently, the controller was forced to pump out water even though the volume was below its minimum constraint.The upper volume constraint is also violated between hours 48 and 72.This is due to bad estimation of the volume caused by uncertain/noisy measurements.It is noted that this did not cause any CSO.Furthermore it is noted that the effluent requirements for the WRRF were satisfied during both entire test periods.
The MPC was also compared against a controller where the diurnally varying dry weather load is sent directly to the WRRF; that is, q(t) ¼ q in (t).In practice, the volume is today controlled through rules reacting to volume levels.Unfortunately, the linear model used for including the effluent quality was not sufficient for control in all operating conditions.In future work, this model should be studied in detail using data that cover more operational periods and/or extended with details describing the control of the WRRF (e.g. by using the model in Stentoft et al. ()).
As discussed earlier, the implementation of a new control strategy must not cause CSO events in dry weather.However, erroneous estimations of the stored volume and uncertainty in the inlet forecast might lead to unwanted discharges.Therefore the definition of V max should include a safety factor with a buffer volume.Additionally, the dry weather forecast model might be improved by, for example, including a stochastic approach.Although negligible, the risk of CSO discharges in dry weather cannot be completely avoided, and it should therefore be included in the multicriteria analysis performed before choosing to implement the proposed MPC.
Furthermore, there is an additional risk of increasing CSO in wet weather due to errors and false negatives in the NWP used to switch to wet-weather operation (which can e.g.lead to a late emptying of the storage volume).In the 5-day test period the average savings were approximately 200 DKK/day as compared to a similar historic period.Although such monetary value might appear negligible compared to the overall WRRF costs, this should not shadow the novelty represented by this first application of Demand-Response MPC to a full-scale integrated wastewater system.The entire control of the Kolding integrated system has recently been migrated to a cloud system, allowing integration with other energy based controls (e.g.Stentoft et al. a) with possible increase in savings.Investigations of the proposed MPC for catchments with similar energy markets and more favourable characteristics (e.g.gravity driven flow to the WRRF) are suggested.
This simple model structure is in fact well suited for control and it provides an important building block for expanding the control to bigger sewer systems.Electricity prices are usually low in periods with high shares of renewables, so price based control creates an incentive to integrate more wind power in the system.In some hours of the year in Denmark, negative electricity prices are observed due to the high share of wind power in the power system.Prices can also be generated to provide ancillary services like voltage control or congestion management.The importance of these markets (and thereby the economic return) is growing due to the decreasing importance of traditional power plants (currently used for e.g.frequency stabilization) across electricity networks.Since WRRFs electricity demand corresponds to an average of 1% of a country's electricity consumption (Shi ), these could provide a substantial capacity reserve in the power markets.In fact, as the need for flexible energy increases (Morales et al. ), this reserve might become necessary to exploit.Furthermore, investments made by WRRFs to implement the proposed controls would spare society from the need to upgrade the existing infrastructure.These economic savings at the societal level could therefore be acknowledged and re-distributed to WRFF operators through economic incentives (e.g.changes in taxation), decreasing the return of investment of the MPC.
Focusing the MPC on a single performance indicator might lead to a worsening of other aspects, as in the example presented by Flores-Alsina et al. ().Current research is focusing on testing the proposed MPC on a dynamic WRRF model to allow for a long-term performance analysis for a range of different performance indicators.Following this philosophy, possible extensions of proposed control can include combination with other MPC strategies mainly focusing on control of the removal processes (e.g.Stentoft et al. a), boosting their overall performance not only in monetary terms, but also in other performance criteria (e.g.CO 2 emissions, eutrophication impacts, acidification of receiving water bodies etc.) (Stentoft et al. b).

CONCLUSION
This paper illustrates the first application of model predictive control (MPC) in a price-based, Demand-Response set-up to control an integrated sewer-wastewater system during dry weather.The control aims at storing wastewater in the sewer network during periods of high electricity prices, while enabling wastewater treatment in periods when electricity prices are lower.The main findings are as follows: • The MPC optimized the operation of the WRRF over short-term (24-hour) predictions of the hourly electricity price from NordPool.
• The MPC used several dynamic mathematical models as part of the optimization, including models of the upstream storage volume, the power consumption of the pumps and the WRRF, and the inlet flow to and the effluent quality from the WRRF.Updating these models continuously to measurements allowed using simple and fast model structures sufficiently accurately for this short-term optimization problem.
• The proposed MPC showed its potential both in model simulations and full-scale applications at a mediumsized WRRF in Denmark.
• The monetary savings from the Kolding case study were limited (approximately 200 DKK per day).Additional simulations of the MPC over a longer period of time resulted in similar performance.
• A control method that takes the effluent quality at the WRRF into account by considering the sewer system and the WRRF jointly was also presented.
Although the application to the specific Kolding system did not provide great savings in monetary terms, the structure of the proposed MPC enables an easy application in any other catchment.Hence this can provide an important contribution towards the integration of WRRF and sewer system operation in electric smart grids.

Figure 1 |
Figure 1 | Simplified control architecture of the integrated system.

Figure 2 |
Figure 2 | Power consumption and flow rate in the sewer pumping system.24 hours of data from November 2015 resampled to 10 min values.

Figure 5 |
Figure 5 | Savings from electricity costs over 160 days as a function of the flexible volume size and the maximum pump flow.Changing the flexible volume size corresponds to changing the volume constraints in the MPC.

Figure 6 |
Figure 6 | Tradeoff between effluent quality (SN) and savings in electricity costs for the MPC optimization (9) with the tunable objective function (12).The calculations were based on predicted open-loop trajectories at 3 November 2015 09:00.The point p fee indicates the point where the actual economic values of the electricity prices and the regulatory fee together determine the objective function weights.
NWP application was discussed by Courdent et al. (), while Bjerg et al. () showed a negative limited impact on the performance of the Kolding catchment for a simple energy-based control strategy.

Figure 7 |
Figure 7 | Results from full-scale operation of the MPC optimization aimed at minimizing electricity costs (Equation (6)).(a) 61 hours from 2 November 2015 at 06:00.qmin ¼ 0 l/s.(b) 127 hours from 30 September 2015 at 00:00.qmin ¼ 160 l/s, qmax ¼ 520 l/s.The lower plot shows the inlet flow to the controlled pipe volume.The middle plot shows the measured volume and its constraints.The upper plot shows the pumping flow rate determined by the MPC and the actual electricity prices.
Beltrán et al. () furthermore minimized aeration costs based on a model that can be extended to include time-varying electricity costs, and Douglass et al. () and Kebir et al. () mainly considered the pumps at the WRRF as flexible on short-term electricity markets.ESWA () also demonstrated Demand-Response savings in Denmark.
linear objective function is used to formulate an Economic MPC( Jørgensen et al. ; Halvgaard et al. )in order to control the system.Compared to traditional control methods, MPC takes any variable constraints and predictions into account, and it is able to react ahead of time.In this case the MPC moves power consumption to periods with cheaper electricity and larger shares of wind power, while meeting the treatment objectives.