EPANET-MATLAB Toolkit: An Open-Source Software for Interfacing EPANET with MATLAB Demetrios G. Eliades 1 , Marios Kyriakou 1 , Stelios Vrachimis 1 , and Marios M. Polycarpou 1 1 KIOS Research Center for Intelligent Systems and Networks, Dept. of Electrical and Computer Engineering, University of Cyprus, Nicosia, Cyprus Correspondence to: Demetrios Eliades (eldemet@ucy.ac.cy) Abstract. In this work we introduce the EPANET-MATLAB Toolkit, an open-source software for interfacing a drinking water distribution system simulation library, EPANET, with the MATLAB technical computing language. The basic functionalities of the Toolkit are presented, and in the case-study a contamination simulator based on EPANET and EPANET-MSX is described and demonstrated on a benchmark network. 1 Introduction 5 In 1994, the US Environmental Protection Agency (EPA) released EPANET (version 1.1), an open source software developed by Lew Rossman, for modeling water distribution systems hydraulic and quality dynamics. EPANET was designed as a research tool to better understand the dynamics of drinking water constituents, taking into account bulk flow and pipe wall reactions (Rossman, 1994). EPANET considers a geometric representation of the pipe network, along with a set of initial conditions (e.g. water levels in tanks), rules of how the system is operated, and uses this information to compute flows, pressures and 10 water quality (e.g. disinfection concentrations and water age) throughout the network, for a certain period of time. EPANET was originally developed in the C programming language and simulations can be executed through a stand-alone compiled application using a text file which contained the model description. EPANET utilizes the “gradient algorithm” for solving the hydraulic state-estimation at each time step (Todiniand Pilati, 1987). For water quality the Finite Volume Method was originally utilized (Rossman et al., 1993), however, a Lagrangian approach (Rossman and Boulos, 1996) was adopted in the 15 following release of EPANET (version 2.0). This new version allowed the dynamic linking of EPANET with external software through its shared object library. In 2015, the Open Source EPANET Initiative was established, comprised of various academic, industrial and other stakeholders, to manage the further development of EPANET. An updated version of EPANET (version 2.1) 1 was released 2016, and the next major release (Rossman, 2011) is currently under development. EPANET has been established as the de facto standard tool for both the industry and academia: for water operators to 20 simulate “what-if” scenarios, for researchers to evaluate novel algorithms for a variety of research challenges using realis- tic water distribution network benchmarks, and for the industry to create new products and services while benefiting from EPANET’s public-domain software license. During the past 20 years, EPANET was extensively used as a tool to facilitate 1 https://github.com/OpenWaterAnalytics/EPANET 1