Leveraging open source software and parallel computing for model predictive control of urban drainage systems using EPA-SWMM5

https://doi.org/10.1016/j.envsoft.2019.07.009Get rights and content

Highlights

  • Open-source implementation of model predictive control for EPA-SWMM5, swmm_mpc.

  • Evolutionary algorithm used to select effective control policy at each time step.

  • Parallel processing of genetic algorithm significantly reduces run-time.

  • Control policy from swmm_mpc minimizes flooding and maintains target water level.

  • Computational cost measured for personal, high-performance, and cloud-based computers.

Abstract

Active stormwater control will play an increasingly important role in mitigating urban flooding, which is becoming more common with climate change and sea level rise. In this paper we describe and demonstrate swmm_mpc, software developed for simulating model predictive control (MPC) for urban drainage systems using open source software (Python and the EPA Stormwater Management Model version 5 (SWMM5)). Swmm_mpc uses an evolutionary algorithm as an optimizer and supports parallel processing. In the demonstration case for a hypothetical, tidally-influenced urban drainage system, the swmm_mpc control policies for two storage units achieved its objectives of 1) practically eliminating flooding and 2) maintaining the water level at the storage units close to a target level. Although the current swmm_mpc workflow was feasible for a simple model using a desktop PC, a high-performance computer or cloud-based computer with more computational cores would likely be needed for most real-world models.

Introduction

Researchers have predicted that storm intensity will increase on average due to climate change (Berggren et al., 2012; Neumann et al., 2015). Coastal cities have an additional challenge as sea levels rise, which makes it more difficult to drain storm runoff from streets. Coastal cities have already experienced increased flooding from high tidal events alone (Sweet and Park, 2014).

More intense storms and rising sea levels will put greater stress on urban drainage systems necessitating changes for urban drainage systems to perform at current levels. One possible adjustment is to make capital improvements such as increasing pipe size or constructing new storage units. Another option is to convert drainage systems from passive, gravity driven systems to active or “smart” systems (Kerkez et al., 2016). Active systems can increase performance of a urban drainage system at a lower cost than traditional capital improvements (Meneses et al., 2018). Actively controlling an urban drainage system does not increase the actual capacity of urban drainage infrastructure, but rather more efficiently uses the existing infrastructure, increasing its effective capacity. For example, one part of an active urban drainage system could be a valve at the outlet of a retention basin which can be automatically opened or closed based on system conditions and forecasts. With this setup, the valve could be closed more during a storm, which would utilize the available storage better than would have been possible without the valve.

For an active urban drainage system to achieve its objective (e.g., minimize flooding, reduce combined-sewer overflows), an effective management strategy is required. Management decisions for an urban drainage system include which actuators (e.g., valves and pumps) in the system should change, when to change them, and to what setting they should be changed. These decisions are referred to as a control policy (Vrabie et al., 2009; Mayne et al., 2005; Langson et al., 2004). An effective control policy for an active urban drainage system may depend on a number of factors such as antecedent moisture conditions, expected intensity and duration of oncoming rainfall, current water levels in the system, the condition of the drainage infrastructure, and other factors (e.g., tide levels in tidally influenced urban drainage systems).

A common approach for determining an effective control policy is model predictive control (MPC) (Camacho and Bordons, 2007). MPC has been used effectively in many control applications including automotive controls (Del Re et al., 2010), HVAC (heating, ventilation, and air conditioning) (Afram and Janabi-Sharifi, 2014), and other industrial applications (Qin and Badgwell, 2003). MPC has also been used effectively in urban drainage applications (Lund et al., 2018; Puig et al., 2009; Cembrano et al., 2004; Schütze et al., 2004; Gelormino and Ricker, 1994). In MPC, a process model is used to simulate the physical system and evaluate alternative control policies. Forecast data can be used as input for the simulation. During the control period, on-line optimization is performed, meaning that an optimal control policy is found and implemented at each time step (Camacho and Bordons, 2007).

Although capable of finding effective control policies, implementing MPC for a urban drainage system is non-trivial due to the dynamics within the system. The fundamental governing equations for modeling urban drainage systems are the St. Venant equations which, when considered fully, are non-linear (Tayfur et al., 1993). This makes finding an optimal control policy for urban drainage systems challenging using MPC (Darsono and Labadie, 2007). To address this dilemma, two alternative approaches are typically employeed. The first is to simplify the governing equations of the process model to a linear system. This makes the optimization problem solvable using well-established procedures such as simplex (Nelder and Mead, 1965). Gelormino and Ricker (1994) took the approach of linearizing their system, converting their process model into a linear-time-invariant model to perform MPC for a large combined sewer system in Seattle, Washington USA.

The second approach for implementing MPC for urban drainage systems is to retain the non-linear St. Venant equations and use a metaheuristic to find the best control policy at each time step. In this approach, a true optimization procedure is not possible because the system remains non-linear; instead, a metaheuristic (e.g., an evolutionary algorithm (EA)) can be used (Gandomi et al., 2013). The use of a metaheuristic precludes the possibility of determining a guaranteed optimal control policy and is typically computationally expensive. The advantage of this approach, however, is that the non-linear governing equations in the process model are retained. This approach was taken by Heusch and Ostrowski (2011) who used a dynamically dimensioned search for finding the best control policy. For their process model, they used the United States Environmental Protection Agency's Stormwater Management Model Version 5 (EPA-SWMM5), which numerically solves the St. Venant equations (Huber et al., 2005). Similar to Heusch and Ostrowski (2011), we have selected to follow the second approach so that the nonlinearities in the process model can be maintained, and to leverage EPA-SWMM5 as the process model.

EPA-SWMM5 is an attractive choice as a process model for urban drainage systems for several reasons. EPA-SWMM5 is in the public domain making it free of charge and its source code is open-source making it customizable. The model simulates a wide variety of urban drainage structures including active controls such as orifices with variable openings and pumps. EPA-SWMM5 has been used in many research applications, as well as in engineering practice, to model urban drainage systems (Burger et al., 2014). Notwithstanding the wide use and utility of EPA-SWMM5 for modeling urban drainage systems, and the established utility of MPC as a successful approach for determining effective control policies, to our knowledge, there is currently no software available for performing MPC using EPA-SWMM5. Although Heusch and Ostrowski (2011) developed software that implements MPC with EPA-SWMM5, that software was closed-source and is no longer available.

This study advances the work done by Heusch and Ostrowski (2011) by creating open-source software for simulating MPC for EPA-SWMM5, swmm_mpc, and by demonstrating swmm_mpc's parallel computing capabilities. By making swmm_mpc open source, other researchers will be able to use, improve, and build from the source code. Although, the software written by Heusch and Ostrowski (2011) supported the use of parallel computing, this capability, which is critical to the usability of such software given its associated computational costs, was never demonstrated or tested in the literature.

The swmm_mpc software was written in the Python programming language. Several third-party Python packages were necessary for the success of this project including pyswmm (https://github.com/OpenWaterAnalytics/pyswmm) and the Distributed Evolutionary Algorithms for Python (DEAP) (https://github.com/DEAP/deap). To evaluate swmm_mpc, it was applied to a demonstration model with two simulated active control devices. The demonstration model was a hypothetical urban drainage system with a tidally-influenced tailwater condition. This was chosen since coastal cities are becoming more at risk of flooding and thus may have larger benefits from active controls. The swmm_mpc results were compared to the results from a rules-based approach and a scenario with no active control. The software was run on a desktop personal computer (PC), a high-performance computer (HPC), and a rented, cloud-based machine to demonstrate and test the parallel processing capability of the software.

The remainder of this paper describes the methods used to implement swmm_mpc including a description of the MPC workflow and the interaction and role of the third-party Python libraries. The use case model is then described and the results of the evaluation are presented and discussed. As part of the results and discussion, the benefits of parallelization and the use of a high-performance and cloud-based computing for running swmm_mpc are quantified and discussed.

Section snippets

Overview of MPC for urban drainage systems

MPC for an urban drainage system consists of three main components as shown in Fig. 1. The first component is the physical system, including the system states and system controls. The system states include hydraulic states such as water levels at nodes and flow rates in pipes, and hydrologic states such as watershed soil moisture and runoff. In a real system, these states would ideally come from real-time sensors. The system controls are actuators that accept and implement the settings

Results from demonstration cases

Fig. 11, Fig. 12, Fig. 13 show the results of the three control scenarios applied to the three demonstration cases. In all cases, Cases A, B, and C, there are times where flooding occurred at one or more nodes. Flooding occurs in SWMM5 when the depth of water at a given node exceeds the maximum depth of that node. When this occurs, the depth in SWMM5 at that node is recorded as the maximum depth, which is why some of the depth values in Fig. 11, Fig. 12, Fig. 13 appear capped.

Fig. 11 shows the

Conclusions

A free and open-source software package, swmm_mpc, was developed which computes a control policy for controls within an urban drainage system model. The widely-used United States Environmental Protection Agency Stormwater Management Model Version 5 (SWMM5) is used to simulate the urban drainage system and as the process model. A third-party Python library, pyswmm, is a critical component of the swmm_mpc workflow allowing a SWMM5 model to be run step-by-step in a Python environment. An

Software availability

The swmm_mpc software is open-source and available for use and improvement on GitHub at https://github.com/UVAdMIST/swmm_mpc. A Docker image of swmm_mpc is also available at https://hub.docker.com/r/jsadler2/swmm_mpc/. The demonstration model is published on HydroShare (Sadler, 2018).

Acknowledgments

We acknowledge the support of awards 1735587 (Critical and Resilient Infrastructure Systems - CRISP) and 1737432 (Smart and Connected Communities - S&CC) from the United States National Science Foundation. We thank Bryant McDonnell, one of the main developers of pyswmm, for his assistance in adding the hotstart file functionality to OWA-SWMM5 and pyswmm. We also thank the consultants of the University of Virginia Graduate Writing Lab including Kelly Cunningham, its director, for their helpful

References (42)

  • D. Mayne et al.

    Robust model predictive control of constrained linear systems with bounded disturbances

    Automatica

    (2005)
  • S. Qin et al.

    A survey of industrial model predictive control technology

    Contr. Eng. Pract.

    (2003)
  • M. Schütze et al.

    Real time control of urban wastewater systems—where do we stand today?

    J. Hydrol.

    (2004)
  • M.C. Valverde Ramírez et al.

    Artificial neural network technique for rainfall forecasting applied to the São Paulo region

    J. Hydrol.

    (2005)
  • E.L. Villarreal et al.

    Inner city stormwater control using a combination of best management practices

    Ecol. Eng.

    (2004)
  • D. Vrabie et al.

    Adaptive optimal control for continuous-time linear systems based on policy iteration

    Automatica

    (2009)
  • A. Zimmer et al.

    Evolutionary algorithm enhancement for model predictive control and real-time decision support

    Environ. Model. Softw

    (2015)
  • A. Abur et al.

    Power System State Estimation, Volume 24 of Power Engineering (Willis)

    (2004)
  • K. Berggren et al.

    Hydraulic impacts on urban drainage systems due to changes in rainfall caused by climatic change

    J. Hydrol. Eng.

    (2012)
  • G. Bonnin et al.

    Point precipitation frequency estimates, Norfolk, Virginia, USA

    (2018)
  • E.F. Camacho et al.

    Model Predictive Control

    (2007)
  • Cited by (56)

    View all citing articles on Scopus
    View full text