EPANET Python Toolkit (EPyT)

June 4, 2026 · View on GitHub

license pypi Downloads Downloads build Docs DOI

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 which operates within the Python environment, for providing a programming interface for the latest version of 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

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}
}

Back to top

Requirements

Linux: sudo cp libepanet2.so /lib/x86_64-linux-gnu/libepanet.so

Back to top

How to install

Environments -> base (root) -> open terminal -> pip install epyt

  • PyPI: pip install epyt

Back to top

How to use the Toolkit

Minimum Example:

>>> from epyt import epanet
>>> 
>>> d = epanet('Net1.inp')
>>> d.getNodeCount()
>>> d.getNodeElevations()

Minumun Example using custom Library:

>>> 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

Back to top

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.

Back to top

Licenses

  • EPANET: Public Domain
  • EPANET-Python Toolkit (EPyT): EUPL

Back to top

Contributors

The EPyT is based/inspired on the EPANET-Matlab Toolkit.

Contributing

If you want to contribute, please check out our Code of Conduct. Everyone is welcome to contribute whether reporting a new issue, 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 to test the code and discuss your changes.

Recommendation

Settings on Spyder IDE

  • Tools -> Preferrences image
  • View -> Window layouts -> Matlab layout
  • Enable interactive plot on matlibplot : Tools -> Preferences -> IPython console -> Graphics -> Graphics backend -> Backend: Automatic

Back to top

List of EPyT Functions

FunctionDescription
addControlsAdds a new simple control
addCurveAdds a new curve appended to the end of the existing curves
addLinkPipeAdds a new pipe
addLinkPipeCVAdds a new control valve pipe
addLinkPumpAdds a new pump
addLinkValveFCVAdds a new FCV valve
addLinkValveGPVAdds a new GPV valve
addLinkValvePBVAdds a new PBV valve
addLinkValvePCVAdds a new PCV valve and returns the index of the new PCV valve
addLinkValvePRVAdds a new PRV valve
addLinkValvePSVAdds a new PSV valve
addLinkValveTCVAdds a new TCV valve
addNodeJunctionAdds a new junction
addNodeJunctionDemandAdds a new demand to a junction given the junction index, base demand, demand time pattern and demand category name
addNodeReservoirAdds a new reservoir
addNodeTankAdds a new tank
addPatternAdds a new time pattern to the network
addRulesAdds a new rule-based control to a project
appRotateNetworkRotates the network by theta degrees counter-clockwise
appShiftNetworkShifts the network
clearReportClears the contents of a project's report file
closeHydraulicAnalysisCloses the hydraulic analysis system, freeing all allocated memory
closeNetworkCloses down the Toolkit system
closeQualityAnalysisCloses the water quality analysis system, freeing all allocated memory
copyReportCopies the current contents of a project's report file to another file
createProjectCreates a new epanet projec
deleteAllTempsDelete all temporary files (.inp, .bin) created in networks folder
deleteControlsDeletes an existing simple control
deleteCurveDeletes a data curve from a project
deleteLinkDeletes a link
deleteNodeDeletes nodes
deleteNodeJunctionDemandDeletes a demand from a junction given the junction index and demand index.
deletePatternDeletes a time pattern from a project
deletePatternsAllDeletes all time patterns from a project
deleteProjectDeletes the epanet project
deleteRulesDeletes an existing rule-based control given it's index
getAdjacencyMatrixCompute the adjacency matrix (connectivity graph) considering the flows, using mean flow
getAllAttributesGet all attributes of a given Python object
getCMDCODERetrieves the CMC code
getComputedHydraulicTimeSeriesComputes hydraulic simulation and retrieves all time-series
getComputedQualityTimeSeriesComputes Quality simulation and retrieves all or some time-series
getComputedTimeSeriesRun analysis with binary fil
getBinComputedAllParametersComputes hydraulic and quality time series
getConnectivityMatrixRetrieve the Connectivity Matrix of the networ
getConsumerDemandDeliveredRetrieves the delivered consumer demand for a specific node
getConsumerDemandRequestedRetrieves the requested consumer demand for a specific node
getControlCountRetrieves the number of controls => will replace getControlRulesCount
getControlRulesCountRetrieves the number of controls
getControlStateRetrieves the enabled state of a specified control in the EPANET model
getControlsRetrieves the parameters of all control statements
getCountsRetrieves the number of network components
getCurveCommentRetrieves the comment string of a curve
getCurveCountRetrieves the number of curves
getCurveIndexRetrieves the index of a curve with specific ID
getCurveLengthsRetrieves number of points in a curve
getCurveNameIDRetrieves the IDs of curves
getCurveTypeRetrieves the curve-type for all curves
getCurveTypeIndexRetrieves the curve-type index for all curves
getCurveValueRetrieves the X, Y values of points of curves
getCurvesInfoRetrieves all the info of curves
getDemandModelRetrieves the type of demand model in use and its parameters
getENfunctionsImpementedRetrieves the epanet functions that have been developed
getErrorRetrieves the text of the message associated with a particular error or warning code
getFlowUnitsRetrieves flow units used to express all flow rates
getLibFunctionsRetrieves the functions of DLL
getLinkActualQualityRetrieves the current computed link quality (read only)
getLinkBulkReactionCoeffRetrieves the value of all link bulk chemical reaction coefficient
getLinkCommentRetrieves the comment string assigned to the link object
getLinkCountRetrieves the number of links
getLinkDiameterRetrieves the value of link diameters
getLinkEnergyRetrieves the current computed pump energy usage (read only)
getLinkExpansionPropertiesRetrieves the expansion properties for a specified link (pipe)
getLinkFlowsRetrieves the current computed flow rate (read only)
getLinkHeadlossRetrieves the current computed head loss (read only)
getLinkInControlFunction to determine wether a link apperas in any simple or rule based control
getLinkIndexRetrieves the indices of all links, or the indices of an ID set of links
getLinkInitialSettingRetrieves the value of all link roughness for pipes or initial speed for pumps or initial setting for valves
getLinkInitialStatusRetrieves the value of all link initial status
getLinkLeakAreaFunction to retrieve the leak area for a specified link (pipe)
getLinkLeakageRateRetrieves the leakage rate of a specific pipe (link) at a given point in time
getLinkLengthRetrieves the value of link lengths
getLinkMinorLossCoeffRetrieves the value of link minor loss coefficients
getLinkNameIDRetrieves the ID label(s) of all links, or the IDs of an index set of links
getLinkNodesIndexRetrieves the indexes of the from/to nodes of all links
getLinkPipeCountRetrieves the number of pipes
getLinkPipeIndexRetrieves the pipe indices
getLinkPipeNameIDRetrieves the pipe ID
getLinkPumpCountRetrieves the number of pumps
getLinkPumpECostRetrieves the pump average energy price
getLinkPumpECurveRetrieves the pump efficiency v
getLinkPumpEPatRetrieves the pump energy price time pattern index
getLinkPumpEfficiencyRetrieves the current computed pump efficiency (read only)
getLinkPumpHCurveRetrieves the pump head v
getLinkPumpHeadCurveIndexRetrieves the index of a head curve for all pumps
getLinkPumpIndexRetrieves the pump indices
getLinkPumpNameIDRetrieves the pump ID
getLinkPumpPatternIndexRetrieves the pump speed time pattern index
getLinkPumpPatternNameIDRetrieves pump pattern name ID
getLinkPumpPowerRetrieves the pump constant power rating (read only)
getLinkPumpStateRetrieves the current computed pump state (read only) (see @ref EN_PumpStateType)
getLinkPumpSwitchesRetrieves the number of pump switches
getLinkPumpTypeRetrieves the type of a pump
getLinkPumpTypeCodeRetrieves the code of type of a pump
getLinkQualityRetrieves the value of link quality
getLinkResultIndexRetrieves the order in which a link's results were saved to an output file
getLinkRoughnessCoeffRetrieves the value of link roughness coefficient
getLinkSettingsRetrieves the current computed value of all link roughness for pipes or actual speed for pumps or actual setting for valves
getLinkStatusRetrieves the current link status (see @ref EN_LinkStatusType) (0 = closed, 1 = open)
getLinkTypeRetrieves the link-type code for all links
getLinkTypeIndexRetrieves the link-type code for all links
getLinkValuesRetrieves property values for all links within the EPANET model during a hydraulic analysis
getLinkValveCountRetrieves the number of valves
getLinkValveCurveGPVRetrieves the valve curve for a specified general purpose valve (GPV)
getLinkValveCurvePCVRetrieves the valve curve for a specified pressure control valve (PCV)
getLinkValveIndexRetrieves the valve indices
getLinkValveNameIDRetrieves the valve ID
getLinkVelocityRetrieves the current computed flow velocity (read only)
getLinkVerticesRetrieves the coordinate's of a vertex point assigned to a link
getLinkVerticesCountRetrieves the number of internal vertex points assigned to a link
getLinkWallReactionCoeffRetrieves the value of all pipe wall chemical reaction coefficient
getLinksInfoRetrieves all link info
getNetworksDatabaseRetrieves all EPANET Input Files from EPyT database
getNodeActualDemandRetrieves the computed value of all node actual demands
getNodeActualDemandSensingNodesRetrieves the computed demand values at some sensing nodes
getNodeActualQualityRetrieves the computed values of the actual quality for all nodes
getNodeActualQualitySensingNodesRetrieves the computed quality values at some sensing node
getNodeBaseDemandsRetrieves the value of all node base demands
getNodeCommentRetrieves the comment string assigned to the node object
getNodeCountRetrieves the number of nodes
getNodeDemandCategoriesNumberRetrieves the value of all node base demands categorie number
getNodeDemandDeficitRetrieves the amount that full demand is reduced under PDA
getNodeDemandPatternIndexRetrieves the value of all node base demands pattern index
getNodeDemandPatternNameIDRetrieves the value of all node base demands pattern name ID
getNodeElevationsRetrieves the value of all node elevations
getNodeEmitterCoeffRetrieves the value of all node emmitter coefficients
getNodeEmitterFlowRetrieves node emmiter flow
getNodeHydraulicHeadRetrieves the computed values of all node hydraulic heads
getNodeInControlFunction to determine wether a node apperas in any simple or rule based control
getNodeIndexRetrieves the indices of all nodes or some nodes with a specified ID
getNodeInitialQualityRetrieves the value of all node initial quality
getNodeJunctionCountRetrieves the number of junction nodes
getNodeJunctionDemandIndexRetrieves the demand index of the junctions
getNodeJunctionDemandNameGets the name of a node's demand category
getNodeJunctionIndexRetrieves the indices of junctions
getNodeJunctionNameIDRetrieves the junction ID label
getNodeLeakageFlowRetrieves the leakage flow for a specific node
getNodeMassFlowRateRetrieves the computed mass flow rates per minute of chemical sources for all nodes
getNodeNameIDRetrieves the ID label of all nodes or some nodes with a specified index
getNodePatternIndexRetrieves the value of all node demand pattern indices
getNodePressureRetrieves the computed values of all node pressures
getNodeReservoirCountRetrieves the number of Reservoirs
getNodeReservoirIndexRetrieves the indices of reservoirs
getNodeReservoirNameIDRetrieves the reservoir ID label
getNodeResultIndexRetrieves the order in which a node's results were saved to an output file
getNodeSourcePatternIndexRetrieves the value of all node source pattern index
getNodeSourceQualityRetrieves the value of all node source quality
getNodeSourceTypeRetrieves the value of all node source type
getNodeSourceTypeIndexRetrieves the value of all node source type index
getNodeTankBulkReactionCoeffRetrieves the tank bulk rate coefficient
getNodeTankCanOverFlowRetrieves the tank can overflow (= 1) or not (= 0)
getNodeTankCountRetrieves the number of Tanks
getNodeTankDataRetrieves a group of properties for a tank
getNodeTankDiameterRetrieves the tank diameters
getNodeTankIndexRetrieves the tank indices
getNodeTankInitialLevelRetrieves the value of all tank initial water levels
getNodeTankInitialWaterVolumeRetrieves the tank initial water volume
getNodeTankMaximumWaterLevelRetrieves the tank maximum water level
getNodeTankMaximumWaterVolumeRetrieves the tank maximum water volume
getNodeTankMinimumWaterLevelRetrieves the tank minimum water level
getNodeTankMinimumWaterVolumeRetrieves the tank minimum water volume
getNodeTankMixZoneVolumeRetrieves the tank mixing zone volume
getNodeTankMixingFractionRetrieves the tank Fraction of total volume occupied by the inlet/outlet zone in a 2-compartment tank
getNodeTankMixingModelCodeRetrieves the tank mixing model code
getNodeTankMixingModelTypeRetrieves the tank mixing model type
getNodeTankNameIDRetrieves the tank IDs
getNodeTankReservoirCountRetrieves the number of tanks
getNodeTankVolumeRetrieves the tank volume
getNodeTankVolumeCurveIndexRetrieves the tank volume curve index
getNodeTypeRetrieves the node-type code for all nodes
getNodeTypeIndexRetrieves the node-type code for all nodes
getNodesConnectingLinksIDRetrieves the id of the from/to nodes of all links
getNodesConnectingLinksIndexRetrieves the indexes of the from/to nodes of all links
getNodesInfoRetrieves nodes info (elevations, demand patterns, emmitter coeff, initial quality, source quality, source pattern index, source type index, node type index)
getOptionsAccuracyValueRetrieves the total normalized flow change for hydraulic convergence
getOptionsCheckFrequencyRetrieves the frequency of hydraulic status checks
getOptionsDampLimitRetrieves the accuracy level where solution damping begins
getOptionsDemandChargeRetrieves the energy charge per maximum KW usage
getOptionsDemandPatternRetrieves the default Demand pattern
getOptionsEmitterBackFlowRetrieves the current setting for allowing reverse flow through emitters
getOptionsEmitterExponentRetrieves the power exponent for the emmitters
getOptionsExtraTrialsRetrieves the extra trials allowed if hydraulics don't converge
getOptionsFlowChangeRetrieves the maximum flow change for hydraulic convergence
getOptionsGlobalEfficRetrieves the global efficiency for pumps(percent)
getOptionsGlobalPatternRetrieves the index of the global energy price pattern
getOptionsGlobalPriceRetrieves the global average energy price per kW-Hour
getOptionsHeadErrorRetrieves the maximum head loss error for hydraulic convergence
getOptionsHeadLossFormulaRetrieves the headloss formula
getOptionsLimitingConcentrationRetrieves the limiting concentration for growth reactions
getOptionsMaxTrialsRetrieves the maximum hydraulic trials allowed for hydraulic convergence
getOptionsMaximumCheckRetrieves the maximum trials for status checking
getOptionsPatternDemandMultiplierRetrieves the global pattern demand multiplier
getOptionsPipeBulkReactionOrderRetrieves the bulk water reaction order for pipes
getOptionsPipeWallReactionOrderRetrieves the wall reaction order for pipes (either 0 or 1)
getOptionsPressureUnitsget the pressure unit used in Epanet
getOptionsQualityToleranceRetrieves the water quality analysis tolerance
getOptionsSpecificDiffusivityRetrieves the specific diffusivity (relative to chlorine at 20 deg C)
getOptionsSpecificGravityRetrieves the specific gravity
getOptionsSpecificViscosityRetrieves the specific viscosity
getOptionsStatusReportget the type of the status report(full/no/normal)
getOptionsTankBulkReactionOrderRetrieves the bulk water reaction order for tanks
getPatternRetrieves the multiplier factor for all patterns and all times
getPatternAverageDefaultValueRetrieves the average value of the default pattern
getPatternAverageValueRetrieves the average values of all the time patterns
getPatternCommentRetrieves the comment string assigned to the pattern object
getPatternCountRetrieves the number of patterns
getPatternIndexRetrieves the index of all or some time patterns given their IDs
getPatternLengthsRetrieves the number of time periods in all or some time patterns
getPatternNameIDRetrieves the ID label of all or some time patterns indices
getPatternValueRetrieves the multiplier factor for a certain pattern and time
getQualityCodeRetrieves the code of water quality analysis type
getQualityInfoRetrieves quality analysis information (type, chemical name, units, trace node ID)
getQualityTraceNodeIndexRetrieves the trace node index of water quality analysis type
getQualityTypeRetrieves the type of water quality analysis type
getRuleCountRetrieves the number of rules
getRuleEnabledRetrieves the enabled state of a specific rule in the EPANET model
getRuleIDRetrieves the ID name of a rule-based control given its index
getRuleInfoRetrieves summary information about a rule-based control given it's index
getRulesRetrieves the rule - based control statements
getStatisticReturns error code
getStatisticDeficientNodesRetrieves the number of deficient nodes in the simulation
getStatisticDemandReductionRetrieves the demand reduction statistic from the simulation
getStatisticIterationsRetrieves the number of iterations taken in the simulation
getStatisticRelativeErrorRetrieves the relative error statistic from the simulation
getStatisticTotalLeakageLossRetrieves the total leakage loss statistic from the simulation.
getTimeHTimeRetrieves the elapsed time of current hydraulic solution
getTimeHaltFlagRetrieves the number of halt flag indicating if the simulation was halted
getTimeHydraulicStepRetrieves the value of the hydraulic time step
getTimeNextEventRetrieves the shortest time until a tank becomes empty or full
getTimeNextEventTankRetrieves the index of tank with shortest time to become empty or full
getTimePatternStartRetrieves the value of pattern start time
getTimePatternStepRetrieves the value of the pattern time step
getTimeQTimeRetrieves the elapsed time of current quality solution
getTimeQualityStepRetrieves the value of the water quality time step
getTimeReportingPeriodsRetrieves the number of reporting periods saved to the binary
getTimeReportingStartRetrieves the value of the reporting start time
getTimeReportingStepRetrieves the value of the reporting time step
getTimeRuleControlStepRetrieves the time step for evaluating rule-based controls
getTimeSimulationDurationRetrieves the value of simulation duration
getTimeStartClockStartTimeRetrieves the simulation starting time of day
getTimeStartTimeRetrieves the simulation starting time of day
getTimeStatisticsIndexRetrieves the index of the type of time series post-processing
getTimeStatisticsTypeRetrieves the type of time series post-processing
getTimetoNextEventDetermines the type of event that will cause the end of the current time step/duration/index
getTitleRetrieves the title lines of the project
getUnitsRetrieves the Units of Measurement
getVersionRetrieves the current EPANET version of DLL
initializeEPANETInitializes an EPANET project that isn't opened with an input fil
initializeHydraulicAnalysisInitializes storage tank levels, link status and settings, and the simulation clock time prior to running a hydraulic analysis
initializeQualityAnalysisInitializes water quality and the simulation clock time prior to running a water quality analysis
loadEPANETFileLoad epanet file when use bin functions
loadMSXEPANETFileRe-Load EPANET MSX file - parfor
loadPatternFileloads time patterns from a file into a project under a specific pattern ID
nextHydraulicAnalysisStepDetermines the length of time until the next hydraulic event occurs in an extended period simulation
nextQualityAnalysisStepAdvances the water quality simulation to the start of the next hydraulic time period
openAnyInpOpen as on matlab editor any EPANET input file using built function open
openCurrentInpOpens EPANET input file who is loade
openHydraulicAnalysisOpens the hydraulics analysis system
openQualityAnalysisOpens the water quality analysis system
openXenable the opening of input files with formatting errors
plotPlot Network, show all components, plot pressure/flow/elevation
plot_closeClose all open figures
plot_saveSave plot
plot_showShow plot
reloadNetworkReloads the Network (ENopen)
runEPANETexeRuns epanet .exe file
runHydraulicAnalysisRuns a single period hydraulic analysis, retrieving the current simulation clock time t
runQualityAnalysisMakes 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
runsCompleteSimulationRuns 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
saveHydraulicFileSaves the current contents of the binary hydraulics file to a file
saveHydraulicsOutputReportingFileTransfers results of a hydraulic simulation from the binary Hydraulics file to the binary Output file, where results are only reported at uniform reporting intervals
saveInputFileWrites all current network input data to a file using the format of an EPANET input file
setCMDCODESets the CMC code
setControlEnabledSets the control state to either enable or disable in the EPANET model
setControlsSets the parameters of a simple control statement
setCurveSets x, y values for a specific curve
setCurveCommentSets the comment string of a curve
setCurveNameIDSets the name ID of a curve given it's index and the new ID
setCurveTypeSets the type of a specified curve in the EPANET model
setCurveTypeEfficiencySets the type of curve to Efficiency in the EPANET model
setCurveTypeGeneralSets the type of a curve to general in the EPANET model
setCurveTypeHeadlossSets the type of a curve to Headloss in the EPANET model
setCurveTypePumpSets the type of a curve to Pump in the EPANET model
setCurveTypeValveCurveSets the type of a curve to Valve in the EPANET model
setCurveTypeVolumeSets the type of a curve to Volume in the EPANET model
setCurveValueSets x, y point for a specific point number and curve
setDemandModelSets the type of demand model to use and its parameters
setFlowUnitsAFDSets flow units to AFD(Acre-Feet per Day)
setFlowUnitsCFSSets flow units to CFS(Cubic Feet per Second)
setFlowUnitsCMDSets flow units to CMD(Cubic Meters per Day)
setFlowUnitsCMHSets flow units to CMH(Cubic Meters per Hour)
setFlowUnitsCMSSets flow units to CMS(Cubic Meters per Second)
setFlowUnitsGPMSets flow units to GPM(Gallons Per Minute)
setFlowUnitsIMGDSets flow units to IMGD(Imperial Million Gallons per Day)
setFlowUnitsLPMSets flow units to LPM(Liters Per Minute)
setFlowUnitsLPSSets flow units to LPS(Liters Per Second)
setFlowUnitsMGDSets flow units to MGD(Million Gallons per Day)
setFlowUnitsMLDSets flow units to MLD(Million Liters per Day)
setLinkBulkReactionCoeffSets the value of bulk chemical reaction coefficient
setLinkCommentSets the comment string assigned to the link object
setLinkDiameterSets the values of diameters
setLinkExpansionPropertiesSets the expansion properties for a specified link (pipe)
setLinkInitialSettingSets the values of initial settings, roughness for pipes or initial speed for pumps or initial setting for valves
setLinkInitialStatusSets the values of initial status
setLinkLeakAreaSets the leak area for a specified link (pipe)
setLinkLengthSets the values of lengths
setLinkMinorLossCoeffSets the values of minor loss coefficient
setLinkNameIDSets the ID name for links
setLinkNodesIndexSets the indexes of a link's start- and end-nodes
setLinkPipeDataSets a group of properties for a pipe
setLinkPumpECostSets the pump average energy price
setLinkPumpECurveSets the pump efficiency v
setLinkPumpEPatSets the pump energy price time pattern index
setLinkPumpHCurveSets the pump head v
setLinkPumpHeadCurveIndexSets the curves index for pumps index
setLinkPumpPatternIndexSets the pump speed time pattern index
setLinkPumpPowerSets the power for pumps
setLinkRoughnessCoeffSets the values of roughness coefficient
setLinkSettingsSets the values of current settings, roughness for pipes or initial speed for pumps or initial setting for valves
setLinkStatusSets the values of current status for links
setLinkTypePipeSets the link type pipe for a specified link
setLinkTypePipeCVSets the link type cvpipe(pipe with check valve) for a specified link
setLinkTypePumpSets the link type pump for a specified link
setLinkTypeValveFCVSets the link type valve FCV(flow control valve) for a specified link
setLinkTypeValveGPVSets the link type valve GPV(general purpose valve) for a specified link
setLinkTypeValvePBVSets the link type valve PBV(pressure breaker valve) for a specified link
setLinkTypeValvePCVSets the link type valve PCV(Position control valve) for a specified link
setLinkTypeValvePRVSets the link type valve PRV(pressure reducing valve) for a specified link
setLinkTypeValvePSVSets the link type valve PSV(pressure sustaining valve) for a specified link
setLinkTypeValveTCVSets the link type valve TCV(throttle control valve) for a specified link
setLinkValveCurveGPVSets the valve curve for a specified general purpose valve (GPV)
setLinkValveCurvePCVSets the valve curve for a specified pressure control valve (PCV)
setLinkVerticesAssigns a set of internal vertex points to a link
setLinkWallReactionCoeffSets the value of wall chemical reaction coefficient
setNodeBaseDemandsSets the values of demand for nodes
setNodeCommentSets the comment string assigned to the node object
setNodeCoordinatesSets node coordinates
setNodeDemandPatternIndexSets the values of demand time pattern indices
setNodeElevationsSets the values of elevation for nodes
setNodeEmitterCoeffSets the values of emitter coefficient for nodes
setNodeInitialQualitySets the values of initial quality for nodes
setNodeJunctionDataSets a group of properties for a junction node
setNodeJunctionDemandNameAssigns a name to a node's demand category
setNodeNameIDSets the ID name for nodes
setNodeSourcePatternIndexSets the values of quality source pattern index
setNodeSourceQualitySets the values of quality source strength
setNodeSourceTypeSets the values of quality source type
setNodeTankBulkReactionCoeffSets the tank bulk reaction coefficient
setNodeTankCanOverFlowSets the tank can-overflow (= 1) or not (= 0)
setNodeTankDataSets a group of properties for a tank
setNodeTankDiameterSets the diameter value for tanks
setNodeTankInitialLevelSets the values of initial level for tanks
setNodeTankMaximumWaterLevelSets the maximum water level value for tanks
setNodeTankMinimumWaterLevelSets the minimum water level value for tanks
setNodeTankMinimumWaterVolumeSets the minimum water volume value for tanks
setNodeTankMixingFractionSets the tank mixing fraction of total volume occupied by the inlet/outlet zone in a 2-compartment tank
setNodeTankMixingModelTypeSets the mixing model type value for tanks
setNodeTypeJunctionTransforms a node to JUNCTION The new node keeps the id,coordinates and elevation of the deleted on
setNodeTypeReservoirTransforms a node to RESERVOIR The new node keeps the id,coordinates and elevation of the deleted on
setNodeTypeTankTransforms a node to TANK The new node keeps the id,coordinates and elevation of the deleted on
setNodesConnectingLinksIDSets the IDs of a link's start- and end-nodes
setOptionsAccuracyValueSets the total normalized flow change for hydraulic convergence
setOptionsCheckFrequencySets the frequency of hydraulic status checks
setOptionsDampLimitSets the accuracy level where solution damping begins
setOptionsDemandChargeSets the energy charge per maximum KW usage
setOptionsDemandPatternRetrieves the default Demand pattern
setOptionsEmitterBackFlowAllowedSets the option to allow reverse flow through emitters
setOptionsEmitterBackFlowDisallowedSets the option prevent reverse flow through emitters
setOptionsEmitterExponentSets the power exponent for the emmitters
setOptionsExtraTrialsSets the extra trials allowed if hydraulics don't converge
setOptionsFlowChangeSets the maximum flow change for hydraulic convergence
setOptionsGlobalEfficSets the global efficiency for pumps(percent)
setOptionsGlobalPatternSets the global energy price pattern
setOptionsGlobalPriceSets the global average energy price per kW-Hour
setOptionsHeadErrorSets the maximum head loss error for hydraulic convergence
setOptionsHeadLossFormulaSets the headloss formula
setOptionsLimitingConcentrationSets the limiting concentration for growth reactions
setOptionsMaxTrialsSets the maximum hydraulic trials allowed for hydraulic convergence
setOptionsMaximumCheckSets the maximum trials for status checking
setOptionsPatternDemandMultiplierSets the global pattern demand multiplier
setOptionsPipeBulkReactionOrderSets the bulk water reaction order for pipes
setOptionsPipeWallReactionOrderSets the wall reaction order for pipes (either 0 or 1)
setOptionsPressureUnitsSets the pressure unit used in Epanet
setOptionsPressureUnitsKPASet pressure units to KPA and check if the change is possible
setOptionsPressureUnitsMetersSet pressure units to Meters and check if the change is possible
setOptionsPressureUnitsPSISet pressure units to PSI and check if the change is possible
setOptionsQualityToleranceSets the water quality analysis tolerance
setOptionsSpecificDiffusivitySets the specific diffusivity (relative to chlorine at 20 deg C)
setOptionsSpecificGravitySets the specific gravity
setOptionsSpecificViscositySets the specific viscosity
setOptionsStatusReportSets the status report for epanet
setOptionsStatusReportFullset the status report option to full report
setOptionsStatusReportNoset the status report option to no Report
setOptionsStatusReportNormalset the status report option to normal report
setOptionsTankBulkReactionOrderSets the bulk water reaction order for tanks
setPatternSets all of the multiplier factors for a specific time pattern
setPatternCommentSets the comment string assigned to the pattern object
setPatternMatrixSets all of the multiplier factors for all time patterns
setPatternNameIDSets the name ID of a time pattern given it's index and the new ID
setPatternValueSets the multiplier factor for a specific period within a time pattern
setQualityTypeSets the type of water quality analysis called for
setReportIssues a report formatting command
setReportFormatResetResets a project's report options to their default values
setReportStatusSets the level of hydraulic status reporting
setRuleElseActionSets rule - based control else actions
setRuleEnabledEnables a specific rule in the EPANET model
setRulePremiseSets the premise of a rule - based control
setRulePremiseObjectNameIDSets the ID of an object in a premise of a rule-based control
setRulePremiseStatusSets the status being compared to in a premise of a rule-based control
setRulePremiseValueSets the value being compared to in a premise of a rule-based control
setRulePrioritySets rule - based control priority
setRuleThenActionSets rule - based control then actions
setRulesSets a rule - based control
setTimeClockStartTimeSets the start time for simulation
setTimeHydraulicStepSets the hydraulic time step
setTimePatternStartSets the time when time patterns begin
setTimePatternStepSets the time pattern step
setTimeQualityStepSets the quality time step
setTimeReportingStartSets the time when reporting starts
setTimeReportingStepSets the reporting time step
setTimeRuleControlStepSets the rule-based control evaluation time step
setTimeSimulationDurationSets the simulation duration (in seconds)
setTimeStatisticsTypeSets the statistic type
setTitleSets the title lines of the project
setVertexSets the coordinates of a vertex point in a link within the EPANET model
solveCompleteHydraulicsRuns a complete hydraulic simulation with results for all time periods written to the binary Hydraulics file
solveCompleteQualityRuns a complete water quality simulation with results at uniform reporting intervals written to EPANET's binary Output file
splitPipeSplits a pipe, creating two new pipes and adds a junction/node in between
stepQualityAnalysisTimeLeftAdvances the water quality simulation one water quality time step
unloadunload library and close the EPANET Toolkit system
useHydraulicFileUses the contents of the specified file as the current binary hydraulics file
writeLineInReportFileWrites a line of text to the EPANET report file
writeReportWrites a formatted text report on simulation results to the Report file

MSX Functions

FunctionDescription
addMSXPatternAdds a new, empty MSX source time pattern to the project
getMSXAreaUnitsRetrieves the area units (FT2/M2/CM2)
getMSXAtolRetrieves the absolute concentration tolerance
getMSXCompilerRetrieves the compiler (NONE/VC/GC)
getMSXComputedLinkQualitySpecieReturns the link quality for specific specie
getMSXComputedNodeQualitySpecieReturns the node quality for specific specie
getMSXComputedQualityLinkReturns the computed quality for links.
getMSXComputedQualityNodeRetrieves the concentration of a chemical species at a specific node of the network at the current simulation time step.
getMSXComputedQualitySpecieRetrieves the quality values for specific specie (e.g getMSXComputedQualitySpecie('CL2'))
getMSXComputedQualitySpecieRetrieves the quality values for specific specie (e.g getMSXComputedQualitySpecie(['CL2']))
getMSXConstantsCountRetrieves the number of constants
getMSXConstantsIndexRetrieves the internal index number of constants (given its ID name)
getMSXConstantsNameIDRetrieves the ID name of constants (given its internal index number)
getMSXConstantsValueRetrieves the constant's value.
getMSXCouplingRetrieves the coupling (FULL/NONE)
getMSXEquationsPipesRetrieves the species dynamics in pipes
getMSXEquationsTanksRetrieves the species dynamics in tanks
getMSXEquationsTermsRetrieves the species dynamics in terms
getMSXErrorReturns the text for an error message given its error code
getMSXLinkInitqualValueRetrieves the initial concentration of chemical species assigned to links of the pipe network
getMSXNodeInitqualValueRetrieves the initial concentration of chemical species assigned to nodes
getMSXOptionsRetrieves all the msx option parameters
getMSXParametersCountRetrieves the number of parameters
getMSXParametersIndexRetrieves the indices of parameters
getMSXParametersNameIDRetrieves the ID name of parameters
getMSXParametersPipesValueRetrieves the value of reaction parameters for pipes
getMSXParametersTanksValueRetrieves the value of reaction parameters for tanks
getMSXPatternRetrieves the multiplier factor for all patterns and all times
getMSXPatternValueRetrieves the multiplier at a specific time period for a given source time pattern
getMSXPatternsCountRetrieves the number of patterns
getMSXPatternsIndexRetrieves the indices of patterns
getMSXPatternsLengthsRetrieves the number of time periods in all or some patterns
getMSXPatternsNameIDRetrieves the patterns IDs
getMSXRateUnitsRetrieves the rate/time units (SEC/MIN/HR/DAY)
getMSXRtolRetrieves the relative concentration tolerance
getMSXSolverRetrieves the solver method.
getMSXSourceLevelRetrieves the value of all nodes source level
getMSXSourceNodeNameIDRetrieves the ID label of all nodes
getMSXSourcePatternIndexRetrieves the value of all node source pattern index
getMSXSourceTypeRetrieves the value of all node source type
getMSXSourcesRetrieves Msx sources
getMSXSpeciesATOLRetrieves the atol
getMSXSpeciesConcentrationRetrieves the concentration of chemical species for nodes and links
getMSXSpeciesCountRetrieves the number of species
getMSXSpeciesIndexRetrieves the indices of species
getMSXSpeciesNameIDRetrieves the species IDs
getMSXSpeciesRTOLRetrieves the rtol
getMSXSpeciesTypeRetrieves the type of all species (BULK/WALL)
getMSXSpeciesUnitsRetrieves the species mass units
getMSXTimeStepRetrieves the time step
getMethodsReturns all methods of epanet
loadMSXFileLoads an msx file
initializeMSXQualityAnalysisInitializes the MSX system before solving for water quality results in step-wise fashion
plotMSXSpeciesLinkConcentrationPlots concentration of species for links over time.
plotMSXSpeciesNodeConcentrationPlots concentration of species for nodes over time.
saveMSXFileSaves the data associated with the current MSX project into a new MSX input file
saveMSXQualityFileSaves water quality results computed for each node, link and reporting time period to a named binary file
setMSXAreaUnitsCM2Sets area units to CM2
setMSXAreaUnitsFT2Sets area units to FT2
setMSXAreaUnitsM2Sets area units to M2
setMSXAtolSets the value of Atol
setMSXCompilerGCSets compilet to GC
setMSXCompilerNONESets compiler to None
setMSXCompilerVCSets compiler to VC
setMSXConstantsValueAssigns a new value to a specific reaction constant
setMSXCouplingFULLSets coupling option to FULL
setMSXCouplingNONESets coupling option to NONE
setMSXLinkInitqualValueAssigns an initial concentration of chemical species to links
setMSXNodeInitqualValueAssigns an initial concentration of chemical species to nodes
setMSXParametersPipesValueAssigns a value to a particular reaction parameter for given pipes
setMSXParametersTanksValueAssigns a value to a particular reaction parameter for given tanks
setMSXPatternSets all of the multiplier factors for a specific time pattern
setMSXPatternMatrixSets the multiplier factors for all patterns
setMSXPatternValueAssigns a new value to the multiplier for a specific time period in a given MSX source time pattern
setMSXRateUnitsDAYSets rate units to DAY
setMSXRateUnitsHRSets rate units to HR
setMSXRateUnitsMINSets rate units to MIN
setMSXRateUnitsSECSets rate units to SEC
setMSXRtolSets the value of Rtol
setMSXSolverEULSets solver to EUL (standard Euler integrator)
setMSXSolverRK5Sets solver to RK5 (Runge-Kutta 5th order integrator)
setMSXSolverROS2Sets solver to ROS2 (2nd order Rosenbrock integrator)
setMSXSourcesSets the attributes of an external source of a particular chemical species to a specific node of the pipe network
setMSXTimeStepSets time step
solveMSXCompleteHydraulicsSolves for system hydraulics over the entire simulation period saving results to an internal scratch file
solveMSXCompleteQualitySolves for water quality over the entire simulation period and saves the results to an internal scratch file
stepMSXQualityAnalysisTimeLeftAdvances the water quality solution through a single water quality time step when performing a step-wise simulation
useMSXHydraulicFileUses a previously saved EPANET hydraulics file as the source of hydraulic information
unloadMSXUnloads MSX file
writeMSXFileWrite a new MSX file
writeMSXReportWrites MSX report

List of MSX Functions

FunctionDescription
addMSXPatternAdds a new, empty MSX source time pattern to the project
getMSXAreaUnitsRetrieves the area units (FT2/M2/CM2)
getMSXAtolRetrieves the absolute concentration tolerance
getMSXCompilerRetrieves the compiler (NONE/VC/GC)
getMSXComputedLinkQualitySpecieReturns the link quality for specific specie
getMSXComputedNodeQualitySpecieReturns the node quality for specific specie
getMSXComputedQualityLinkReturns the computed quality for links.
getMSXComputedQualityNodeRetrieves the concentration of a chemical species at a specific node of the network at the current simulation time step.
getMSXComputedQualitySpecieRetrieves the quality values for specific specie (e.g getMSXComputedQualitySpecie('CL2'))
getMSXComputedQualitySpecieRetrieves the quality values for specific specie (e.g getMSXComputedQualitySpecie(['CL2']))
getMSXConstantsCountRetrieves the number of constants
getMSXConstantsIndexRetrieves the internal index number of constants (given its ID name)
getMSXConstantsNameIDRetrieves the ID name of constants (given its internal index number)
getMSXConstantsValueRetrieves the constant's value.
getMSXCouplingRetrieves the coupling (FULL/NONE)
getMSXEquationsPipesRetrieves the species dynamics in pipes
getMSXEquationsTanksRetrieves the species dynamics in tanks
getMSXEquationsTermsRetrieves the species dynamics in terms
getMSXErrorReturns the text for an error message given its error code
getMSXLinkInitqualValueRetrieves the initial concentration of chemical species assigned to links of the pipe network
getMSXNodeInitqualValueRetrieves the initial concentration of chemical species assigned to nodes
getMSXOptionsRetrieves all the msx option parameters
getMSXParametersCountRetrieves the number of parameters
getMSXParametersIndexRetrieves the indices of parameters
getMSXParametersNameIDRetrieves the ID name of parameters
getMSXParametersPipesValueRetrieves the value of reaction parameters for pipes
getMSXParametersTanksValueRetrieves the value of reaction parameters for tanks
getMSXPatternRetrieves the multiplier factor for all patterns and all times
getMSXPatternValueRetrieves the multiplier at a specific time period for a given source time pattern
getMSXPatternsCountRetrieves the number of patterns
getMSXPatternsIndexRetrieves the indices of patterns
getMSXPatternsLengthsRetrieves the number of time periods in all or some patterns
getMSXPatternsNameIDRetrieves the patterns IDs
getMSXRateUnitsRetrieves the rate/time units (SEC/MIN/HR/DAY)
getMSXRtolRetrieves the relative concentration tolerance
getMSXSolverRetrieves the solver method.
getMSXSourceLevelRetrieves the value of all nodes source level
getMSXSourceNodeNameIDRetrieves the ID label of all nodes
getMSXSourcePatternIndexRetrieves the value of all node source pattern index
getMSXSourceTypeRetrieves the value of all node source type
getMSXSourcesRetrieves Msx sources
getMSXSpeciesATOLRetrieves the atol
getMSXSpeciesConcentrationRetrieves the concentration of chemical species for nodes and links
getMSXSpeciesCountRetrieves the number of species
getMSXSpeciesIndexRetrieves the indices of species
getMSXSpeciesNameIDRetrieves the species IDs
getMSXSpeciesRTOLRetrieves the rtol
getMSXSpeciesTypeRetrieves the type of all species (BULK/WALL)
getMSXSpeciesUnitsRetrieves the species mass units
getMSXTimeStepRetrieves the time step
getMethodsReturns all methods of epanet
loadMSXFileLoads an msx file
initializeMSXQualityAnalysisInitializes the MSX system before solving for water quality results in step-wise fashion
plotMSXSpeciesLinkConcentrationPlots concentration of species for links over time.
plotMSXSpeciesNodeConcentrationPlots concentration of species for nodes over time.
saveMSXFileSaves the data associated with the current MSX project into a new MSX input file
saveMSXQualityFileSaves water quality results computed for each node, link and reporting time period to a named binary file
setMSXAreaUnitsCM2Sets area units to CM2
setMSXAreaUnitsFT2Sets area units to FT2
setMSXAreaUnitsM2Sets area units to M2
setMSXAtolSets the value of Atol
setMSXCompilerGCSets compilet to GC
setMSXCompilerNONESets compiler to None
setMSXCompilerVCSets compiler to VC
setMSXConstantsValueAssigns a new value to a specific reaction constant
setMSXCouplingFULLSets coupling option to FULL
setMSXCouplingNONESets coupling option to NONE
setMSXLinkInitqualValueAssigns an initial concentration of chemical species to links
setMSXNodeInitqualValueAssigns an initial concentration of chemical species to nodes
setMSXParametersPipesValueAssigns a value to a particular reaction parameter for given pipes
setMSXParametersTanksValueAssigns a value to a particular reaction parameter for given tanks
setMSXPatternSets all of the multiplier factors for a specific time pattern
setMSXPatternMatrixSets the multiplier factors for all patterns
setMSXPatternValueAssigns a new value to the multiplier for a specific time period in a given MSX source time pattern
setMSXRateUnitsDAYSets rate units to DAY
setMSXRateUnitsHRSets rate units to HR
setMSXRateUnitsMINSets rate units to MIN
setMSXRateUnitsSECSets rate units to SEC
setMSXRtolSets the value of Rtol
setMSXSolverEULSets solver to EUL (standard Euler integrator)
setMSXSolverRK5Sets solver to RK5 (Runge-Kutta 5th order integrator)
setMSXSolverROS2Sets solver to ROS2 (2nd order Rosenbrock integrator)
setMSXSourcesSets the attributes of an external source of a particular chemical species to a specific node of the pipe network
setMSXTimeStepSets time step
solveMSXCompleteHydraulicsSolves for system hydraulics over the entire simulation period saving results to an internal scratch file
solveMSXCompleteQualitySolves for water quality over the entire simulation period and saves the results to an internal scratch file
stepMSXQualityAnalysisTimeLeftAdvances the water quality solution through a single water quality time step when performing a step-wise simulation
useMSXHydraulicFileUses a previously saved EPANET hydraulics file as the source of hydraulic information
unloadMSXUnloads MSX file
writeMSXFileWrite a new MSX file
writeMSXReportWrites MSX report

List of EPANET 2.012 Functions Supported

FunctionDescription
ENaddpatternAdds a new time pattern to the network
ENcloseCloses down the Toolkit system (including all files being processed)
ENcloseHCloses the hydraulic analysis system, freeing all allocated memory
ENcloseQCloses the water quality analysis system, freeing all allocated memory
ENepanetRuns a complete EPANET simulation
ENgetcountRetrieves the number of network components of a specified type
ENgetcontrolRetrieves the parameters of a simple control statement
ENgeterrorRetrieves the text of the message associated with a particular error or warning code
ENgetflowunitsRetrieves a code number indicating the units used to express all flow rates
ENgetlinkidRetrieves the ID label of a link with a specified index
ENgetlinkindexRetrieves the index of a link with a specified ID
ENgetlinknodesRetrieves the indexes of the end nodes of a specified link
ENgetlinktypeRetrieves the link-type code for a specific link
ENgetlinkvalueRetrieves the value of a specific link parameter
ENgetnodeidRetrieves the ID label of a node with a specified index
ENgetnodeindexRetrieves the index of a node with a specified ID
ENgetnodetypeRetrieves the node-type code for a specific node
ENgetnodevalueRetrieves the value of a specific link parameter
ENgetoptionRetrieves the value of a particular analysis option
ENgetpatternidRetrieves the ID label of a particular time pattern
ENgetpatternindexRetrieves the index of a particular time pattern
ENgetpatternlenRetrieves the number of time periods in a specific time pattern
ENgetpatternvalueRetrieves the multiplier factor for a specific time period in a time pattern
ENgetqualtypeRetrieves the type of water quality analysis called for
ENgettimeparamRetrieves the value of a specific analysis time parameter
ENgetversionRetrieves the version number
ENinitHInitializes hydraulic analysis
ENinitQInitializes water quality analysis
ENnextHDetermine time (in seconds) until next hydraulic event
ENnextQAdvances WQ simulation to next hydraulic event
ENopenOpens EPANET input file & reads in network data
ENopenHSets up data structures for hydraulic analysis
ENopenQSets up data structures for WQ analysis
ENreportWrites simulation report to the report file
ENresetreportResets report options to default values
ENrunHRun a hydraulic solution period
ENrunQRetrieves hydraulic & WQ results at time t
ENsaveHSaves hydraulic results to binary file
ENsavehydfileCopies binary hydraulics file to disk
ENsaveinpfileSaves current data to "INP" formatted text file
ENsetcontrolSpecify parameters to define a simple control
ENsetlinkvalueSet a proprty value for a link
ENsetnodevalueSet a property value for a node
ENsetoptionSet a value for an anlysis option
ENsetpatternSet multipliers for a specific pattern
ENsetpatternvalueSet the multiplier for a specific pattern at a specific period
ENsetqualtypeSets the type of water quality analysis called
ENsetreportProcesses a reporting format command
ENsetstatusreportSets the level of hydraulic status reporting
ENsettimeparamSet the value for a time parameter
ENsolveHSolves the network hydraulics for all time periods
ENsolveQSolves for network water quality in all time periods
ENstepQAdvances WQ simulation by a single WQ time step
ENusehydfileOpens previously saved binary hydraulics file
ENwritelineWrites line of text to the report file

Back to top

List of EPANET 2.1 Functions Supported

FunctionDescription
ENaddcurveAdds a new curve appended to the end of the existing curves
ENgetaveragepatternvalueRetrieves the average value of a pattern
ENgetbasedemandRetrieves the nodes base demand for a category
ENgetcoordRetrieves coordinate x, y for a node
ENgetcurveRetrieves a curve's properties
ENgetcurveidRetrieves ID of a curve with specific index
ENgetcurveindexRetrieves index of curve with specific ID
ENgetcurvelenRetrieves number of points in a curve
ENgetcurvevalueRetrieves x,y point for a specific point number and curve
ENgetdemandpatternRetrieves the index of a demand pattern for a specific demand category of a node
ENgetheadcurveindexRetrieves index of a head curve for specific link index
ENgetnumdemandsRetrieves the number of demand categories for a node
ENgetpumptypeRetrieves the type of a pump for specific link index
ENgetqualinfoRetrieves quality analysis information (type, chemical name, units, trace node ID)
ENgetstatisticRetrieves hydraulic simulation statistic
ENsetbasedemandSets the nodes base demand for a category
ENsetcoordSets coordinate x, y for a node
ENsetcurveSets x,y values for a specific curve
ENsetcurvevalueSets x,y point for a specific point and curve

Back to top

List of EPANET 2.2 Functions Supported

FunctionDescription
ENaddcontrolSpecify parameters to add a new simple control
ENaddlinkAdds a new link
ENaddnodeAdds a new node
ENaddruleAdds a new rule-based control to a project
ENadddemandAppends a new demand to a junction node demands list
ENclearreportClears the contents of a project's report file
ENcopyreportCopies the current contents of a project's report file to another file
ENdeletelinkDeletes a link
ENdeletenodeDeletes a node
ENdeletedemandDeletes a demand from a junction node
ENsetcurveidChanges the ID name of a data curve given its index
ENsetpatternidChanges the ID name of a time pattern given its index
ENsetdemandpatternSets the index of the demand pattern assigned to a node for a category index
ENsetheadcurveindexSets the curve index for a specified pump index
ENgetcurvetypeRetrieves the type of a curve
ENgetdemandindexRetrieves the index of a node's named demand category
ENgetpremiseGets the properties of a premise in a rule-based control
ENgetelseactionGets the properties of an ELSE action in a rule-based control
ENgetruleidGets the ID name of a rule-based control given its index
ENgetruleRetrieves summary information about a rule-based control
ENgetthenactionGets the properties of a THEN action in a rule-based control
ENsetflowunitsSets the flow units
ENgetdemandmodelRetrieves the type of demand model in use and its parameters
ENsetdemandmodelSets the type of demand model to use and its parameters
ENsetelseactionSets the properties of an ELSE action in a rule-based control
ENsetnodeidChange the ID name for a node
ENsetlinkidChange the ID name for a link
ENsetpipedataSets a group of properties for a pipe link
ENsetpremiseSets the properties of a premise in a rule-based control
ENsetpremiseindexSets the index of an object in a premise of a rule-based control
ENsetpremisestatusSets the status being compared to in a premise of a rule-based control
ENsetpremisevalueSets the value in a premise of a rule-based control
ENsetruleprioritySets the priority of a rule-based control
ENsettankdataSets a group of properties for a tank node
ENsetthenactionSets the properties of a THEN action in a rule-based control
ENgettitleRetrieves the title lines of the project
ENsettitleSets the title lines of the project
ENsetlinknodesSets the indexes of a link's start- and end-nodes
ENsetlinktypeChanges the type of a particular link (e.g. pipe to pump)
ENgetdemandnameGets the name of a node's demand category
ENsetdemandnameAssigns a name to a node's demand category
ENgetcommentRetrieves the comment string assigned to the object (NODE, LINK, TIMEPAT or CURVE)
ENsetcommentSets the comment string assigned to the object (NODE, LINK, TIMEPAT or CURVE)
ENdeletepatternDeletes a time pattern from a project
ENdeletecurveDeletes a data curve from the project
ENdeletecontrolDeletes an existing simple control
ENdeleteruleDeletes an existing rule-based control
ENsetjuncdataSets a group of properties for a junction node
ENgetvertexRetrieves the coordinate's of a vertex point assigned to a link
ENgetvertexcountRetrieves the number of internal vertex points assigned to a link
ENsetverticesAssigns a set of internal vertex points to a link
ENgetresultindexRetrieves the order in which a node's or link's results were saved to an output file
ENinitInitializes an EPANET project that isn't opened with an input file

Back to top

List of EPANET 2.3 Functions Supported

FunctionDescription
ENgetcontrolenabledGet enabled/disabled flag for a simple control by index (1 = enabled, 0 = disabled)
ENgetlinkvaluesBulk-retrieve property values for all links for a given link property code
ENgetnodevaluesBulk-retrieve property values for all nodes for a given node property code
ENgetruleenabledGet enabled/disabled flag for a rule-based control by rule index
ENloadpatternfileLoad time patterns from an external file into the current project under a specific pattern ID
ENopenXOpen an input file even if it has formatting errors (lenient parsing mode)
ENsetcontrolenabledEnable/disable a specific simple control by index
ENsetcurvetypeSet the type of a curve object (volume, pump, efficiency, headloss, general, valve)
ENsetruleenabledEnable/disable a rule by rule index
ENsetvertexSet the coordinates of a link’s intermediate vertex (polyline point) by vertex index
ENtimetonexteventReturn the type of event that terminates the current time step (hydraulic step, water quality step, tank level event, control event)

List of EPANET MSX Functions API

FunctionDescription
MSXaddpatternAdds a new empty MSX source time pattern to an MSX project
MSXcloseClose .msx file
MSXerrorRetrieves the MSX erorr message for specific erorr code
MSXgetIDRetrieves the ID name of an object given its internal index number
MSXgetIDlenRetrieves the number of characters in the ID name of an MSX object given its internal index number
MSXgetconstantRetrieves the value of a particular rection constant
MSXgetcountRetrieves the number of objects of a specific type
MSXgeterrorReturns the text for an error message given its error code
MSXgetindexRetrieves the number of objects of a specific type
MSXgetinitqualRetrieves the intial concetration of a particular chemical species assigned to a specific node or link of the pipe network
MSXgetparameterRetrieves the value of a particular reaction parameter for a given pipe
MSXgetpatternlenRetrieves the number of time periods within a source time pattern
MSXgetpatternvalueRetrieves the multiplier at a specific time period for a given source time pattern
MSXgetqualRetrieves a chemical species concentration at a given node or the average concentration along a link at the current sumulation time step
MSXgetsourceRetrieves information on any external source of a particular chemical species assigned to a specific node or link of the pipe network
MSXgetspeciesRetrieves the attributes of a chemical species given its internal index number
MSXinitInitialize the MSX system before solving for water quality results in the step-wise fashion
MSXopenOpens .MSX file
MSXreportWrites water quality simulations results as instructed by MSX input file to a text file
MSXsavemsxfileSaves the data associated with the current MSX project into a new MSX input file
MSXsaveoutfileSaves water quality results computed for each node, link and reporting time period to a named binary file
MSXsetconstantAssigns a new value to a specific reaction constant
MSXsetinitqualAssigns an initial concetration of a particular chemical species node or link of the pipe network
MSXsetparameterAssigns a value to a particular reaction parameter for a given pipe or tank within the pipe network
MSXsetpatternAssigns a new set of multipliers to a given MSX source time pattern
MSXsetpatternvalueAssigns a new value to the multiplier for a specific time period in a given MSX source time pattern
MSXsetsourceSets the attributes of an external source of particular chemical species to specific node of the pipe network
MSXsolveHSolves for system hydraulics over the entire simulation period saving results to an internal scratch file
MSXsolveQSolves for water quality over the entire simulation period and saves the results to an internal scratch file
MSXstepAdvances the water quality solution through a single water quality time step when performing a step-wise simulation
MSXusehydfileUses a previously saved EPANET hydraulics file as the source of hydraulic information

Back to top