Model Predictive Control of Sewer Networks

The developments in solutions for management of urban drainage are of vital importance, as the amount of sewer water from urban areas continues to increase due to the increase of the world’s population and the change in the climate conditions. How a sewer network is structured, monitored and controlled have thus become essential factors for effcient performance of waste water treatment plants. This paper examines methods for simplified modelling and controlling a sewer network. A practical approach to the problem is used by analysing simplified design model, which is based on the Barcelona benchmark model. Due to the inherent constraints the applied approach is based on Model Predictive Control.


Introduction
Controlling sewer networks is a demanding and necessary task in modern society, that prevents property damages, accidents and more importantly reduces the risk of environmental pollution. Therefore, it is important to manage the sewage water to wastewater treatment plants (WWTPs) as efficiently as possible. Inadequate or no treatment of sewage water can have a major impact on biodiversity in rivers, lakes and the sea, where harmful bacteria and toxic chemicals that are carried by the sewage water, can cause serious health problems and even lead to more deadly epidemic outbreaks such as malaria. Many cities have combined sewer systems and the need for efficient control of sewer networks is going to increase, especially according to some predictions stating that by the year 2050, 80% of the world's population will be living in urban areas [14].
Sewer networks are considered complex systems, as they are geographically distributed and structured for the collection of sewage and run-off water. Usually, sewer systems are divided into two categories: separate or combined. The separate sewer system uses different pipelines for sewage and run-off water, while in the combined sewer system, sewage and run-off water are mixed together in the same pipeline. Whereas, the separate sewer system directs sewage water to a WWTP, the run-off water is released into the environment, treated or untreated, then the combined sewer system, sewage and run-off water are both transported to a WWTP. As sewage water is considered to be more contaminated than run-off water, consequences become more severe when an overflow situation occurs in the combined sewer system, as the risk of contaminated water escaping into the environment is higher. Rainstorms are considered the main influencing factor that cause combined sewer systems to overflow. Therefore, minimizing overflow situations in combined sewer system is a more demanding procedure than for the separate system, making the overall control problem more difficult to manage [16]. In general, waste water is categorized as originating from households, industry and sewage, while run-off water arise when rainfalls occurs. The main purpose of WWTPs, is to purify as much contaminated water as possible, before releasing it back into the environment. Thus, the number of treatment plants needed for a specific sewer network is dependent on the quantity of waste water in the plants' districts and their maximum inflow capacity. This issue is most commonly addressed by controlling flow rates of sewer pipes to maximize treatment plant performance. Furthermore, pipelines are limited by their dimensions and therefore flow quantities need to be controlled within boundary limits of the pipes, by manipulating the flow rates in the pipes.
The focus in this paper is to study the Barcelona sewer network system with respect to control it. A benchmark model of the Barcelona sewer network has been developed by Ocampo-Martnez [9], [11]. Based on this benchmark model, the system is controlled by using Model Predictive Control (MPC). The main reason for choosing the MPC method as the control strategy for the sewer network, relies on its unique ability to include boundary constraints in the optimization procedures for MIMO systems. Further, it is also possible to include prediction of the water inflow from rainfall in the control optimization. The control objectives for system performance are: • Minimize flooding to streets.
• Maximize the waste water treatment plant/plants (less pollution to the environment) For satisfying the the above performance conditions, a MPC problem is formulated with both hard and soft constraints. Hard constraints are used for flows in pipes and levels in the tanks. Soft constraints are used for flooding in streets and flooding to the sea. Simulation with both know and unknown inflow from rainfall is shown in this paper. (The results presented in this paper is based on the work in [13].) The rest of the paper is organized as follows. In Section 2, the modelling of the single elements in a sewer network is presented. A sewer network model is given in Section 3. The model is based on the virtual tank method. Section 4 show a number of simulation results followed by a conclusion in Section 5.

System modelling
Modelling methods are analyzed in this section, in order to find a simple sewer network approach that is applicable to the objectives in this paper. The literature and research material presented in this section is mostly based on Marinaki & Papageorgiou [8], Martnez [9], [11] and in Duran [4]. A suitable modelling method will be selected, which will be used for ongoing analysis.

The Saint Venant Equations
The most general approach when modelling a sewer network, is to use the Saint Venant nonlinear partial differential equations. Assuming that the movement of water is one dimensional, the water flow can be represented as an open channel where the distribution of pressure is hydrostatic, the sewer pipes' cross-sectional areas are constant with a uniform velocity over the cross-section, the flow is incompressible and the average slope in the channel is small, [3].
The general Saint Venant equations are given as: Eq. (1) expresses mass conservation equation. Moreover, the numbered terms in the momentum equation given in eq. (2), describe the following physical quantities, [12]: 1 -Inertia, 2 -Advection, 3 -Gravitational force and 4 -Friction force. The other symbols in eqs. (1) and (2) are as follows: q(x, t) is the flow, A(x, t) is the cross-sectional area of the pipe, t is the time, x is the spatial variable measured in the direction of the sewage flow, g is the gravitational acceleration, I 0 (x) is the sewer pipe slope and I f (x, t) is the friction slope.
Modelling methods for simplified models of sewer networks/channels that include the theoretical basis of the Saint Venant equations are introduced and examined in this section. There exist a number of different model types. The must used models are: The Virtual Tank Model, [8], that are used in this paper, The Hybrid Linear delayed Model described in [4], The Muskingum Model described in [4,1], The Integrator Delay Model described in [10] and The Integrator Delay Model with Zero introduced in [6, 5].

Sewer Network Components
The main elements in a sewer network is introduced in the following.

Virtual Tanks
The virtual tanks are often referred to as catchments, where volume quantities from numerous pipelines are collected together in certain areas. This simplification reduces the amount of system variables significantly. The schematic of a virtual tank component is provided in Figure 1, showing the characteristics and associated parameters. Discretization methods are applied on the Saint Venant equations to obtain a discrete time linear expression for the stored volume in the virtual tanks, [4]. The discrete time difference equation of the virtual tank is presented in eq. (3). The stored volume is denoted as v, the inflow given as q in , the outflow as q out, , the overflow as q over and the sampling time as T s . The inflow to the virtual tank is calculated as: The outflow from the virtual tank is then expressed as: The outflow equation can also be obtained for the nonlinear system, where the relation between them is: Real Tanks Real tanks are actual water containers, which serve an important role within a sewer network, where they can be used as buffers to produce a slack behavior within the system. The inflow and outflow of the tanks can be controlled in order to reduce the risk of overflow and to maximize the performance of a WWTP. A schematic of the real tank and associated components, are presented in Figure 1. The discrete time difference equation that describes the volume conservation for the real tank, is presented in eq. (6), where the inflow, q in,2 , is controlled by using a redirection gate, while the retention gate is used to control the outflow, q out,3 .
Rainfall A rainfall is regarded as the most influential factor that affects a sewer network, where the estimated run-off water from rainfalls are assumed to be a disturbance factor that enters the system, as presented in eq. (7).
where S, denotes the surface area of the catchment, ϕ, the ground absorption coefficient and I t , the rain intensity. The absorption factor needs to be derived for each catchment due to the rainfall water that is absorbed by the ground and is based on a real data measurements, further explained in [15].
Gates Two types of gates are introduced in this section, referred to as the redirection and retention gates.
Redirection Gates is used to control the inflow rates to connected pipes by changing the direction of the flow through the gate, as eq. (8) illustrates.
Notice that redirection gates can be implemented as binary logic gates or for continuous time.
The continous implementation is used in this paper.
Retention Gates are used to control tank outflows and are controlled by using local controllers. The benefit of using retention gates is maintaining wastewater flow at a certain point in the sewer network, as eqs. (10) and (11) show.

Sewer network model
A nine Tank Catchment model is introduced. The augmented model will consist of eight virtual tanks, one real tank and two waste water treatment plants, WWTP 1 and WWTP 2. It will be referred to as the 9TC model. A schematic of the 9TC model is provided in Figure 2. The structure of the model can be related to the Barcelona model from Martnez [9].
A state space model for the 9TC system is given by eq. (15), where the obtained 9TC model matrices A e , B e , E x,e and C e can be found in [13]. where Further, the system parameters can also be found in [13]. Additionally, the sampling time, T s = 300 sec is used.

Simulation Results
First, the MPC setup is shortly described followed by the a number of simulation results for the 9TC model. The simulation is done both when the disturbance is know and when the disturbance is uncertain.

Model predictive control
The applied controller is a MPC (see eg [2] or [7]) with hard constraints on the inputs and input rates. The outputs are limited using soft constraints. The cost function is a quadratic function in the output derivations from a reference. The cost function also contain a quadratic term penalizing control actions. The constraints are formulated as linear inequalities. The numerical values of the boundary limits of the model (i.e. system volume levels, outputs, control signals, flow rates and pipes) are given in Table 1 through Table 5, respectively. The linear inequality constraint equations for control signal u 1 , u 2 , u 3 and u 4 becomes: u min,4 ≤ q out,5 (k) + q out,6 (k) − q in,6 ≤ u 4 (k) ≤ q out,5 (k) + q out,6 (k) − q in,6 ≤ u max,4

Results
The 9TC model is simulated for different intensity of rainfalls, using normal ISOC (input, input rate and soft output constrained ) MPC as control strategy. Pulse signals imitating moderate,  Table 3.
Numerical values of input constraints on control signals in u.  Table 4. Numerical values of input rate constraints on control signal rates, ∆u.
q [m 3 /sec] q q q 13 0 5 q 23 0 8 q in,6 0 15 q wwtp,1 0 7.5 q wwtp,2 0 9 A resemblance of the system responses from the three simulations are noticed, as the rainfall intensities rises. From Figure 4 it is seen that in the time intervals where the external inflows d 5 , d 6 and d 8 to tanks T 6,V 5 , T 7,V 6 and T 9,V 8 , are active, corresponding tanks' volume levels start to rise. The advantage of including a real tank in a sewer network, is lowering the chances of overflow situations, and maximizing the WWTP capacity. The controller responds to the disturbance by increasing the inflow, u 2 , to the real tank, T 3,R , while the outflow, u 3 , from the real tank is decreased, as further observed in Figure 5. Therefore, the volume level in the real     tank starts to rise, as seen in Figure 3. Notice as well, that the volume level in tank, T 4,V 3 , starts to decrease around minute 180, and control signal, u 4 , to increase, thus increasing wastewater flow directed towards treatment plant WWTP 1.  Figure 5. Control signals, u 1 and u 2 , the 9TC system (left) and the control signals, u 3 and u 4 , the 9TC system (right). Furthermore, when system behavior is evaluated for the time intervals where the external inflows, d 1 and d 2 , are active, it can be seen from Figure 3, that the volume levels rises within the time intervals for the corresponding tanks. It is as well noticed around minute 500, that the volume level in the real tank, T 3,R , decreases while slightly increasing in tank, T 4,V 3 , to counter for the disturbances entering the system, seen in Figure 3. The volume level in the real tank then increases again around minute 600, and when the rainfall episodes have passed, the tanks and pipes settle slowly to their steady state values.  Table 7. Total volume of inflow, and total volume directed to WWTPs and sea.
In Figure 4, the accumulated volume of wastewater that is treated and directed to sea, is compared. For the moderate rain episode, no change is noticed in the graph, where approximately 99% of the wastewater is treated, as seen from the numerical data presented in Tables 7 and  8. Thus, the system performance is considered sufficient, where the result is based on a known disturbance.
Further, for the heavy rain episode, it is clear from Figure 4, that the weir overflow device at the second terminal of the sewer network, is overflowing and wastewater is contaminating the sea. This is considered a small quantity (since the volume of wastewater is only about 2.5% of the  Table 8. The difference between corresponding volume parameter, and the difference of the total inflow and overflow volume. total inflow) and compared to the treated water (which is approximately 97%), the same can be concluded for the system performance during heavy rain.
For the violent rain episode, an even larger volume change is noticed for the quantity of wastewater that flows to sea (only around 8% of the total inflow). Notice, if the difference in total volume directed to sea are compared between simulations of heavy and violent rain episodes, it is approximately 5.5%, since there is a large difference between corresponding magnitudes of disturbances rain consequently resulting in a large difference in total inflows, as seen in Table 6. When taking these factors into consideration, the increase in contaminated water flowing to the sea, is not considered serious since the quantity of treated wastewater is around 92%, as seen in Table 8.
Subsequently, the distribution of wastewater directed to the two treatment plants, WWTP 1 and WWTP 2, is shown in Table 7. The wastewater flowing to the two treatment plants seems to be distributed equally between them. Notice that WWTP 2 receives more wastewater than WWTP 1, as its capacity of treating contaminated water is larger. This behavior is produced by the weighting chosen for the system and can be adjusted further.
As a overall conclusion for the simulations, no abnormal behavior was observed from the closedloop system responses from simulations. The tanks signals responded to the external inflows, d e , then as rainfall episodes have ended the tank signals settle slowly to their steady state values.

Uncertainty Analysis of Disturbance
Now, simulation are shown for uncertain disturbances. For simulations, actual and estimated disturbances entering the system are simulated as pulse signals, and the 9TC system evaluated for the simulation cases described in Table 9. System responses of tank volume signals from simulations are presented, along with plots of the total accumulated volume directed to W W T P s and that received by the sea (q sea ). Further, the total quantity of external inflow to the 9TC system, simulated for the actual and estimated disturbances, are close to being equal (with a very small difference of approximately 0.0025% between the actual and estimated disturbances).

Cases / Type of rain Controller Process
9TCa Estimated Actual rain 9TCb Estimated Estimated 9TCc Actual Actual    Figure 7. Volume in the tanks T 7,V 6 , T 8,V 7 and T 9,V 8 (left) and the total flow to WWTP, q wwtp , and sea, q sea accumulated volumes (right).
When tank volume signals from Figure 7, are evaluated, only small differences are noticed between simulation cases (9TCa, 9TCb and 9TCc). A considerable difference between volume signal of tank, T 2,V 2 , of case 9TCc compared to cases 9TCa and 9TCb, is noticed in Figure 6. This behavior is due to the difference between the actual and estimated rain. Whereas the actual rain enters the system for shorter periods but with larger intensities, while the estimated rain enters the system for longer periods but with smaller intensities.
If the system performance in treating wastewater and minimizing that received by the sea, then differences in performances can be compared by using Figure 7, and the numerical data from simulation, seen in Table 10. It is noticed when simulating case 9TCb, better performance in minimizing overflow to the sea is achieved, compared to cases 9TCa and 9TCc. Similar can be concluded for the performance in treating wastewater (WWTP total), when cases are compared. The total differences of treated wastewater is similar between cases 9TCa and 9TCc, and slightly better performance observed from case 9TCb.  Table 10. The difference between corresponding volume parameter, and the difference of the total inflow and overflow volume.

Conclusion
The Barcelona benchmark model for a sewer network has been considered in this paper. The sewer network has been controlled by using MPC, where it is possible to handle system constraints as well as to include prediction in the control optimization. It is shown by simulations, that using MPC, that it is possible to control the waste water with respect to minimizing flooding in the stress as well as minimizing the flow waste water directly to the sea. The simulations shows clearly that the prediction of the inflow from rainfall is important to optimize the control of the sewer network. The MPC methodology allow to use the capacity in the network to minimize the flooding as well as minimizing the flow of waste water directly to the sea. In this case, the MPC methodology of controlling a sewer network, showed sufficient results and can be used for ongoing study of sewer networks.