In case you have a version of matlab older than 2015b install the Windows SDK compiler :
↑ [Back to top](#table-of-contents) ## How to use the Toolkit Detailed examples on how to use the toolkit can be found in the [publication](https://zenodo.org/record/831493#.W9B69PZRXIV) of the Toolkit , together with the [code](https://zenodo.org/record/437778). A presentation of its use is also provided [here](https://github.com/KIOS-Research/CCWI2016/blob/master/CCWI2016/Presentation/Eliades_CCWI2016.ppt). To start, you need to download the folder from GitHub (e.g., `Download ZIP`), set the run path in Matlab within the saved folder, and run `RunTests.m`. This will execute all the commands which have been implemented in the Class. Minimum Example: d=epanet('Net1.inp') d.getNodeCount d.getNodeElevations Help Functions: help d.plot ↑ [Back to top](#table-of-contents) ## How to fix/report bugs To fix a bug `Fork` the `EPANET-Matlab Toolkit`, `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. ↑ [Back to top](#table-of-contents) ## Licenses * `EPANET`: Public Domain * `EPANET-MSX`: GNU Lesser General Public License * `EPANET-Matlab Toolkit`: EUPL ↑ [Back to top](#table-of-contents) ## Contributors * Marios Kyriakou, [KIOS Research Center for Intelligent Systems and Networks, University of Cyprus](http://www.kios.ucy.ac.cy/) * Demetrios Eliades, [KIOS Research Center for Intelligent Systems and Networks, University of Cyprus](http://www.kios.ucy.ac.cy/) * Stelios Vrachimis, [KIOS Research Center for Intelligent Systems and Networks, University of Cyprus](http://www.kios.ucy.ac.cy/) The `EPANET-Matlab Toolkit` is based/inspired on the [EPANET-Matlab Toolkit](http://www.mathworks.com/matlabcentral/fileexchange/25100-epanet-matlab-toolkit) as well as the OpenWaterAnalytics [EPANET-Matlab Wrappers](https://github.com/OpenWaterAnalytics/epanet-matlab) ↑ [Back to top](#table-of-contents) ## List of Matlab Class Functions ![](emt_tree.png) |Function|Description| |---------|---------| |epanet|Load Input file and open the EPANET Toolkit system| |unload|Unload library and close the EPANET Toolkit system| |loadEPANETFile|Re-Load EPANET file - parfor| |loadMSXEPANETFile|Re-Load EPANET MSX file - parfor| |loadlibrary|Load the EPANET library - parfor| |loadMSXlibrary|Load the EPANET MSX library - parfor| |appShiftNetwor|Shifts the network in x and y directions| |appRotateNetwork|Rotates the network by theta degrees counter-clockwise using as pivot a specific node| |createProject|Creates an epanet project| |deleteProject|Deletes an epanet project| |getError|Returns the description of an error code| |getAdjacencyMatrix|Compute the adjacency matrix (connectivity graph) considering the flows, using mean flow| |getComputedAnalysisTimeSeries|Computed Hydralic and Quality Time Series| |getComputedHydraulicTimeSeries|Computed Hydraulic Time Series| |getComputedQualityTimeSeries|Computed Quality Time Series| |getComputedTimeSeries|Computed Hydraulic & Quality Time Series using the bimary file who created from executable| |getComputedTimeSeries_ENepanet|Computed Hydraulic & Quality Time Series via ENepanet binary file| |getConnectivityMatrix|Return connectivity matrix of the network| |getCounts|Retrieves the number of network components| |getControlRulesCount|Retrieves the number of control rules| |getControls|Retrieves the controls| |getCurveCount|Retrieves the number of curves| |getCurveIndex|Retrieves index of curve with specific ID| |getCurveLengths|Retrieves number of points in a curve| |getCurveNameID|Retrieves curve id| |getCurveType|Retrieves the curve-type (VOLUME, PUMP, EFFICIENCY, HEADLOSS, GENERAL)| |getCurveTypeIndex|Retrieves the curve-type index for all curves| |getCurveValue|Retrieves (x,y) values of specific curve index| |getCurveXY|Retrieves (x,y) values of all curves| |getDemandModel|Retrieves the type of demand model in use and its parameters| |getEN_functionsImpemented|Retrieves the epanet EN_ functions that have been developed| |getENfunctionsImpemented|Retrieves the epanet functions that have been developed| |getFlowDirections|Compute the adjacency matrix (connectivity graph) considering the flows, at different time steps or the mean flow| |getFlowUnits|Retrieves the units used to express all flow rates| |getGraph|Retrieves the graph of the current epanet network| |getLibFunctions|Retrieves the functions of DLL| |getLinkActualQuality|Current computed link quality (read only)| |getLinkBulkReactionCoeff|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 all link diameters| |getLinkEnergy|Current computed pump energy usage (read only)| |getLinkFlows|Current computed flow rate (read only)| |getLinkHeadloss|Current computed head loss (read only)| |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| |getLinkLength|Retrieves the value of all link lengths| |getLinkMinorLossCoeff|Retrieves the value of all link minor loss coefficients| |getLinkNameID|Retrieves the ID label(s) of all links, or the IDs of an index set of links| |getLinkNodesIndex-getNodesConnectingLinksIndex|Retrieves the indexes of the from/to nodes of all links| |getLinkPipeCount|Retrieves the number of pipes| |getLinkPipeIndex|Retrieves the indices of pipes| |getLinkPipeNameID|Retrieves the pipe IDs| |getLinkPumpCount|Retrieves the number of pumps| |getLinkPumpEfficiency|Retrieves the value of all computed efficiency| |getLinkPumpHeadCurveIndex|Retrieves index of a head curve for specific link index| |getLinkPumpIndex|Retrieves the indices of pumps| |getLinkPumpNameID|Retrieves the pump IDs| |getLinkPumpPatternIndex|Pump speed time pattern index| |getLinkPumpPatternNameID|Retrieves the pump pattern IDs| |getLinkPumpPower|Pump constant power rating| |getLinkPumpHCurve|Pump head v. flow curve index| |getLinkPumpECurve|Pump efficiency v. flow curve index| |getLinkPumpECost|Pump average energy price| |getLinkPumpEPat|Pump energy price time pattern index| |getLinkPumpType|Retrieves the type of a pump for specific link index| |getLinkPumpTypeCode|Retrieves the type code of a pump for specific link index| |getLinkPumpState|Current computed pump state (read only) (see @ref EN_PumpStateType)| |getLinkPumpSwitches|Calculates the number of pump switches| |getLinkQuality|Retrieves the value of link quality| |getLinkResultIndex|Retrieves the order in which a link's results were saved to an output file. (EPANET Version 2.2)| |getLinkRoughnessCoeff|Retrieves the value of all link roughness| |getLinkSettings|Retrieves the value of all computed link roughness for pipes or actual speed for pumps or actual setting for valves| |getLinkStatus|Current link status (see @ref EN_LinkStatusType)| |getLinkType|Retrieves the link-type for all links| |getLinkTypeIndex|Retrieves the link-type code for all links| |getLinkValveCount|Retrieves the number of valves| |getLinkValveIndex|Retrieves the indices of valves| |getLinkValveNameID|Retrieves the valve IDs| |getLinkVelocity|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| |getLinkVolumes|Get link volumes| |getLinkWallReactionCoeff|Pipe wall chemical reaction coefficient| |getNodeActualDemand|Retrieves the computed value of all 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 nodes| |getNodeBaseDemands|Retrieves the value of all node base demands| |getNodeComment|Retrieves the comment string assigned to the node object| |getNodeCoordinates|Retrieves coordinate x, y, and x, y vertices for a node| |getNodeCount|Retrieves the number of nodes| |getNodePatternIndex|Retrieves the value of all node pattern indices| |getNodeDemandDeficit|Retrieves the amount that full demand is reduced under PDA. (EPANET Version 2.2)| |getNodeDemandPatternIndex|Retrieves the value of all node demand pattern indices| |getNodeDemandPatternNameID|Retrieves the value of all node demand pattern IDs| |getNodeElevations|Retrieves the value of all node elevations| |getNodeEmitterCoeff|Retrieves the value of all node emmitter coefficients| |getNodeHydaulicHead|Retrieves the computed values of all hydraulic heads| |getNodeIndex|Retrieves the indices of all nodes or some nodes with a specified ID| |getNodeInitialQuality|Retrieves the value of all node initial quality| |getNodeJunctionActualDemand|Retrieves the computed value of all actual demands for junctions| |getNodeJunctionBaseDemands|Retrieves the value of all junction base demands| |getNodeJunctionCount|Retrieves the number of junctions| |getNodeJunctionDemandName|Gets the name of a node's demand category| |getNodeJunctionIndex|Retrieves the junctions indices| |getNodeJunctionNameID|Retrieves the junctions IDs| |getNodeJunctionDemandIndex|Retrieves the demand index of the junctions. (EPANET Version 2.2)| |getNodeLinks|Retrieves the links which a specific node is connected to| |getNodeMassFlowRate|Retrieves the computed mass flow rates per minute of chemical sources| |getNodeNameID|Retrieves the ID label of all nodes or some nodes with a specified index| |getNodeDemandCategoriesNumber|Retrieves the number of demand categories for a node| |getNodePressure|Retrieves the computed values of all node pressures| |getNodeReservoirCount|Retrieves the number of reservoirs| |getNodeReservoirIndex|Retrieves the indices of reservoirs| |getNodeReservoirNameID|Retrieves the reservoirs IDs| |getNodeResultIndex|Retrieves the order in which a node's results were saved to an output file. (EPANET Version 2.2)| |getNodeSourcePatternIndex|Retrieves the value of all node source pattern index| |getNodeSourceQuality|Retrieves the value of all nodes source quality| |getNodeSourceType|Retrieves the value of all node source type| |getNodeTankData|Retrieves a group of properties for a tank. (EPANET Version 2.2)| |getNodeTankBulkReactionCoeff|Retrieves the tank bulk rate coefficient| |getNodeTankCanOverFlow|Retrieves the tank can overflow (= 1) or not (= 0)| |getNodeTankCount|Retrieves the number of tanks| |getNodeTankDiameter|Retrieves the tank diameters| |getNodeTankIndex|Retrieves the indices of tanks| |getNodeTankInitialLevel|Retrieves the value of all tank initial water levels| |getNodeTankInitialWaterVolume|Retrieves the tank initial volume| |getNodeTankMaximumWaterVolume|Retrieves maximum water volume| |getNodeTankMaximumWaterLevel|Retrieves the tank maximum water level| |getNodeTankMixingFraction|Retrieves the tank Fraction of total volume occupied by the inlet/outlet zone in a 2-compartment tank| |getNodeTankMinimumWaterLevel|Retrieves the tank minimum water level| |getNodeTankMinimumWaterVolume|Retrieves the tank minimum volume| |getNodeTankMixZoneVolume|Retrieves the tank mixing zone volume| |getNodeTankMixingModelCode|Retrieves the tank mixing model code| |getNodeTankMixingModelType|Retrieves the tank mixing model type (mix1, mix2, fifo, lifo)| |getNodeTankNameID|Retrieves the tanks IDs| |getNodeTankReservoirCount|Retrieves the number of tanks| |getNodeTankVolume|Retrieves the tank volume| |getNodeTankVolumeCurveIndex|Retrieves the tank volume curve index| |getNodeType|Retrieves the node-type for all nodes| |getNodeTypeIndex|Retrieves the node code-index for all nodes| |getNodesConnectingLinksID|Retrieves the id of the from/to nodes of all links| |getOptionsAccuracyValue|Retrieve the analysis convergence criterion (0.001)| |getOptionsDemandCharge|Retrieve energy price pattern| |getOptionsSpecificGravity|Retrieves the specific gravity (EPANET Version 2.2)| |getOptionsSpecificViscosity|Retrieves the specific viscosity (EPANET Version 2.2)| |getOptionsExtraTrials|Retrieves the extra trials allowed if hydraulics don't converge (EPANET Version 2.2)| |getOptionsCheckFrequency|Retrieves the frequency of hydraulic status checks (EPANET Version 2.2)| |getOptionsMaximumCheck|Retrieves the maximum trials for status checking. (EPANET Version 2.2)| |getOptionsEmitterExponent|Retrieve power exponent for the emmitters (0.5)| |getOptionsFlowChange|Retrieve flow change| |getOptionsGlobalEffic|Retrieve global efficiency pumps| |getOptionsGlobalPrice|Retrieve global average energy price per kW-Hour| |getOptionsGlobalPattern|Retrieve global pattern| |getOptionsHeadError|Retrieve the head error| |getOptionsHeadLossFormula|Retrieve headloss formula code (Hazen-Williams, Darcy-Weisbach or Chezy-Manning)| |getOptionsMaxTrials|Retrieve maximum number of analysis trials| |getOptionsPatternDemandMultiplier|Retrieve the demand multiplier (x1)| |getOptionsQualityTolerance|Retrieve the water quality analysis tolerance| |getOptionsDampLimit|Retrieves the accuracy level where solution damping begins. (EPANET Version 2.2)| |getOptionsSpecificDiffusivity|Retrieves the specific diffusivity (relative to chlorine at 20 deg C). (EPANET Version 2.2)| |getOptionsPipeBulkReactionOrder|Retrieves the bulk water reaction order for pipes. (EPANET Version 2.2)| |getOptionsPipeWallReactionOrder|Retrieves the wall reaction order for pipes (either 0 or 1). (EPANET Version 2.2)| |getOptionsTankBulkReactionOrder|Retrieves the bulk water reaction order for tanks. (EPANET Version 2.2)| |getOptionsLimitingConcentration|Retrieves the limiting concentration for growth reactions. (EPANET Version 2.2)| |getPattern|Retrieves the multiplier factor for all patterns and all times| |getPatternAveragePatternValue|Retrieves the average value of a pattern| |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 IDs| |getPatternLengths|Retrieves the number of time periods in all or some patterns| |getPatternNameID|Retrieves the patterns IDs| |getPatternValue|Retrieves the multiplier factor for a certain pattern and time| |getQualityCode|Retrieves the code of water quality analysis type| |getQualityInfo|Retrieves the quality info - bug in ENgetqualinfo| |getQualityTraceNodeIndex|Retrieves the trace node index of water quality analysis type| |getQualityType|Retrieves the type of water quality analysis type| |getRules|Retrieves the rule - based control statements. (EPANET Version 2.2)| |getRuleCount|Retrieves the number o ... ...