epyt 2.3.5.0
EPyT: An EPANET-Python Toolkit for Smart Water Network Simulations. The EPyT is inspired by the EPANET-Matlab Toolkit.
Requires Python: >=3.9
Keywords: epanet, water, networks, hydraulics, quality, simulations, emt, epanet matlab toolkit

﻿﻿<a href="http://www.kios.ucy.ac.cy"><img src="https://www.kios.ucy.ac.cy/wp-content/uploads/2021/07/Logotype-KIOS.svg" width="200" height="100"/><a>

[![license](https://img.shields.io/pypi/l/epyt.svg)](https://github.com/KIOS-Research/EPyT/blob/main/LICENSE.md)
[![pypi](https://img.shields.io/pypi/v/epyt.svg)](https://pypi.org/project/epyt/)
[![Downloads](https://static.pepy.tech/badge/epyt)](https://pepy.tech/project/epyt)
[![Downloads](https://static.pepy.tech/badge/epyt/month)](https://pepy.tech/project/epyt)
[![build](https://github.com/OpenWaterAnalytics/EPyT/actions/workflows/build_tests.yml/badge.svg)](https://github.com/OpenWaterAnalytics/EPyT/actions/workflows/build_tests.yml)
[![Documentation Status](https://readthedocs.org/projects/epanet-python-toolkit-epyt/badge/?version=latest)](https://epanet-python-toolkit-epyt.readthedocs.io/en/latest/?badge=latest)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.05947/status.svg)](https://doi.org/10.21105/joss.05947)


# EPANET Python Toolkit (EPyT)

The `EPANET-Python Toolkit` is an open-source software, originally developed by the [KIOS Research and Innovation Center of Excellence, University of Cyprus](http://www.kios.ucy.ac.cy/) which operates within the Python environment, for providing a programming interface for the latest version of [EPANET](https://github.com/OpenWaterAnalytics/epanet), a hydraulic and quality modeling software created by the US EPA, with Python, a  high-level technical computing software. The goal of the EPANET Python Toolkit is to serve as a common programming framework for research and development in the growing field of smart water networks.

The `EPANET-Python Toolkit` features easy to use commands/wrappers for viewing, modifying, simulating and plotting results produced by the EPANET libraries.  

For support, please use the OWA community forum: https://github.com/orgs/OpenWaterAnalytics/discussions

## Table of Contents

- [EPANET Python Toolkit (EPyT)](#epanet-python-toolkit-epyt)
- [How to cite](#how-to-cite)
- [Requirements](#requirements)
- [How to install](#how-to-install)
- [How to use the Toolkit](#how-to-use-the-toolkit)
- [How to fix/report bugs](#how-to-fixreport-bugs)
- [Licenses](#licenses)
- [Contributors](#contributors)
- [Contributing](#contributing)
- [Recommendation](#recommendation)
- [List of EPyT Functions](#list-of-epyt-functions)
- [List of EPANET 2.2 Functions](#list-of-epanet-2012-functions-supported)
- [List of EPANET 2.3 Functions Supported](#list-of-epanet-23-functions-supported)
- [List of EPANET MSX Functions API](#list-of-epanet-msx-functions-api)

## How to cite 

Kyriakou, M. S., Demetriades, M., Vrachimis, S. G., Eliades, D. G., & Polycarpou, M. M. (2023). EPyT: An EPANET-Python Toolkit for Smart Water Network Simulations. Journal of Open Source Software, 8(92), 5947. https://doi.org/10.21105/joss.05947

```
@article{Kyriakou2023,
author = {Kyriakou, Marios S. and Demetriades, Marios and Vrachimis, Stelios G. and Eliades, Demetrios G. and Polycarpou, Marios M.},
doi = {10.21105/joss.05947},
journal = {Journal of Open Source Software},
month = dec,
number = {92},
pages = {5947},
title = {{EPyT: An EPANET-Python Toolkit for Smart Water Network Simulations}},
url = {https://joss.theoj.org/papers/10.21105/joss.05947},
volume = {8},
year = {2023}
}
```

&uparrow; [Back to top](#table-of-contents)

## Requirements

* Python >=3.9
* Windows, OSX or Linux
* [EPANET 2.2](https://github.com/OpenWaterAnalytics/epanet)

Linux: `sudo cp libepanet2.so /lib/x86_64-linux-gnu/libepanet.so`

&uparrow; [Back to top](#table-of-contents)

## How to install

**Environments -> base (root) -> open terminal -> pip install epyt**

* PyPI: <b>pip install epyt</b>

&uparrow; [Back to top](#table-of-contents)

## How to use the Toolkit

**Minimum Example:**

```python
>>> from epyt import epanet
>>> 
>>> d = epanet('Net1.inp')
>>> d.getNodeCount()
>>> d.getNodeElevations()
``` 

**Minumun Example using custom Library:**
```python
>>> from epyt import epanet
>>>
>>>epanetlib=os.path.join(os.getcwd(), 'epyt','libraries','win','epanet2.dll')
>>>msxlib=os.path.join(os.getcwd(), 'epyt','libraries','win','epanetmsx.dll')
>>>d = epanet(inpname, customlib=epanetlib)
>>>d.loadMSXFile(msxname, customMSXlib=msxlib)
``` 

**More examples:** 

[https://github.com/KIOS-Research/EPYT/tree/main/epyt/examples](https://github.com/KIOS-Research/EPYT/tree/main/epyt/examples#readme)

&uparrow; [Back to top](#table-of-contents)

## How to fix/report bugs

To fix a bug `Fork` the `EPyT`, `Edit` the code and make the appropriate change, and then `Pull` it so that we evaluate it. 

Keep in mind that some bugs may exist in the `EPANET` libraries, in case you are not receiving the expected results.

&uparrow; [Back to top](#table-of-contents)

## Licenses

* `EPANET`: Public Domain
* `EPANET-Python Toolkit (EPyT)`: EUPL

&uparrow; [Back to top](#table-of-contents)

## Contributors

* Marios Kyriakou, [KIOS Research and Innovation Center of Excellence, University of Cyprus](http://www.kios.ucy.ac.cy/)
* Marios Demetriades, [KIOS Research and Innovation Center of Excellence, University of Cyprus](http://www.kios.ucy.ac.cy/)
* Stelios Vrachimis, [KIOS Research and Innovation Center of Excellence, University of Cyprus](http://www.kios.ucy.ac.cy/)
* Demetrios Eliades, [KIOS Research and Innovation Center of Excellence, University of Cyprus](http://www.kios.ucy.ac.cy/)

The `EPyT` is based/inspired on the [EPANET-Matlab Toolkit](https://github.com/OpenWaterAnalytics/EPANET-Matlab-Toolkit).

## Contributing
If you want to contribute, please check out our [Code of Conduct](https://github.com/KIOS-Research/EPyT/blob/dev/CODE_OF_CONDUCT.md). Everyone is welcome to contribute whether reporting a new [issue](https://github.com/KIOS-Research/EPyT/issues), suggesting a new feature, or writing code. If you want to contribute code, you can create a new fork in the repo to your own account. Make your commits on your dev branch (based on dev) and when you are finished then you can create a [pull request](https://github.com/KIOS-Research/EPyT/pulls) to test the code and discuss your changes.

## Recommendation

* Install Anaconda<br>
* Run `EPyT` with [Spyder IDE](https://www.spyder-ide.org/)
* Run `EPyT` with [PyCharm](https://www.jetbrains.com/pycharm/)

*Settings on Spyder IDE*

* Tools -> Preferrences
![image](https://user-images.githubusercontent.com/2945956/154067349-3aed266f-3a23-4573-8b93-db0b4f224964.png)
* View -> Window layouts -> Matlab layout
* Enable interactive plot on matlibplot
  : Tools -> Preferences -> IPython console -> Graphics -> Graphics backend -> Backend: Automatic

&uparrow; [Back to top](#table-of-contents)

## List of EPyT Functions

| Function                            |Description|
|-------------------------------------|---------------------------|
| addControls                         | Adds a new simple control |
| addCurve                            | Adds a new curve appended to the end of the existing curves |
| addLinkPipe                         | Adds a new pipe |
| addLinkPipeCV                       | Adds a new control valve pipe |
| addLinkPump                         | Adds a new pump |
| addLinkValveFCV                     | Adds a new FCV valve |
| addLinkValveGPV                     | Adds a new GPV valve |
| addLinkValvePBV                     | Adds a new PBV valve |
| addLinkValvePCV                     | Adds a new PCV valve and returns the index of the new PCV valve |
| addLinkValvePRV                     | Adds a new PRV valve |
| addLinkValvePSV                     | Adds a new PSV valve |
| addLinkValveTCV                     | Adds a new TCV valve |
| addNodeJunction                     | Adds a new junction |
| addNodeJunctionDemand               | Adds a new demand to a junction given the junction index, base demand, demand time pattern and demand category name |
| addNodeReservoir                    | Adds a new reservoir |
| addNodeTank                         | Adds a new tank |
| addPattern                          | Adds a new time pattern to the network |
| addRules                            | Adds a new rule-based control to a project |
| appRotateNetwork                    | Rotates the network by theta degrees counter-clockwise |
| appShiftNetwork                     | Shifts the network |
| clearReport                         | Clears the contents of a project's report file |
| closeHydraulicAnalysis              | Closes the hydraulic analysis system, freeing all allocated memory |
| closeNetwork                        | Closes down the Toolkit system |
| closeQualityAnalysis                | Closes the water quality analysis system, freeing all allocated memory |
| copyReport                          | Copies the current contents of a project's report file to another file |
| createProject                       | Creates a new epanet projec |
| deleteAllTemps                      | Delete all temporary files (.inp, .bin) created in networks folder |
| deleteControls                      | Deletes an existing simple control |
| deleteCurve                         | Deletes a data curve from a project |
| deleteLink                          | Deletes a link |
| deleteNode                          | Deletes nodes |
| deleteNodeJunctionDemand            | Deletes a demand from a junction given the junction index and demand index.
| deletePattern                       | Deletes a time pattern from a project |
| deletePatternsAll                   | Deletes all time patterns from a project |
| deleteProject                       | Deletes the epanet project |
| deleteRules                         | Deletes an existing rule-based control given it's index |
| getAdjacencyMatrix                  | Compute the adjacency matrix (connectivity graph) considering the flows, using mean flow |
| getAllAttributes                    | Get all attributes of a given Python object |
| getCMDCODE                          | Retrieves the CMC code |
| getComputedHydraulicTimeSeries      | Computes hydraulic simulation and retrieves all time-series |
| getComputedQualityTimeSeries        | Computes Quality simulation and retrieves all or some time-series |
| getComputedTimeSeries               | Run analysis with binary fil |
| getConnectivityMatrix               | Retrieve the Connectivity Matrix of the networ |
| getConsumerDemandDelivered          | Retrieves the delivered consumer demand for a specific node |
| getConsumerDemandRequested          | Retrieves the requested consumer demand for a specific node |
| getControlCount                     | Retrieves the number of controls => will replace getControlRulesCount |
| getControlRulesCount                | Retrieves the number of controls |
| getControlState                     | Retrieves the enabled state of a specified control in the EPANET model |
| getControls                         | Retrieves the parameters of all control statements |
| getCounts                           | Retrieves the number of network components |
| getCurveComment                     | Retrieves the comment string of a curve |
| getCurveCount                       | Retrieves the number of curves |
| getCurveIndex                       | Retrieves the index of a curve with specific ID |
| getCurveLengths                     | Retrieves number of points in a curve |
| getCurveNameID                      | Retrieves the IDs of curves |
| getCurveType                        | Retrieves the curve-type for all curves |
| getCurveTypeIndex                   | Retrieves the curve-type index for all curves |
| getCurveValue                       | Retrieves the X, Y values of points of curves |
| getCurvesInfo                       | Retrieves all the info of curves |
| getDemandModel                      | Retrieves the type of demand model in use and its parameters |
| getENfunctionsImpemented            | Retrieves the epanet functions that have been developed |
| getError                            | Retrieves the text of the message associated with a particular error or warning code |
| getFlowUnits                        | Retrieves flow units used to express all flow rates |
| getLibFunctions                     | Retrieves the functions of DLL |
| getLinkActualQuality                | Retrieves the current computed link quality (read only) |
| getLinkBulkReactionCoeff            | Retrieves the value of all link bulk chemical reaction coefficient |
| getLinkComment                      | Retrieves the comment string assigned to the link object |
| getLinkCount                        | Retrieves the number of links |
| getLinkDiameter                     | Retrieves the value of link diameters |
| getLinkEnergy                       | Retrieves the current computed pump energy usage (read only) |
| getLinkExpansionProperties          | Retrieves the expansion properties for a specified link (pipe) |
| getLinkFlows                        | Retrieves the current computed flow rate (read only) |
| getLinkHeadloss                     | Retrieves the current computed head loss (read only) |
| getLinkInControl                    | Function to determine wether a link apperas in any simple or rule based control |
| getLinkIndex                        | Retrieves the indices of all links, or the indices of an ID set of links |
| getLinkInitialSetting               | Retrieves the value of all link roughness for pipes or initial speed for pumps or initial setting for valves |
| getLinkInitialStatus                | Retrieves the value of all link initial status |
| getLinkLeakArea                     | Function to retrieve the leak area for a specified link (pipe) |
| getLinkLeakageRate                  | Retrieves the leakage rate of a specific pipe (link) at a given point in time |
| getLinkLength                       | Retrieves the value of link lengths |
| getLinkMinorLossCoeff               | Retrieves the value of link minor loss coefficients |
| getLinkNameID                       | Retrieves the ID label(s) of all links, or the IDs of an index set of links |
| getLinkNodesIndex                   | Retrieves the indexes of the from/to nodes of all links |
| getLinkPipeCount                    | Retrieves the number of pipes |
| getLinkPipeIndex                    | Retrieves the pipe indices |
| getLinkPipeNameID                   | Retrieves the pipe ID |
| getLinkPumpCount                    | Retrieves the number of pumps |
| getLinkPumpECost                    | Retrieves the pump average energy price |
| getLinkPumpECurve                   | Retrieves the pump efficiency v |
| getLinkPumpEPat                     | Retrieves the pump energy price time pattern index |
| getLinkPumpEfficiency               | Retrieves the current computed pump efficiency (read only) |
| getLinkPumpHCurve                   | Retrieves the pump head v |
| getLinkPumpHeadCurveIndex           | Retrieves the index of a head curve for all pumps |
| getLinkPumpIndex                    | Retrieves the pump indices |
| getLinkPumpNameID                   | Retrieves the pump ID |
| getLinkPumpPatternIndex             | Retrieves the pump speed time pattern index |
| getLinkPumpPatternNameID            | Retrieves pump pattern name ID |
| getLinkPumpPower                    | Retrieves the pump constant power rating (read only) |
| getLinkPumpState                    | Retrieves the current computed pump state (read only) (see @ref EN_PumpStateType) |
| getLinkPumpSwitches                 | Retrieves the number of pump switches |
| getLinkPumpType                     | Retrieves the type of a pump |
| getLinkPumpTypeCode                 | Retrieves the code of type of a pump |
| getLinkQuality                      | Retrieves the value of link quality |
| getLinkResultIndex                  | Retrieves the order in which a link's results were saved to an output file |
| getLinkRoughnessCoeff               | Retrieves the value of link roughness coefficient |
| getLinkSettings                     | Retrieves the current computed value of all link roughness for pipes or actual speed for pumps or actual setting for valves |
| getLinkStatus                       | Retrieves the current link status (see @ref EN_LinkStatusType) (0 = closed, 1 = open) |
| getLinkType                         | Retrieves the link-type code for all links |
| getLinkTypeIndex                    | Retrieves the link-type code for all links |
| getLinkValues                       | Retrieves property values for all links within the EPANET model during a hydraulic analysis |
| getLinkValveCount                   | Retrieves the number of valves |
| getLinkValveCurveGPV                | Retrieves the valve curve for a specified general purpose valve (GPV) |
| getLinkValveCurvePCV                | Retrieves the valve curve for a specified pressure control valve (PCV) |
| getLinkValveIndex                   | Retrieves the valve indices |
| getLinkValveNameID                  | Retrieves the valve ID |
| getLinkVelocity                     | Retrieves the current computed flow velocity (read only) |
| getLinkVertices                     | Retrieves the coordinate's of a vertex point assigned to a link |
| getLinkVerticesCount                | Retrieves the number of internal vertex points assigned to a link |
| getLinkWallReactionCoeff            | Retrieves the value of all pipe wall chemical reaction coefficient |
| getLinksInfo                        | Retrieves all link info |
| getNetworksDatabase                 | Retrieves all EPANET Input Files from EPyT database |
| getNodeActualDemand                 | Retrieves the computed value of all node actual demands |
| getNodeActualDemandSensingNodes     | Retrieves the computed demand values at some sensing nodes |
| getNodeActualQuality                | Retrieves the computed values of the actual quality for all nodes |
| getNodeActualQualitySensingNodes    | Retrieves the computed quality values at some sensing node |
| getNodeBaseDemands                  | Retrieves the value of all node base demands |
| getNodeComment                      | Retrieves the comment string assigned to the node object |
| getNodeCount                        | Retrieves the number of nodes |
| getNodeDemandCategoriesNumber       | Retrieves the value of all node base demands categorie number |
| getNodeDemandDeficit                | Retrieves the amount that full demand is reduced under PDA |
| getNodeDemandPatternIndex           | Retrieves the value of all node base demands pattern index |
| getNodeDemandPatternNameID          | Retrieves the value of all node base demands pattern name ID |
| getNodeElevations                   | Retrieves the value of all node elevations |
| getNodeEmitterCoeff                 | Retrieves the value of all node emmitter coefficients |
| getNodeEmitterFlow                  | Retrieves node emmiter flow |
| getNodeHydraulicHead                | Retrieves the computed values of all node hydraulic heads |
| getNodeInControl                    | Function to determine wether a node apperas in any simple or rule based control |
| getNodeIndex                        | Retrieves the indices of all nodes or some nodes with a specified ID |
| getNodeInitialQuality               | Retrieves the value of all node initial quality |
| getNodeJunctionCount                | Retrieves the number of junction nodes |
| getNodeJunctionDemandIndex          | Retrieves the demand index of the junctions |
| getNodeJunctionDemandName           | Gets the name of a node's demand category |
| getNodeJunctionIndex                | Retrieves the indices of junctions |
| getNodeJunctionNameID               | Retrieves the junction ID label |
| getNodeLeakageFlow                  | Retrieves the leakage flow for a specific node |
| getNodeMassFlowRate                 | Retrieves the computed mass flow rates per minute of chemical sources for all nodes |
| getNodeNameID                       | Retrieves the ID label of all nodes or some nodes with a specified index |
| getNodePatternIndex                 | Retrieves the value of all node demand pattern indices |
| getNodePressure                     | Retrieves the computed values of all node pressures |
| getNodeReservoirCount               | Retrieves the number of Reservoirs |
| getNodeReservoirIndex               | Retrieves the indices of reservoirs |
| getNodeReservoirNameID              | Retrieves the reservoir ID label |
| getNodeResultIndex                  | Retrieves the order in which a node's results were saved to an output file |
| getNodeSourcePatternIndex           | Retrieves the value of all node source pattern index |
| getNodeSourceQuality                | Retrieves the value of all node source quality |
| getNodeSourceType                   | Retrieves the value of all node source type |
| getNodeSourceTypeIndex              | Retrieves the value of all node source type index |
| getNodeTankBulkReactionCoeff        | Retrieves the tank bulk rate coefficient |
| getNodeTankCanOverFlow              | Retrieves the tank can overflow (= 1) or not (= 0) |
| getNodeTankCount                    | Retrieves the number of Tanks |
| getNodeTankData                     | Retrieves a group of properties for a tank |
| getNodeTankDiameter                 | Retrieves the tank diameters |
| getNodeTankIndex                    | Retrieves the tank indices |
| getNodeTankInitialLevel             | Retrieves the value of all tank initial water levels |
| getNodeTankInitialWaterVolume       | Retrieves the tank initial water volume |
| getNodeTankMaximumWaterLevel        | Retrieves the tank maximum water level |
| getNodeTankMaximumWaterVolume       | Retrieves the tank maximum water volume |
| getNodeTankMinimumWaterLevel        | Retrieves the tank minimum water level |
| getNodeTankMinimumWaterVolume       | Retrieves the tank minimum water volume |
| getNodeTankMixZoneVolume            | Retrieves the tank mixing zone volume |
| getNodeTankMixingFraction           | Retrieves the tank Fraction of total volume occupied by the inlet/outlet zone in a 2-compartment tank |
| getNodeTankMixingModelCode          | Retrieves the tank mixing model code |
| getNodeTankMixingModelType          | Retrieves the tank mixing model type |
| getNodeTankNameID                   | Retrieves the tank IDs |
| getNodeTankReservoirCount           | Retrieves the number of tanks |
| getNodeTankVolume                   | Retrieves the tank volume |
| getNodeTankVolumeCurveIndex         | Retrieves the tank volume curve index |
| getNodeType                         | Retrieves the node-type code for all nodes |
| getNodeTypeIndex                    | Retrieves the node-type code for all nodes |
| getNodesConnectingLinksID           | Retrieves the id of the from/to nodes of all links |
| getNodesConnectingLinksIndex        | Retrieves the indexes of the from/to nodes of all links |
| getNodesInfo                        | Retrieves nodes info (elevations, demand patterns, emmitter coeff, initial quality, source quality, source pattern index, source type index, node type index) |
| getOptionsAccuracyValue             | Retrieves the total normalized flow change for hydraulic convergence |
| getOptionsCheckFrequency            | Retrieves the frequency of hydraulic status checks |
| getOptionsDampLimit                 | Retrieves the accuracy level where solution damping begins |
| getOptionsDemandCharge              | Retrieves the energy charge per maximum KW usage |
| getOptionsDemandPattern             | Retrieves the default Demand pattern |
| getOptionsEmitterBackFlow           | Retrieves the current setting for allowing reverse flow through emitters |
| getOptionsEmitterExponent           | Retrieves the power exponent for the emmitters |
| getOptionsExtraTrials               | Retrieves the extra trials allowed if hydraulics don't converge |
| getOptionsFlowChange                | Retrieves the maximum flow change for hydraulic convergence |
| getOptionsGlobalEffic               | Retrieves the global efficiency for pumps(percent) |
| getOptionsGlobalPattern             | Retrieves the index of the global energy price pattern |
| getOptionsGlobalPrice               | Retrieves the global average energy price per kW-Hour |
| getOptionsHeadError                 | Retrieves the maximum head loss error for hydraulic convergence |
| getOptionsHeadLossFormula           | Retrieves the headloss formula |
| getOptionsLimitingConcentration     | Retrieves the limiting concentration for growth reactions |
| getOptionsMaxTrials                 | Retrieves the maximum hydraulic trials allowed for hydraulic convergence |
| getOptionsMaximumCheck              | Retrieves the maximum trials for status checking |
| getOptionsPatternDemandMultiplier   | Retrieves the global pattern demand multiplier |
| getOptionsPipeBulkReactionOrder     | Retrieves the bulk water reaction order for pipes |
| getOptionsPipeWallReactionOrder     | Retrieves the wall reaction order for pipes (either 0 or 1) |
| getOptionsPressureUnits             | get the pressure unit used in Epanet |
| getOptionsQualityTolerance          | Retrieves the water quality analysis tolerance |
| getOptionsSpecificDiffusivity       | Retrieves the specific diffusivity (relative to chlorine at 20 deg C) |
| getOptionsSpecificGravity           | Retrieves the specific gravity |
| getOptionsSpecificViscosity         | Retrieves the specific viscosity |
| getOptionsStatusReport              | get the type of the status report(full/no/normal) |
| getOptionsTankBulkReactionOrder     | Retrieves the bulk water reaction order for tanks |
| getPattern                          | Retrieves the multiplier factor for all patterns and all times |
| getPatternAverageDefaultValue       | Retrieves the average value of the default pattern |
| getPatternAverageValue              | Retrieves the average values of all the time patterns |
| getPatternComment                   | Retrieves the comment string assigned to the pattern object |
| getPatternCount                     | Retrieves the number of patterns |
| getPatternIndex                     | Retrieves the index of all or some time patterns given their IDs |
| getPatternLengths                   | Retrieves the number of time periods in all or some time patterns |
| getPatternNameID                    | Retrieves the ID label of all or some time patterns indices |
| getPatternValue                     | Retrieves the multiplier factor for a certain pattern and time |
| getQualityCode                      | Retrieves the code of water quality analysis type |
| getQualityInfo                      | Retrieves quality analysis information (type, chemical name, units, trace node ID) |
| getQualityTraceNodeIndex            | Retrieves the trace node index of water quality analysis type |
| getQualityType                      | Retrieves the type of water quality analysis type |
| getRuleCount                        | Retrieves the number of rules |
| getRuleEnabled                      | Retrieves the enabled state of a specific rule in the EPANET model |
| getRuleID                           | Retrieves the ID name of a rule-based control given its index |
| getRuleInfo                         | Retrieves summary information about a rule-based control given it's index |
| getRules                            | Retrieves the rule - based control statements |
| getStatistic                        | Returns error code |
| getStatisticDeficientNodes          | Retrieves the number of deficient nodes in the simulation |
| getStatisticDemandReduction         | Retrieves the demand reduction statistic from the simulation |
| getStatisticIterations              | Retrieves the number of iterations taken in the simulation |
| getStatisticRelativeError           | Retrieves the relative error statistic from the simulation |
| getStatisticTotalLeakageLoss        | Retrieves the total leakage loss statistic from the simulation. |
| getTimeHTime                        | Retrieves the elapsed time of current hydraulic solution |
| getTimeHaltFlag                     | Retrieves the number of halt flag indicating if the simulation was halted |
| getTimeHydraulicStep                | Retrieves the value of the hydraulic time step |
| getTimeNextEvent                    | Retrieves the shortest time until a tank becomes empty or full |
| getTimeNextEventTank                | Retrieves the index of tank with shortest time to become empty or full |
| getTimePatternStart                 | Retrieves the value of pattern start time |
| getTimePatternStep                  | Retrieves the value of the pattern time step |
| getTimeQTime                        | Retrieves the elapsed time of current quality solution |
| getTimeQualityStep                  | Retrieves the value of the water quality time step |
| getTimeReportingPeriods             | Retrieves the number of reporting periods saved to the binary |
| getTimeReportingStart               | Retrieves the value of the reporting start time |
| getTimeReportingStep                | Retrieves the value of the reporting time step |
| getTimeRuleControlStep              | Retrieves the time step for evaluating rule-based controls |
| getTimeSimulationDuration           | Retrieves the value of simulation duration |
| getTimeStartClockStartTime          | Retrieves the simulation starting time of day |
| getTimeStartTime                    | Retrieves the simulation starting time of day |
| getTimeStatisticsIndex              | Retrieves the index of the type of time series post-processing |
| getTimeStatisticsType               | Retrieves the type of time series post-processing |
| getTimetoNextEvent                  | Determines the type of event that will cause the end of the current time step/duration/index |
| getTitle                            | Retrieves the title lines of the project |
| getUnits                            | Retrieves the Units of Measurement |
| getVersion                          | Retrieves the current EPANET version of DLL |
| initializeEPANET                    | Initializes an EPANET project that isn't opened with an input fil |
| initializeHydraulicAnalysis         | Initializes storage tank levels, link status and settings, and the simulation clock time prior to running a hydraulic analysis |
| initializeQualityAnalysis           | Initializes water quality and the simulation clock time prior to running a water quality analysis |
| loadEPANETFile                      | Load epanet file when use bin functions |
| loadMSXEPANETFile                   | Re-Load EPANET MSX file - parfor |
| loadPatternFile                     | loads time patterns from a file into a project under a specific pattern ID |
| nextHydraulicAnalysisStep           | Determines the length of time until the next hydraulic event occurs in an extended period simulation |
| nextQualityAnalysisStep             | Advances the water quality simulation to the start of the next hydraulic time period |
| openAnyInp                          | Open as on matlab editor any EPANET input file using built function open |
| openCurrentInp                      | Opens EPANET input file who is loade |
| openHydraulicAnalysis               | Opens the hydraulics analysis system |
| openQualityAnalysis                 | Opens the water quality analysis system |
| openX                               | enable the opening of input files with formatting errors |
| plot                                | Plot Network, show all components, plot pressure/flow/elevation |
| plot_close                          | Close all open figures |
| plot_save                           | Save plot |
| plot_show                           | Show plot |
| reloadNetwork                       | Reloads the Network (ENopen) |
| runEPANETexe                        | Runs epanet .exe file |
| runHydraulicAnalysis                | Runs a single period hydraulic analysis, retrieving the current simulation clock time t |
| runQualityAnalysis                  | Makes available the hydraulic and water quality results that occur at the start of the next time period of a water quality analysis, where the start of the period is returned in t |
| runsCompleteSimulation              | Runs a complete hydraulic and water simulation to create binary & report files with name: [NETWORK_temp.txt], [NETWORK_temp.bin] OR you can use argument to runs a complete simulation via self.api.en_epane |
| saveHydraulicFile                   | Saves the current contents of the binary hydraulics file to a file |
| saveHydraulicsOutputReportingFile   | Transfers results of a hydraulic simulation from the binary Hydraulics file to the binary Output file, where results are only reported at uniform reporting intervals |
| saveInputFile                       | Writes all current network input data to a file using the format of an EPANET input file |
| setCMDCODE                          | Sets the CMC code |
| setControlEnabled                   | Sets the control state to either enable or disable in the EPANET model |
| setControls                         | Sets the parameters of a simple control statement |
| setCurve                            | Sets x, y values for a specific curve |
| setCurveComment                     | Sets the comment string of a curve |
| setCurveNameID                      | Sets the name ID of a curve given it's index and the new ID |
| setCurveType                        | Sets the type of a specified curve in the EPANET model |
| setCurveTypeEfficiency              | Sets the type of curve to Efficiency in the EPANET model |
| setCurveTypeGeneral                 | Sets the type of a curve to general in the EPANET model |
| setCurveTypeHeadloss                | Sets the type of a curve to Headloss in the EPANET model |
| setCurveTypePump                    | Sets the type of a curve to Pump in the EPANET model |
| setCurveTypeValveCurve              | Sets the type of a curve to Valve in the EPANET model |
| setCurveTypeVolume                  | Sets the type of a curve to Volume in the EPANET model |
| setCurveValue                       | Sets x, y point for a specific point number and curve |
| setDemandModel                      | Sets the type of demand model to use and its parameters |
| setFlowUnitsAFD                     | Sets flow units to AFD(Acre-Feet per Day) |
| setFlowUnitsCFS                     | Sets flow units to CFS(Cubic Feet per Second) |
| setFlowUnitsCMD                     | Sets flow units to CMD(Cubic Meters per Day) |
| setFlowUnitsCMH                     | Sets flow units to CMH(Cubic Meters per Hour) |
| setFlowUnitsCMS                     | Sets flow units to CMS(Cubic Meters per Second) |
| setFlowUnitsGPM                     | Sets flow units to GPM(Gallons Per Minute) |
| setFlowUnitsIMGD                    | Sets flow units to IMGD(Imperial Million Gallons per Day) |
| setFlowUnitsLPM                     | Sets flow units to LPM(Liters Per Minute) |
| setFlowUnitsLPS                     | Sets flow units to LPS(Liters Per Second) |
| setFlowUnitsMGD                     | Sets flow units to MGD(Million Gallons per Day) |
| setFlowUnitsMLD                     | Sets flow units to MLD(Million Liters per Day) |
| setLinkBulkReactionCoeff            | Sets the value of bulk chemical reaction coefficient |
| setLinkComment                      | Sets the comment string assigned to the link object |
| setLinkDiameter                     | Sets the values of diameters |
| setLinkExpansionProperties          | Sets the expansion properties for a specified link (pipe) |
| setLinkInitialSetting               | Sets the values of initial settings, roughness for pipes or initial speed for pumps or initial setting for valves |
| setLinkInitialStatus                | Sets the values of initial status |
| setLinkLeakArea                     | Sets the leak area for a specified link (pipe) |
| setLinkLength                       | Sets the values of lengths |
| setLinkMinorLossCoeff               | Sets the values of minor loss coefficient |
| setLinkNameID                       | Sets the ID name for links |
| setLinkNodesIndex                   | Sets the indexes of a link's start- and end-nodes |
| setLinkPipeData                     | Sets a group of properties for a pipe |
| setLinkPumpECost                    | Sets the pump average energy price |
| setLinkPumpECurve                   | Sets the pump efficiency v |
| setLinkPumpEPat                     | Sets the pump energy price time pattern index |
| setLinkPumpHCurve                   | Sets the pump head v |
| setLinkPumpHeadCurveIndex           | Sets the curves index for pumps index |
| setLinkPumpPatternIndex             | Sets the pump speed time pattern index |
| setLinkPumpPower                    | Sets the power for pumps |
| setLinkRoughnessCoeff               | Sets the values of roughness coefficient |
| setLinkSettings                     | Sets the values of current settings, roughness for pipes or initial speed for pumps or initial setting for valves |
| setLinkStatus                       | Sets the values of current status for links |
| setLinkTypePipe                     | Sets the link type pipe for a specified link |
| setLinkTypePipeCV                   | Sets the link type cvpipe(pipe with check valve) for a specified link |
| setLinkTypePump                     | Sets the link type pump for a specified link |
| setLinkTypeValveFCV                 | Sets the link type valve FCV(flow control valve) for a specified link |
| setLinkTypeValveGPV                 | Sets the link type valve GPV(general purpose valve) for a specified link |
| setLinkTypeValvePBV                 | Sets the link type valve PBV(pressure breaker valve) for a specified link |
| setLinkTypeValvePCV                 | Sets the link type valve PCV(Position control valve) for a specified link |
| setLinkTypeValvePRV                 | Sets the link type valve PRV(pressure reducing valve) for a specified link |
| setLinkTypeValvePSV                 | Sets the link type valve PSV(pressure sustaining valve) for a specified link |
| setLinkTypeValveTCV                 | Sets the link type valve TCV(throttle control valve) for a specified link |
| setLinkValveCurveGPV                | Sets the valve curve for a specified general purpose valve (GPV) |
| setLinkValveCurvePCV                | Sets the valve curve for a specified pressure control valve (PCV) |
| setLinkVertices                     | Assigns a set of internal vertex points to a link |
| setLinkWallReactionCoeff            | Sets the value of wall chemical reaction coefficient |
| setNodeBaseDemands                  | Sets the values of demand for nodes |
| setNodeComment                      | Sets the comment string assigned to the node object |
| setNodeCoordinates                  | Sets node coordinates |
| setNodeDemandPatternIndex           | Sets the values of demand time pattern indices |
| setNodeElevations                   | Sets the values of elevation for nodes |
| setNodeEmitterCoeff                 | Sets the values of emitter coefficient for nodes |
| setNodeInitialQuality               |