matswmm - an open-source toolbox for designing real-time

12
MatSWMM e An open-source toolbox for designing real-time control of urban drainage systems G. Ria ~ no-Brice ~ no a, b, * , J. Barreiro-Gomez a, c , A. Ramirez-Jaime a , N. Quijano a , C. Ocampo-Martinez c a Departamento de Ingeniería El ectrica y Electr onica, Universidad de los Andes, Carrera 1 No 18A-10, Bogot a, Colombia b Departamento de Ingeniería Civil, Universidad de los Andes, Carrera 1 No 18A-10, Bogot a, Colombia c Automatic Control Department, Universitat Polit ecnica de Catalunya, Institut de Rob otica i Inform atica Industrial (CSIC-UPC), Llorens i Artigas, 4-6, 08028 Barcelona, Spain article info Article history: Received 17 November 2015 Received in revised form 1 March 2016 Accepted 6 May 2016 Available online 27 May 2016 Keywords: Open-source toolbox Urban drainage system integrated model Real-time control Matlab Python LabVIEW abstract This manuscript describes the MatSWMM toolbox, an open-source Matlab, Python, and LabVIEW-based software package for the analysis and design of real-time control (RTC) strategies in urban drainage systems (UDS). MatSWMM includes control-oriented models of UDS, and the storm water management model (SWMM) of the US Environmental Protection Agency (EPA), as well as systematic-system edition functionalities. Furthermore, MatSWMM is also provided with a population-dynamics-based controller for UDS with three of the fundamental dynamics, i.e., the Smith, projection, and replicator dynamics. The simulation algorithm, and a detailed description of the features of MatSWMM are presented in this manuscript in order to illustrate the capabilities that the tool has for educational and research purposes. © 2016 Elsevier Ltd. All rights reserved. Software availability Name of software: MatSWMM. Contact address: Gerardo Ria~ no-Brice~ no, School of Engineering, Universidad de los Andes, Carrera 1E 19A e 40; ga. [email protected]. Year rst available: 2015. Software requirements: Windows x86 and x64 environments with Matlab 2008 (or higher), Python (2.5), and/or LabVIEW 2012 (or higher). Program size: 1 e 5 Mb. Availability: Open-source repository, licensed under the GNU General Public License v3.0 (https://github.com/water- systems/MatSWMM). 1. Introduction Software packages for urban drainage systems (UDS) can be categorized into two classes of tools: commercial and open source. The former ones are popular among industry and utilities because of their all-in-one capabilities and their efciency. Some of the commercial packages available in the market are CivilStorm, Info- Works CS, MOUSE, MIKE, SewerCAD, SOBEK-Urban, MicroDrainage, and SIMBA (Price and Vojinovi c, 2011). Most of these are holistic (Butler and Schütze, 2005), i.e., these packages allow to model not only ow-routing through a drainage network, but also real-time control (RTC), rainfall, runoff, water quality, street ooding (1D and 2D), and many other features. Despite of the completeness of commercial packages, these tools can be inappropriate for educa- tional and research purposes, since they are closed, i.e., they do not allow modications over the source code or the addition of new algorithms, a feature that is crucial when testing new theories, specially new RTC strategies. Additionally, commercial tools can be expensive despite allowing integration with coding tools. On the other hand, there are open-source tools aimed to give exibility to the simulation algorithm, allowing the integration of * Corresponding author. Departamento de Ingeniería El ectrica y Electr onica, Universidad de los Andes, Carrera 1 No 18A-10, Bogot a, Colombia. E-mail addresses: [email protected] (G. Ria~ no-Brice~ no), j. [email protected], [email protected] (J. Barreiro-Gomez), af. [email protected] (A. Ramirez-Jaime), [email protected] (N. Quijano), [email protected] (C. Ocampo-Martinez). Contents lists available at ScienceDirect Environmental Modelling & Software journal homepage: www.elsevier.com/locate/envsoft http://dx.doi.org/10.1016/j.envsoft.2016.05.009 1364-8152/© 2016 Elsevier Ltd. All rights reserved. Environmental Modelling & Software 83 (2016) 143e154

Upload: others

Post on 28-Nov-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MatSWMM - An open-source toolbox for designing real-time

lable at ScienceDirect

Environmental Modelling & Software 83 (2016) 143e154

Contents lists avai

Environmental Modelling & Software

journal homepage: www.elsevier .com/locate/envsoft

MatSWMM e An open-source toolbox for designing real-time controlof urban drainage systems

G. Ria~no-Brice~no a, b, *, J. Barreiro-Gomez a, c, A. Ramirez-Jaime a, N. Quijano a,C. Ocampo-Martinez c

a Departamento de Ingeniería El�ectrica y Electr�onica, Universidad de los Andes, Carrera 1 No 18A-10, Bogot�a, Colombiab Departamento de Ingeniería Civil, Universidad de los Andes, Carrera 1 No 18A-10, Bogot�a, Colombiac Automatic Control Department, Universitat Polit�ecnica de Catalunya, Institut de Rob�otica i Inform�atica Industrial (CSIC-UPC), Llorens i Artigas, 4-6, 08028Barcelona, Spain

a r t i c l e i n f o

Article history:Received 17 November 2015Received in revised form1 March 2016Accepted 6 May 2016Available online 27 May 2016

Keywords:Open-source toolboxUrban drainage system integrated modelReal-time controlMatlabPythonLabVIEW

* Corresponding author. Departamento de IngenUniversidad de los Andes, Carrera 1 No 18A-10, Bogo

E-mail addresses: [email protected]@uniandes.edu.co, [email protected]@uniandes.edu.co (A. Ramirez-Jaime),(N. Quijano), [email protected] (C. Ocampo-Martin

http://dx.doi.org/10.1016/j.envsoft.2016.05.0091364-8152/© 2016 Elsevier Ltd. All rights reserved.

a b s t r a c t

This manuscript describes the MatSWMM toolbox, an open-source Matlab, Python, and LabVIEW-basedsoftware package for the analysis and design of real-time control (RTC) strategies in urban drainagesystems (UDS). MatSWMM includes control-oriented models of UDS, and the storm water managementmodel (SWMM) of the US Environmental Protection Agency (EPA), as well as systematic-system editionfunctionalities. Furthermore, MatSWMM is also provided with a population-dynamics-based controllerfor UDS with three of the fundamental dynamics, i.e., the Smith, projection, and replicator dynamics. Thesimulation algorithm, and a detailed description of the features of MatSWMM are presented in thismanuscript in order to illustrate the capabilities that the tool has for educational and research purposes.

© 2016 Elsevier Ltd. All rights reserved.

Software availability

Name of software: MatSWMM.Contact address: Gerardo Ria~no-Brice~no, School of Engineering,

Universidad de los Andes, Carrera 1E 19A e 40; [email protected].

Year first available: 2015.Software requirements: Windows x86 and x64 environments with

Matlab 2008 (or higher), Python (2.5), and/or LabVIEW2012 (or higher).

Program size: 1e5 Mb.Availability: Open-source repository, licensed under the GNU

General Public License v3.0 (https://github.com/water-systems/MatSWMM).

iería El�ectrica y Electr�onica,t�a, Colombia.o (G. Ria~no-Brice~no), j.(J. Barreiro-Gomez), [email protected]

ez).

1. Introduction

Software packages for urban drainage systems (UDS) can becategorized into two classes of tools: commercial and open source.The former ones are popular among industry and utilities becauseof their all-in-one capabilities and their efficiency. Some of thecommercial packages available in the market are CivilStorm, Info-Works CS, MOUSE, MIKE, SewerCAD, SOBEK-Urban, MicroDrainage,and SIMBA (Price and Vojinovi�c, 2011). Most of these are holistic(Butler and Schütze, 2005), i.e., these packages allow to model notonly flow-routing through a drainage network, but also real-timecontrol (RTC), rainfall, runoff, water quality, street flooding (1Dand 2D), and many other features. Despite of the completeness ofcommercial packages, these tools can be inappropriate for educa-tional and research purposes, since they are closed, i.e., they do notallow modifications over the source code or the addition of newalgorithms, a feature that is crucial when testing new theories,specially new RTC strategies. Additionally, commercial tools can beexpensive despite allowing integration with coding tools.

On the other hand, there are open-source tools aimed to giveflexibility to the simulation algorithm, allowing the integration of

Page 2: MatSWMM - An open-source toolbox for designing real-time

G. Ria~no-Brice~no et al. / Environmental Modelling & Software 83 (2016) 143e154144

several features related to UDS, like the ones stated before (Garcíaet al., 2015). Some tools of this type are CITY DRAIN © (Achleitneret al., 2007) and SWMM (Huber et al., 2010). CITY DRAIN © hasbeen developed to operate with Simulink and Matlab in order toenhance its functionality with already developed control systemsblocks and toolboxes for Matlab. CITY DRAIN © includes simplifiedflow-routing models like the Muskingum model (Te Chow, 1959).SWMM is the storm water management model of the US Envi-ronmental Protection Agency (EPA). It is oriented to model withhigh level of precision, using the one-dimensional Saint Venantequations (SVE), runoff processes that take place in UDS. Addi-tionally, SWMM can be useful for rule-based RTC modeling.However, open-source tools can be also limited, since extendingand/or modifying SWMM for RTC purposes requires programmingskills with a low-level programming language such as C, andadding a more complex model to the CITY DRAIN © framework(like the SVE-based model) can be difficult in some cases. Addi-tionally, Pathirana (Pathirana, 2015) developed a Python-basedtoolbox to extract easily results from SWMM, attempting tosatisfy this need. However, it is not possible to design RTC with it,since that tool only simplifies the extraction of simulation resultsfrom SWMM.

For this reason, in order to facilitate the design and testingprocesses of real-time controllers for UDS, MatSWMM, an opensource tool has been created. MatSWMM is a flexible tool, i.e., asoftware package that gives the user the possibility to manipu-late the simulation results easily for data analysis and/or systemedition functionalities, since it has been structured for threehigh-level programming languages (i.e., Matlab, Python, andLabVIEW), guaranteeing the possibility of implementing easilyinterfaces, and physical applications, taking advantage of matrix-oriented programming, plotting capabilities, optimization andcontrol toolboxes. The toolbox works as a co-simulation engine,which is based on SWMM and it has been developed as acollection of functions in order to facilitate the expansion of theframework.

An important but often missed issue is that both Matlab andLabVIEW environments are commercial and closed products, thustheir kernel and libraries cannot be neither modified nor freelydistributed. To allow exchanging ideas effectively improving sci-entific research, both the toolbox and the platform on whichMatSWMM runs should be free (Stallman, 2002). At this aim,MatSWMM can run on Python, which is open source and has agreat variety of optimization, data analysis, control and numericalanalysis libraries, e.g., NumPy, SciPy and python-control. It is alsopossible to work with ArcPy, which is a GIS library that can be usedto enhance the functionality of MatSWMM in the future, in order tooffer the same geographical positioning capabilities of commercialpackages such as InfoWorks CS or MIKE.

In this manuscript, a detailed description of the toolboxfunctionalities is presented and some applications for it aresuggested, emphasizing on the RTC design and modeling appli-cations. The remainder of the manuscript is organized as follows.Section 2 introduces some preliminaries related to the simulationalgorithm and the MatSWMM environment. Section 3 gives adetailed description of all the functionalities of MatSWMM,which is complemented in Section 4 with the description of thepopulation-dynamics-based controller for UDS that is includedinto the toolbox. Section 5 gives a brief description of the modelsthat are adapted to MatSWMM in order to implement model-based controllers. Section 6 presents an application exampleand some realizable applications with the toolbox. Finally, inSection 7, some conclusions are drawn and a discussion is madeabout further applications of the co-simulation by using thisnovel tool.

2. Preliminaries

In this section, important aspects for hydraulics computationand RTC with MatSWMM are presented. First, a brief explanation ofthe SWMM model is given, highlighting the modifications that aredone to the SWMM flow-routing algorithm, and how severalenhanced functionalities have been adapted to it. Then, it isemphasized how RTC can be designed with MatSWMM, and how itcan be scalable for large-scale systems. It is important to considerthat MatSWMM can be only executed through command-line in-structionswhen usingMatlab and Python. In contrast, if LabVIEW ispreferred, functions are called like typical LabVIEW blocks withtheir corresponding inputs and outputs.

2.1. The SWMM model

SWMM is a dynamic rainfall-runoff simulation model that isused for planning, analysis, and design of infrastructure related tostormwater runoff, combined and sanitary sewers, and otherdrainage systems in urban areas (Huber et al., 2010). The platformconsists of an interface where a drainage network can be created byusing elements such as pipes, canals, storage units, sub-catchments, among others. Additionally, it has a calculation mod-ule that uses the one-dimensional SVE to simulate runoffthroughout the network (Te Chow, 1959).

SWMM has been also equipped with dynamic and static controlelements. Static elements such as weirs and outlets, whose purposeis to limit water levels along the system, work as barriers thatreduce the energy of the flow. Dynamic control elements, such asorifices and gates, can be programmed to operate with eitherlogical or rule-based control. Additionally, local PID controllers canbe implemented to set operation points for valves and gates set-tings in order to manage water levels, cumulative volumes, andflow directions.

The RTC default functionalities of SWMM have become limitedfor large-scale control of UDS, as the ones developed in (Barreiro-Gomez et al., 2015) (Martin, 2012), and (Ocampo-Martinez, 2010).However, it has a big potential as an open-source software since it ispossible to enhance its functionality in order to include newmethods that allow users to simulate complex RTC strategies, andto edit systematically any UDS implemented on it.

2.2. Structure of the MatSWMM toolbox

A special structure of folders and work-files, presented in Fig. 1,has been designed for MatSWMM in order to maintain an orga-nized environment while working with the toolbox. The structureof MatSWMM can be categorized in three main parts: the SWMMfiles, the MatSWMM files, and the simulation results. The SWMMfiles (i.e., the input, report, and output files), are stored in a singlefolder called “swmm_files”. In order to run a simulation, it is onlyrequired to store the input file created with SWMM, and the path tothe input file must be described through code.

The simulation results are stored in four different folders thatare related to the simulation time and the three main types of el-ements in UDS (i.e., links, nodes, and subcatchments). The results ofthe simulation are stored in “.csv” files that contain information ofdifferent attributes depending on the type of object as exposed inFig. 1.

Moreover, the MatSWMM files that are required to compute asimulation vary depending on the programming language. SinceMatlab and Python can be used for object-oriented programming(OOP), the MatSWMM environment has been conceived as a classfile with several methods. In contrast, MatSWMM for LabVIEW iscomposed by a set of “.vi” files related to the functionalities of the

Administrator
下划线
Page 3: MatSWMM - An open-source toolbox for designing real-time

Fig. 1. Corresponding folders and files of the MatSWMM toolbox. Basic functionalities inherited from SWMM are highlighted in blue. (For interpretation of the references to colourin this figure legend, the reader is referred to the web version of this article.)

G. Ria~no-Brice~no et al. / Environmental Modelling & Software 83 (2016) 143e154 145

toolbox. There are basic functions and enhanced functions that canbe used to reproduce the simulation algorithm (these are high-lighted in Fig. 1), extract information, and modify the state of ac-tuators from the simulation. It is important to notice that a dynamiclink library (DLL) with a modified version of SWMMhas to be savedat the workspace regardless the programming language used.

1 Identification names for the UDS components.

2.3. Computational aspects for hydraulics

It is emphasized that SWMM is a physically-based discrete-timesimulation model that uses principles of conservation of mass,energy and momentum (Huber et al., 2010). As a discrete-time tool,its algorithm finds iteratively solutions for the flow-routing prob-lem described by the SVE, using a fifth-order accurate Runge-Kuttamethod (RK) with adaptative step size control (Eslamian, 2014).This RK algorithm is based on the embedded Runge-Kutta formulas,originally formulated by Fehlberg (Press et al., 1996).

Hydraulics in SWMM are computed through several models ofsubsystems related to physical processes taking place in the UDS,such as, surface runoff, groundwater, flow routing, water qualityrouting, infiltration, snowmelt, and surface ponding (Huber et al.,2010). Since the purpose of the toolbox is to facilitate the designof control strategies for UDS composed of actuators (e.g., weirs,valves, gates) within conduits and storage structures, emphasis isplaced on the flow routing calculation module.

MatSWMM offers the possibility to manipulate the SWMM flowrouting calculation module, whose algorithm can be decomposedinto three parts as presented in Fig. 2a. First, an initialization

process is carried out, and memory is allocated to store thecomputation results of the simulation as well as IDs,1 and otherobject attributes. Secondly, the RK algorithm is invoked and a loopis created in order to calculate runoff results for a time interval; thisis denominated as the main loop of the simulation. Finally, the al-gorithm finds solutions for the flow routing problem and two filesare generated, i.e., a report file and an output file whose extensionsare “.rpt” and “.out” respectively. The first file gives a summary ofthe main simulation results in plain text, while the second one is abinary file that stores the values of the results, in order to make thedata storage and retrieving processes efficiently when large data-sets are generated.

In order to solve the flow routing problem, it is necessary tocompute the lateral inflow at each node (manhole). This estimationis provided by a rainfall-runoff model that is embedded into thesubcathment object of SWMM. Even though, it is also possible toprovide the direct runoff information as a parameter. On the onehand, if a subcatchmentmodel is used to compute the lateral inflowat each manhole, then SWMM uses a non-linear reservoir modelbased on one out of the three possible infiltration models providedby SWMM, i.e., the Horton equation, the Green-Ampt method, andthe curve number method. Each infiltration model has its ownparameters that need to be defined by the user, as explained in(Huber et al., 2010). Likewise, if the user decides to specify thelateral inflows at each node, it is necessary to create a time series

Administrator
下划线
Administrator
下划线
Page 4: MatSWMM - An open-source toolbox for designing real-time

Fig. 2. a) The MatSWMM algorithm composed of three main parts; and b) closed-loop scheme with co-simulation.

G. Ria~no-Brice~no et al. / Environmental Modelling & Software 83 (2016) 143e154146

representing the pattern of direct runoff that goes into the node(Huber et al., 2010).

Once the lateral inflow is computed, it is possible to use thewell-known SVE (Te Chow, 1959) to estimate the flows throughoutthe drainage network (see Fig. 3). The SWMM user has a choice ofthe level of sophistication used to solve these equations, i.e., thesteadyeflow routing, the kinematicewave routing, and thedynamicewave routing (Huber et al., 2010).

MatSWMM has been thought to be portable, therefore, themodified version of the SWMM model has been compiled as a C-language-based DLL, which can be used from any C-based pro-gramming language such as Matlab, Python, or LabVIEW. Becauseof this, MatSWMM can be easily extended for other programminglanguages using the base code.2

MatSWMM can be considered as a co-simulation engine thatretrieves information of hydraulic variables from SWMM, and al-lows to modify attributes in order to perform data analysis effi-ciently with the libraries provided for its base languages (Matlab,Python, and LabVIEW). With that fact in mind, the main loop of thealgorithm presented in Fig. 2 can be adapted for RTC modeling, andthe initialization process for systematic system edition, i.e., usingthe functionalities of the toolbox to modify attributes of the UDSmodel programmatically and/or automatically.

2.4. Computational aspects for real-time control

Taking into consideration the MatSWMM algorithm shown inFig. 2a, it is possible to explain how the toolbox can be used for RTCdesign. After the computation of each flow-routing step, theenhanced functionality is executed, i.e., it is possible to retrieve a

2 The source code can be downloaded from: https://github.com/water-systems/MatSWMM and the documentation of the developed functionalities is availableat https://github.com/water-systems/MatSWMM/wiki.

set of state variables H and modify parameters during the simu-lation, through the set of control actions U , as shown in Fig. 2b).

It is important to notice that for RTC design, a control strategycan be implemented and tested for one of the base languages ofMatSMWM under the assumption of instantaneous execution.Since the loop is stopped until the setting points are changed asdesired, the setting of actuators is changed as it would be aninstantaneous action, which is not what happens in reality. How-ever, due to the flexibility of the coding scheme, if a hydraulicstructure requires a large amount of time (i.e., larger than thesampling time) to move from one state to another, the delay can bemodeled taking advantage of the time resolution of the simulation,since the change of setting of gates and valves in UDS tends to occurin minutes.

Another relevant issue is the time complexity of the MatSWMMalgorithm, and its computational burden when large-scale systemsare required to be managed. This issue is directly related to the timecomplexity of the proposed functionality for controlling UDSs with apopulation-dynamics-based approach. If the system hasm partitions(Barreiro-Gomez et al., 2015), the time complexity of the control

Fig. 3. Flow routing scheme adopted by SWMM. The lateral inflow QL is computed foreach manhole of the network, and then, it is summed up with the inflow Qin, in orderto compute Qout using the Saint Venant equations (SVE).

Page 5: MatSWMM - An open-source toolbox for designing real-time

G. Ria~no-Brice~no et al. / Environmental Modelling & Software 83 (2016) 143e154 147

algorithm is OðmÞ, i.e., it is executed in linear time (Cormen et al.,2009).

Additionally, if information of the model is requested at eachtime step, the computational burden of the simulation is going tobe increased proportionally to the number of variables k that arerequested at each time step.

Thereby, the time complexity for the enhanced functionality isgoing to be Oðnmþ nkÞ, where n is the number of time stepsrequired for the simulation. With that fact in mind, the efficiency ofa simulation with MatSWMM is going to be mostly dominated bythe simulation time (i.e., the time window for the rain scenario andrunoff modeling), and the size of the time step. This can be proved ifa performance test is carried out. For this test, several simulationsof a 2 h rain-scenario are executed leaving the value of n fixed, andmodifying the values ofm and k. The performance test is developedusing a computer with an Intel® Core i3 2.53 GHz �64 processor,and four gigabytes of RAM memory.

It is shown in Fig. 4 that both the population-dynamics-basedcontrol algorithm, and the use of getters at each iteration, can besolved in linear time independently, since a plane surface is formed.Additionally, the simulations with the enhanced functionality takesbetween three and 50 s, depending on the magnitudes of m and k.

However, if either the cardinality of H or the number of actu-ators are larger than the number of simulation steps, the time ef-ficiency is going to be dominated by the large-scale nature of theUDS network.

In order to improve the efficiency of the co-simulation algorithm,the use of getters (see Section 3.1) for the main loop must be limitedto RTC purposes. If information is required for data analysis, the useof special functions after the simulation is encouraged. These func-tions are efficient, since they extract information from the output filewithout using significant memory resources, and have the capabilityto save the values of the main variables of all the objects in thesystem (i.e., nodes, links, and catchments) in CSV files. The use ofspecial functions for data analysis is explained in Section 3.2.

Fig. 4. Performance of the proposed enhanced functionality. The duration of severalsimulations with a fixed number of steps is computed. At each iteration k variables areextracted from the SWMM model, and m partitions of the system are controlled.

3. MatSWMM functionalities

In this section, a detailed explanation of the MatSWMM func-tionalities is given. Emphasis is placed on basic functionalities, mostof them inherited from SWMM, e.g., systematic system edition,

data management, and system modeling.

3.1. Basic functionalities

The default functionalities of MatSWMM are related to thecomputation module of SWMM, which is in charge of executing therunoff model using the SVE. The basic functionalities are alsorelated to the systematic edition capabilities of MatSWMM. Theinherited functions from SWMM are: initializing SWMM, running astep, ending sub-processes, calculating the mass balance error,writing a report file, and closing the application. However, asshown in Fig. 2, these functions can be grouped into three mainprocesses that can be executed through the functions presented inTable 1. Using these functions the SWMM algorithm can be repli-cated with the advantage of having greater control of the wholeprocess.

With that in mind, getters and setters were developed to takeadvantage of the partition of the SWMM algorithm (see Table 2). Onthe one hand, getters are executed at each iteration to obtainproperties of the model as if they were measured by a sensor de-vice, e.g., flow, velocity, volume, flooding, Froude number, etc. Onthe other hand, setters are used to modify properties of the model,either at each iteration or at each simulation scenario. One of thesetters that can be useful for RTC design is the one that allows tomodify the setting of actuators such as valves, gates, and orifices. Itcan be done using the modify_settings function. In addition, beforethe simulation is initialized, properties of the model can be modi-fied using the modify_input function.

3.2. Data analysis

If the considered model is of large-scale nature, i.e., the numberof nodes and pipes is such that it is not possible to retrieve statevariables or modify the setting of actuators easily. Hence, gettersand setters become inefficient to manage data, since they can onlybe executed during the main loop. Therefore, there are specialmethods to handle large data sets and large groups of objects (seeTable 3).

For instance, it is required to extract all the results of thesimulation, which can be saved in a “.csv” file that is easily readableby using any of the base programming languages. Additionally,special data structures were adapted to the SWMM model in orderto characterize any network with canals, tanks, and actuators.Because of the structure of SWMM, graphs (modeled by theSWMMGraph class) are used to fit the model properly. Additionally,when convergence topologies prevail, the structure can be simpli-fied as a tree (modeled by the SWMMTree class). The enhancedfunctionality related to these data structures is oriented to split themodel into manageable pieces. Thus, the process of extracting in-formation and modifying parameters can be done efficiently,through breath-first and deep-first search algorithms (Cormenet al., 2009) (also included in MatSWMM for Python). This can beuseful when implementing decentralized control, testing a fault-detection strategy (Tornil-Sin et al., 2012), or simplifying thenetwork topology, using an equivalent one, as done in (Ocampo-Martinez, 2010) and (Ria~no Brice~no et al., 2015).

3.3. System modeling

MatSWMM is useful to characterize UDS through a simplifiedcontrol-oriented model (COM) (García et al., 2015). Nowadays, twoCOMs have been included in MatSWMM, i.e., the virtual-tank (VT)based model (Ocampo-Martinez, 2010), and the Muskingummodel(Te Chow, 1959; Bolea et al., 2007), both explained in Section 5. Inorder to obtain a COM with MatSWMM, it is necessary to have the

Page 6: MatSWMM - An open-source toolbox for designing real-time

Table 1MatSWMM basic functionalities.

Function Description

initialize It opens the files required to run a SWMM simulation, and starts it.run_step It advances the simulation by one routing time step.is_over It determines whether or not the simulation is over.Finish It saves all the results of the simulation and closes the program to run a new simulation.run_simulation It runs a SWMM simulation.

Table 2Getters and setters included in MatSWMM.

Function Description

step_get It retrieves the values of a specific property of multiple objects while running the simulation.get_from_input It returns the value of the attribute in the “.inp” file.get_all It returns all the objects IDs of a certain type (e.g., NODES, LINK, SUBCATCH, STORAGE, OUTFALL, JUNCTION) and the value of one of their properties.modify_input It modifies a specific attribute from the “.inp” file.modify_settings It modifies the setting of several orifices during the simulation.

Table 3Data management functionalities.

Function Description

get_incidence_matrix It returns the graph representation of the network in matrix form.save_results It saves all the results of the simulation in “.csv” files, organized in four folders in the workspace directory. The folders are related to the type of

objects (Link, Node, Subcatch). A folder called Time with information of the step size is also saved.create_graph It creates a graph data structure in Python that represents the network as a connection of nodes (manholes) and conduits (canals and pipes).

Fig. 5. a) Convergence topology, i.e., m source reservoirs whose outflows converge to areceptor reservoir; and b) divergence topology, i.e., a source reservoir (vs) whoseoutflow diverges to m receptor reservoirs (vr).

G. Ria~no-Brice~no et al. / Environmental Modelling & Software 83 (2016) 143e154148

real data of input and output flows of the structure that is going tobe characterized (e.g., canals or pipes). It is possible to use theSWMM model included in MatSWMM to obtain accurate data thatrepresents the behavior of the system, as it was a virtual reality (i.e.,the physical behavior of the system). Furthermore, a simulation canbe run and data from the model can be easily extracted withMatSWMM. Those data sets can be used to calibrate a COM andthen, it can be used for the design of model-based controllers.

4. Population-dynamics-based controllers

A detailed description of the distributed controllers based onpopulation dynamics for MatSWMM is presented in this section. Inorder to introduce this concept, first a mathematical framework ofthe population dynamics is presented, and then special emphasison the distributed replicator dynamics, the Smith dynamics, andthe projection dynamics is made. Furthermore, a proof of conceptexample by using the mentioned control module is shown. Finally,the results exhibit the performance of the distributed real-timepopulation-dynamics-based controllers by using the developedtoolbox functionalities.

4.1. Notation

Column vectors are denoted by lower-case letters and bold style,e.g., p. Scalars are denoted by non-bold style, e.g., n. Sets aredenoted by calligraphic style, e.g., S . The column vector of munitary entries is denoted by 1m2ℝm, i.e., 1m ¼ ½1 … 1�u. Thecardinality of a set X is denoted by jX j. The set of real numbers isdenoted by ℝ, the set of non-negative real numbers is denoted byℝþ, and the set of strictly positive real numbers is denoted by ℝþþ.Similarly, the set of positive integer numbers is denoted by Zþ.

4.1.1. Population dynamicsThe population dynamics approach is presented by making an

analogy with either an UDS or with a drinking water network

(DWN). In order to make the analogy, it is also taken into accountthat the UDS is mainly associated to the convergence topologyshown in Fig. 5a as in (Barreiro-Gomez et al., 2015), while the DWNis mainly associated to the divergence topology shown in Fig. 5b) asin (Ramirez-Llanos and Quijano, 2010).

First of all, the analogy between elements in the populationdynamics approach with elements in either USD or DWN is pre-sented in Table 4.

For instance, consider the system with the convergence topol-ogy shown in Fig. 5a withm2Zþ source reservoirs (strategies). Thetotal flow through the system (population mass) is denoted byQðtÞ2ℝþ, which corresponds to the inflow of the receptor reservoirin the convergence topology. Hence, QðtÞ is composed of a large andfinite amount of flow units (agents). Each flow-unit is assigned toan outflow of the source reservoirs, where the set of source reser-voirs is denoted by S ¼ f1;…;mg.

On the other hand, regarding the divergence topology shown inFig. 5b, there are m2Zþ receptor reservoirs (strategies). Similarlyas in the convergence topology case, QðtÞ2ℝþ corresponds to theoutflow of the source reservoir in the divergence topology. Eachflow-unit is assigned to an inflow of the receptor reservoirs, andthen the set of receptor reservoirs is denoted by S ¼ f1;…;mg.

Page 7: MatSWMM - An open-source toolbox for designing real-time

Table 4Equivalence between population dynamics and UDS/DWN.

Population dynamics UDS DWN

Population System SystemStrategy Source reservoirs Receptor reservoirsPopulation mass Total inflow to receptor reservoir Total outflow source reservoirAgent Flow unit Flow unitProportion of agents Proportion of flow Proportion of flowStrategic distribution Flow distribution in source reservoirs Flow distribution in receptor reservoirsFitness of a strategy Current volume Available volume capacity

Fig. 6. Proper selection of fitness functions for convergence topology a) and b), anddivergence topology c) and d). Correspondence is as follows: a) increasing fitnessfunction with respect to volume; b) decreasing relation existing between proportion ofagents and volume for convergence topology; c) decreasing fitness function withrespect to volume; and d) increasing relation existing between proportion of agentsand volume for divergence topology.

G. Ria~no-Brice~no et al. / Environmental Modelling & Software 83 (2016) 143e154 149

In both the convergence and divergence topologies, the scalarpiðtÞ is the proportion of flow units assigned to each flow associatedto the reservoir i2S as a percentage, i.e., the outflow/inflow for theith reservoir in the convergence/divergence case is given bypiðtÞQðtÞ. The vector pðtÞ2ℝmþ is the flow proportion distributioninvolving the m reservoirs according to the topology. The set of thepossible distributions of flow is given by a simplex

D ¼ �pðtÞ2ℝm

þ : pðtÞu1m ¼ 1�;

and the interior of the set of the possible distributions of flow isgiven by the set

intD ¼ �pðtÞ2ℝm

þþ : pðtÞu1m ¼ 1�:

Finally, the tangent space of the set of possible distributions offlow is defined as

TD ¼ �zðtÞ2ℝm : zðtÞu1m ¼ 0

�:

For the convergence topology, each flow unit is assigned to eachreservoir i2S depending on the current volume, which isdescribed by a function denoted by FiðpðtÞÞ. Then, more outflow isassigned to those reservoirs close to be filled up impeding over-flows in them. In contrast, for the divergence topology, each flowunit is assigned to each reservoir i2S depending on the currentvolume capacity, which is described by a function FiðpðtÞÞ. There-fore, less inflow is assigned to those reservoirs close to be filled up.

The design of the population-dynamics-based controllers aregiven by the proper selection of the fitness functions that define theincentives for the proportion of agents to choose a particularstrategy. The proper selection of the fitness functions is furtherdiscussed bellow and it depends on the type of topology, i.e., anappropriate selection of the fitness function depends on if thesystemhas a convergence or divergence topology. Furthermore, it isnecessary that the fitness functions satisfy conditions to obtain aclass of population game known as stable game (Hofbauer andSandholm, 2009).

Definition 1. The game FðpÞ is stable if the Jacobian matrixJ ¼ DFðpÞ is negative semi-definite with respect to the tangent spaceTD (Hofbauer and Sandholm, 2009), i.e.,

zuJ z � 0; for all z2TD; p2D:

Then, it implies that a game is stable if the fitness functions aredecreasing with respect to the proportion of agents. ⋄

Notice that for the convergence topology (see Fig. 5a), the fitnessfunctions can be selected increasing with respect to the currentvolumes as in (Barreiro-Gomez et al., 2015) (see Fig. 6a)). For theconvergence topology, when a proportion of agents is increased, itis expected that the corresponding volume decreases (see Fig. 6b)).Consequently, due to the fact that the fitness function is increasingwith respect to the volume, the fitness function decreases withrespect to the proportion of agents (necessary condition for a stable

game). Contrary, for the divergence topology counterpart (seeFig. 5b)), the fitness functions can be selected decreasing withrespect to the current volume, e.g., the error with respect to themaximum capacity volume as in (Ramirez-Llanos and Quijano,2010) (see Fig. 6c)). When a proportion of agents is increased it isexpected that the corresponding volume increases (see Fig. 6d)).Consequently, due to the fact that fitness functions are increasingwith respect to the volume, the fitness function decreases withrespect to the proportion of agents (necessary condition for a stablegame).

4.1.2. Particular distributed population dynamicsThe traditional replicator dynamics, Smith dynamics, and pro-

jection dynamics equations are part of the six fundamental popu-lation dynamics (Sandholm, 2010), which require full information(i.e., all strategies associated to reservoirs need information aboutall other reservoir states in order to evolve). However, the distrib-uted population dynamics are deduced in (Barreiro-Gomez et al.,2016) from a local revision protocol that only needs partial infor-mation. Due to the fact that only local information is needed, thenthere is an undirected non-complete connected graph describingpossible interaction denoted by G ¼ ðV ;E Þ, whereV is the set ofnodes, which represents the reservoirs, and E 3fði; jÞ : i; j2V g is

Page 8: MatSWMM - An open-source toolbox for designing real-time

G. Ria~no-Brice~no et al. / Environmental Modelling & Software 83 (2016) 143e154150

the set of links representing the information sharing within thesystem. Furthermore, the set of neighbors of the node i2V is givenby N i ¼ fj : ði; jÞ2E g. Notice that i;N i, and that N is∅, for alli2V since G is connected.

The distributed replicator dynamics are given by

dpiðtÞdt

¼piðtÞ0@FiðpðtÞÞ

Xj2N i

pjðtÞ�Xj2N i

pjðtÞFjðpðtÞÞ1A; forall i2S :

The distributed Smith dynamics are given by

dpiðtÞdt

¼Xj2N i

pjðtÞ�FiðpðtÞÞ � FjðpðtÞÞ

�þ

� piðtÞXj2N i

�FjðpðtÞÞ � FiðpðtÞÞ

�þ;

where ½,�þ ¼ maxð,;0Þ. And finally, the distributed projection dy-namics are given by

dpiðtÞdt

¼ ��N i��FiðpðtÞÞ � X

j2N i

FjðpðtÞÞ; for all i2S :

MatSWMM includes a function that can be used to implement apopulation-dynamics-based controller for UDS with divergenceand convergence topologies (i.e., the pdyncontrol function). It in-cludes the Smith, the projection, and the replicator dynamics.

5. Models of UDS

It is possible to characterize any UDS as a composition of twotopologies, i.e., convergence and divergence. As shown in Fig. 5a,the convergence topology is related to the case where the flow ofseveral storage units or pipes is merged in a single receptor struc-ture. Furthermore, the divergence topology, shown in Fig. 5b, isformed when the flow of a single structure is distributed alongmore than one receptor. The former one prevails in stormwater UDSwhile the latter is commonly related to drinking water networks(DWN). However, both topologies are used to build combinedsewer networks where not only stormwater is transported but alsosanitary and wastewater flows.

MatSWMM has been designed to characterize both topologieseasily, guaranteeing a proper modeling of the run-off phenomenonthroughout large networks and allowing the user to handle theproblem of flow assignation with an optimization-based controllerfor each case, as the one described in (Barreiro-Gomez et al., 2015).

5.1. Control-oriented models

The SVE used by SWMM to simulate the run-off throughout thenetwork describe in a quite high level of detail the behavior of thesystem. Usually, this level of detail is not required in RTC applica-tions and COMs are used instead. As stated before, MatSWMM in-corporates the so-called VT-based model, which is a widely usedCOM for modeling UDS, and the Muskingum model, also used forpredictive control (G�omez et al., 2002; Mantec�on et al., 2002).

5.1.1. Virtual tanks modelIn the virtual reservoir approach, the UDS is divided into a set of

interconnected real and VTs. According to (Ocampo-Martinez,2010), a VT is a storage element that represents the total volumeof sewage inside the sewer mains associated with a determinedportion of a given network. The volume is computed through themass balance of the stored volume, the inflows (from both sewage

mains and stormwater), and the outflows (to both sewage mainsand street) of the reservoir. For the model developed inMatSWMM,the outflow of a given tank (virtual or real) is assumed to be pro-portional to the volume of the tank. Therefore, the model of a tankis given by dViðtÞ

dt ¼ qini ðtÞ � KiViðtÞ, where Vi is the volume stored inthe i-th tank, qini is the total inflow to the i-th tank, and Ki is thevolume/flow conversion (VFC) coefficient. As SWMM providesmeasures for both, the volume and the outflow of the reservoirs,the VFC coefficient for each reservoir can be computed via a least-squares algorithm given by

Ki ¼ argminKi

Ztf0

�qouti ðtÞ � KiViðtÞ

�2dt; (1)

where tf is the total simulation time, and qouti is the total outflow ofthe i-th reservoir. Finally, the maximum capacity volume of the i-thtank is denoted by Vmax

i .In order to solve the leastesquares algorithm to calibrate the

linear reservoir model usingMatSWMM, a discretized variant of (1)can be proposed as follows:

Ki ¼ argminKi

qouti � Kivi

2: (2)

In this way, the parameter Ki for the ith reservoir can becomputed regardless of either the form of the outflow or thevolume.

5.1.2. Muskingum modelThe Muskingum model describes the water flow through UDSs

based on the conservation mass principle. The mass balance for theith reservoir in the UDS is given by

dViðtÞdt

¼ qini ðtÞ � qouti ðtÞ;

and the relation between its inflows and outflows (Te Chow, 1959)is given by

ViðtÞ ¼ Aqini ðtÞ þ Bqouti ðtÞ;

where A and B are parameters for themodel calibration. Similarly tothe case of the linear reservoir, the estimation of parameters A andB for the discretized Muskingum model is done by solving (2). Thisproblem has been solved analytically in (Aldama, 1990), then, bothA and B can be computed in terms of the inflow, outflow, and storedvolume by using the following expressions:

Ai ¼�qouti

�Tqouti vTi q

ini � �

qouti

�Tqini v

Ti q

outi

qini

�Tqini

qouti

�Tqouti �

�qouti

�Tqini

2; (3)

Bi ¼�qini

�Tqini v

Ti q

outi � �

qouti

�Tqini v

Ti q

ini

qini

�Tqini

qouti

�Tqouti �

�qouti

�Tqini

2: (4)

By expressing the outflows as function of ViðtÞ, qini ðtÞ, A, and B, itis obtained that dViðtÞ=dt ¼ qini ðtÞð1þ A=BÞ � ViðtÞ=B, then

dViðtÞdt

¼ gqini ðtÞ � KiviðtÞ;

where g ¼ ð1þ A=BÞ, and Ki ¼ 1=B. Furthermore, Ki >0 scales theoutflow, and it can be seen as the discharge coefficient of the

Page 9: MatSWMM - An open-source toolbox for designing real-time

G. Ria~no-Brice~no et al. / Environmental Modelling & Software 83 (2016) 143e154 151

reservoir. However, for some particular cases Ki <0, and theconsidered system output can show a non-minimum phasebehavior (Bolea et al., 2007).

5.2. Simulation-oriented models

MatSWMM includes the SWMM model as its simulation-oriented model (García et al., 2015). SWMM is known as an accu-rate physically-based model that describes the propagation of awave in an open channel through the SVE. It is based on the con-servation of mass and momentum principles (Te Chow, 1959). Oneof the best features of SWMM consists on representing the UDS as acomposition of nodes and links, which facilitates the modeling indiscrete time of the physical prototype and the mathematical so-lution of the non-uniform flow SVE.

Themain variable in the links is the flow rate, and the solution tothe flow-routing problem is for the average flow in each link, whichis assumed to be constant over a time step. For each step of thesimulation, the velocity of the flow, and the depth of each link iscalculated. In the case of the nodes, the main variable is the pres-sure head, which is assumed to be changing in time but constant

over a time step (reniFerreri).The continuity and the momentum SVE are reported in (Te

Chow, 1959). The numerical integration of the two SVE is accom-plished with a RK algorithm (Eslamian, 2014). It has been shown in(reniFerreri) and (Huber et al., 2010) that the SWMMmodel and itsalgorithm is stable and accurate through the calculation of threetypes of mass-balance errors, i.e., runoff, flow-routing, and waterquality errors. This fact guarantees that the SWMM model isappropriate to model UDS with a high level of precision, i.e., betterthan the one obtained with the COMs.

6. Examples of application

This section illustrates some features of MatSWMM for RTC bymeans of a divergent UDS case study (see Fig. 7). The system iscomposed by four sub-catchments that are affected by a precipi-tation event, the precipitation becomes runoff, and then, it istransported through a system of pipes that is divided into threebranches. After the bifurcation, typical on-line storage units, likethe ones described (Barro et al., 2014), are used to handle and retainthe rise of flow. The storage units have different dimensions and arelocated at different elevations. These differences are common in

UDS because of the unavailability of land for infrastructure (Barroet al., 2014). Finally, as it is shown in Fig. 7, the first divisioncarries water to a tank with three different bodies, the second di-vision meets an outfall and the third division is split in twobranches, carrying water to awastewater treatment plant (WWTP)with two storage units.

The control objective in this model is to spread efficiently flowsat each bifurcation, handling the differences between reservoirs,i.e., differences between their location, elevation, and dimensions.To this end, a partition of the system is done as proposed in(Barreiro-Gomez et al., 2015) and the distributed control based onpopulation dynamics included into MatSWMM is used.

Because of the nature of the system, the fitness function thatwill be used by the controller to solve the optimal assignmentproblem is related to the occupancy rate or the capacity of eachtank, which is equivalent to the normalized volume, as presented inTable 4.

An example of the code that can be used in Matlab withMatSWMM to implement the control strategy in the first diver-gence zone is outlined below:

First of all, some variables are declared, such as the SWMM input

file path, initial conditions for the setting of gates, and the IDs oftanks and gates. Then, the three parts of the MatSWMM algorithmare invoked, i.e., the initialization, the main-loop, and the closing ofthe program.Within themain-loop the population dynamics-basedcontroller is used tomanage the flows of one of the partitions of thesystem, which is composed of three on-line reservoirs, i.e., T1, T2,and T3. Finally, information of the volumes at each reservoir isextracted for data analysis.

The same procedure is applicable to implement RTC on theremaining divisions. However, the controller should be tuneddepending on the speed of the dynamics, and the type of dy-namics (i.e., Smith, projection, or replicator). The results of ascenario where no-control strategy is implemented are shown inFig. 8. The distribution of water volumes is not efficient, sincereservoirs T2, T3, and T4 are overused, i.e., they are operating at itsmaximum capacity, while the others are underused, i.e., theirused capacity is less than 100%. Additionally, 6:99� 103m3 offlooding appear, due to the excess of water that flows out from theoverused tanks. This problem may occur when designing hy-draulic infrastructure based on a static design storm, i.e., theclimate variations due to the heat island effect were not consid-ered (Moonen et al., 2012).

Page 10: MatSWMM - An open-source toolbox for designing real-time

Fig. 7. Divergence case study a) conceptual scheme and input direct runoff hydrograph; and b) system implementation in SWMM.

Fig. 8. Occupancy rate, or capacity of storage tanks when no control strategy is applied, a) Capacity of reservoirs T1, T2, and T3; b) capacity of reservoirs T3, T4, and T5; c) capacity ofreservoirs T7, and T8.

G. Ria~no-Brice~no et al. / Environmental Modelling & Software 83 (2016) 143e154152

When the distributed population-dynamics-based controller isimplemented at each of the nodes where the flow diverges,flooding is prevented and the water is better distributed. The re-sults when RTC is implemented are obtained for the projection, thereplicator, and the Smith dynamics (see Fig. 9).

The simulation with MatSWMM allows to identify the mainadvantage of implementing RTC, which is to distribute efficientlyflows in divergent and convergent sections of the UDS to minimizethe total flooding throughout the network. Throughout thisapproach, it is possible to handle dynamic-rain scenarios, differentto the static ones used for design, with the already builtinfrastructure.

Additionally, tunning the controller can be easily done for aphysical implementation (even empirically), because of theadvantage of programming the SWMM model, which is accurate(reniFerreri), through MatSWMM, in order to obtain the results ofseveral simulations systematically.

6.1. Other applications

Because of the capability that MatSWMM brings to its users forediting systematically any UDS implemented with the SWMMframework, it is possible to extend the scope of MatSWMM tooptimal design of UDS, since most of the optimization problems

Page 11: MatSWMM - An open-source toolbox for designing real-time

Fig. 9. (a, b, c) capacity of tanks when the RTC strategy with the projection dynamics is applied; (d, e, f) capacity of tanks when the RTC strategy with the replicator dynamics isapplied; and (g, h, i) capacity of tanks when the RTC strategy with the Smith dynamics is applied.

Fig. 10. LabVIEW interface based on MatSWMM.

G. Ria~no-Brice~no et al. / Environmental Modelling & Software 83 (2016) 143e154 153

Page 12: MatSWMM - An open-source toolbox for designing real-time

G. Ria~no-Brice~no et al. / Environmental Modelling & Software 83 (2016) 143e154154

proposed for UDS can be solved with heuristics, but require valuesof variables from an efficient simulation-oriented model (e.g., totalflooding, volumes, etc.) (Maier et al., 2014; Marques et al., 2015;Palumbo et al., 2014).

Also, interfaces such as the one presented in Fig. 10, can beimplemented easily with the MatSWMM basic functionalities forLabVIEW, to characterize a physical UDS. Additionally, the ArcPylibrary for Python can be used in parallel with the MatSWMM li-brary in order to extract GIS data and solve the problem of optimalpositioning of UDS structures, specifically, on-line and off-linestorm tanks (Barro et al., 2014).

With that in mind, the capabilities of MatSWMM can be usefulfor optimal design of infrastructures, considering not only thetypical rain-scenario and a critical service operation condition, butalso taking into consideration the possibility of including sensorsand actuators before the commissioning of the system, and toanalyze how these elements a their proper management cansignificantly improve the performance of UDS.

7. Conclusions and further work

This manuscript has presented a new open-source toolbox forthe design of RTC in UDS, i.e., MatSWMM, which runs on Matlab,LabVIEW, and Python. MatSWMM includes a variety of function-alities to edit systematically any UDS implemented on the SWMMframework, during and after a rainfall simulation. These featuresmake MatSWMM suited for both educational and research pur-poses, specially for the design of RTC applied to UDS. Additionally, itis possible to test heuristic algorithms for optimal design andpositioning of retention structures in UDS, since the only re-quirements for these tests are the results from the simulation, and afunction to edit the properties of the system elements. As a matterof fact, MatSWMM is currently used by several masters, and Ph.D.students, and has an active Github repository.3 Among futureprojects, there are supporting Linux-based OSs, adding parallelcomputing techniques for optimal design of UDS, and extending thetoolbox including more control strategies, such as optimization-based controllers (e.g., MPC, LQR, evolutionary-based controllers),and heuristic algorithms (e.g., rule-based, fuzzy control). Thetoolbox is going to be enhanced for realizable applications such asoptimal positioning of UDS elements (e.g., sensors, actuators,retention structures), based geographical information provided bynew GIS capabilities. Also, as more features are developed, morecase studies are going to be included into the repository. Any sug-gestion and/or bug report are very welcome.

Acknowledgments

Authors would like to thank Mexichem (Colombia) for sup-porting this research through the project Drenaje Urbano y CambioClimtico: hacia los sistemas de alcantarillado del futuro. Fase II.COLCIENCIAS 633/2013. Also, this work has been partially sup-ported by the project ECOCIS (Ref. DPI2013-48243-C2-1-R). J.Barreiro-Gomez is partially supported by COLCIENCIAS-COLFU-TURO and Agencia de Gestio d’Ajust Universitaris i de RecercaAGAUR.

References

Achleitner, S., M€oderl, M., Rauch, W., 2007. City drain©ean open source approach

3 The link to the repository is: https://github.com/water-systems/MatSWMM.git.

for simulation of integrated urban drainage systems. Environ. Model. Softw. 22(8), 1184e1195.

Aldama, A.A., 1990. Least-squares parameter estimation for muskingum floodrouting. J. Hydraul. Eng. 116 (4), 580e586.

Barreiro-Gomez, J., Obando, G., Ria~no Brice~no, G., Quijano, N., Ocampo Martinez, C.,2015. Decentralized control for urban drainage systems via population dy-namics: bogot�a case study. In: Proceedings of the 14th European Control Con-ference, Linz, Austria, pp. 2431e2436.

Barreiro-Gomez, J., Obando, G., Quijano, N., 2016. Distributed population dynamics:optimization and control applications. IEEE Trans. Syst. Man Cybern. 99, 1e11.

Barro, J., Comas, P., Malgrat, P., Sunyer, D., 2014. Manual nacional de recomenda-ciones para el dise~no de tanques de tormentas, pp. 32e33.

Bolea, Y., Puig, V., Blesa, J., 2007. On the use of the Muskingum model in real-timesewer network control. In: Proceedings of the 6th European Control Confer-ence, Kos, Greecde, pp. 3717e3723.

Butler, D., Schütze, M., 2005. Integrating simulation models with a view to optimalcontrol of urban wastewater systems. Environ. Model. Softw. 20 (4), 415e426.

Cormen, T.H., Leiserson, L.E., Rivest, R., Stein, C., 2009. Introduction to Algorithms.MIT Press.

Eslamian, S., 2014. Handbook of Engineering Hydrology: Fundamentals and Ap-plications. CRC Press.

García, L., Barreiro-Gomez, J., Escobar, E., T�ellez, D., Quijano, N., Ocampo-Martinez, C., 2015. Modeling and real-time control of urban drainage systems: areview. Adv. Water Resour. 85, 120e132.

G�omez, M., Rodellar, J., Mantec�on, J.A., 2002. Predictive control method fordecentralized operation of irrigation canals. Appl. Math. Model. 26 (11),1039e1056.

Hofbauer, J., Sandholm, W.H., 2009. Stable games and their dynamics. J. Econ.Theory 144 (4), 1665e1693.

Huber, W.C., Rossman, L.A., Dickinson, R., 2010. EPA Storm Water ManagementModel SWMM 5.0. National Risk Management Research Laboratory, Office ofResearch and Development, US Environmental Protection Agency.

Maier, H.R., Kapelan, Z., Kasprzyk, J., Kollat, J., Matott, L.S., Cunha, M.C., Dandy, G.C.,Gibbs, M.S., Keedwell, E., Marchi, A., 2014. Evolutionary algorithms and othermetaheuristics in water resources: current status, research challenges andfuture directions. Environ. Model. Softw. 62, 271e299.

Mantec�on, J.A., G�omez, M., Rodellar, J., 2002. A Simulink-based scheme for simu-lation of irrigation canal control systems. Simulation 78 (8), 485e493.

Marques, J., Cunha, M., Savi�c, D.A., 2015. Multi-objective optimization of waterdistribution systems based on a real options approach. Environ. Model. Softw.63, 1e13.

Martin, A., 2012. Mathematical Optimization of Water Networks. Springer Basel AG.Moonen, P., Defraeye, T., Dorer, V., Blocken, B., Carmeliet, J., 2012. Urban physics:

effect of the micro-climate on comfort, health and energy demand. Front.Archit. Res. 1 (3), 197e228.

Ocampo-Martinez, C., 2010. Model Predictive Control of Wastewater Systems.Springer Verlag.

Palumbo, A., Cimorelli, L., Covelli, C., Cozzolino, L., Mucherino, C., Pianese, D., 2014.Optimal design of urban drainage networks. Civ. Eng. Environ. Syst. 31 (1),79e96.

Pathirana, A., 2015. SWMM5 1.1.0.3: Python Package. https://pypi.python.org/pypi/SWMM5.

Press, W.H., Teukolsky, S.A., Vetterling, W.T., Flannery, B.P., 1996. Numerical Recipesin C, vol. 2. Citeseer.

Price, R.K., Vojinovi�c, Z., 2011. Urban hydroinformatics: data, models, and decisionsupport for integrated urban water management. IWA Publ.

Ramirez-Llanos, E., Quijano, N., 2010. A population dynamics approach for the waterdistribution problem. Int. J. Control 83 (9), 1947e1964.

G. Freni, G. B. Ferreri, P. Tomaselli, Ability of software SWMM to simulate transientsewer smooth pressurization, NOVATECH Report.

Ria~no Brice~no, G., Ramirez-Jaime, A., Barreiro-Gomez, J., Quijano, N., OcampoMartinez, C., 2015. Co-simulation for the design of controllers in urban drainagesystems, in: proceedings of the 2nd Colombian Conference on AutomaticControl. Manizales Colomb. 1e6.

Sandholm, W.H., 2010. Population Games and Evolutionary Dynamics, EconomicLearning and Social Evolution. MIT Press, Cambridge, Mass.

Stallman, R., 2002. Free software, free society: selected essays of Richard M. Stall-man. Lulu.

Te Chow, V., 1959. Open Channel Hydraulics. McGraw-Hill Book Company, Inc, NewYork.

Tornil-Sin, S., Ocampo-Martinez, C., Puig, V., Escobet, T., 2012. Robust fault detectionof non-linear systems using set-membership state estimation based onconstraint satisfaction. Eng. Appl. Artif. Intell. 25 (1), 1e10.