Package: epyt
EPANET Python Toolkit (EPyT)TheEPANET-Python Toolkitis an open-source software, originally developed by theKIOS Research and Innovation Center of Excellence, University of Cypruswhich operates within the Python environment, for providing a programming interface for the latest version ofEPANET, 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.TheEPANET-Python Toolkitfeatures 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 :http://community.wateranalytics.org/Table of ContentsEPANET Python Toolkit (EPyT)How to citeRequirementsHow to installHow to use the ToolkitHow to fix/report bugsLicensesContributorsContributingRecommendationList of Python Class FunctionsList of EPANET 2.2 FunctionsHow to citeMarios S. Kyriakou, Marios Demetriades, Stelios G. Vrachimis, Demetrios G. Eliades, & Marios M. Polycarpou. (2023). OpenWaterAnalytics/EPyT. Zenodo.https://doi.org/10.5281/zenodo.8277487↑Back to topRequirementsPython >=3.8Windows, OSX or LinuxEPANET 2.2↑Back to topHow to installEnvironments -> base (root) -> open terminal -> pip install epytPyPI:pip install epyt↑Back to topHow to use the ToolkitMinimum Example:>>>fromepytimportepanet>>>>>>d=epanet('Net1.inp')>>>d.getNodeCount()>>>d.getNodeElevations()More examples:https://github.com/KIOS-Research/EPYT/tree/main/epyt/examples↑Back to topHow to fix/report bugsTo fix a bugForktheEPyT,Editthe code and make the appropriate change, and thenPullit so that we evaluate it.Keep in mind that some bugs may exist in theEPANETlibraries, in case you are not receiving the expected results.↑Back to topLicensesEPANET: Public DomainEPANET-Python Toolkit (EPyT): EUPL↑Back to topContributorsMarios Kyriakou,KIOS Research and Innovation Center of Excellence, University of CyprusMarios Demetriades,KIOS Research and Innovation Center of Excellence, University of CyprusStelios Vrachimis,KIOS Research and Innovation Center of Excellence, University of CyprusDemetrios Eliades,KIOS Research and Innovation Center of Excellence, University of CyprusTheEPyTis based/inspired on theEPANET-Matlab Toolkit.ContributingIf you want to contribute, please check out ourCode of Conduct. Everyone is welcome to contribute whether reporting a newissue, 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 apull requestto test the code and discuss your changes.RecommendationInstall AnacondaRunEPyTwithSpyder IDERunEPyTwithPyCharmSettings on Spyder IDETools -> PreferrencesView -> Window layouts -> Matlab layoutEnable interactive plot on matlibplot
: Tools -> Preferences -> IPython console -> Graphics -> Graphics backend -> Backend: Automatic↑Back to topList of Python Class FunctionsFunctionDescriptionaddControlsAdds a new simple controladdCurveAdds a new curve appended to the end of the existing curvesaddLinkPipeAdds a new pipeaddLinkPipeCVAdds a new control valve pipeaddLinkPumpAdds a new pumpaddLinkValveFCVAdds a new FCV valveaddLinkValveGPVAdds a new GPV valveaddLinkValvePBVAdds a new PBV valveaddLinkValvePRVAdds a new PRV valveaddLinkValvePSVAdds a new PSV valveaddLinkValveTCVAdds a new TCV valveaddNodeJunctionAdds a new junctionaddNodeJunctionDemandAdds a new demand to a junction given the junction index, base demand, demand time pattern and demand category nameaddNodeReservoirAdds a new reservoiraddNodeTankAdds a new tankaddPatternAdds a new time pattern to the networkaddRulesAdds a new rule-based control to a projectappRotateNetworkRotates the network by theta degrees counter-clockwiseappShiftNetworkShifts the networkclearReportClears the contents of a project's report filecloseHydraulicAnalysisCloses the hydraulic analysis system, freeing all allocated memorycloseNetworkCloses down the Toolkit systemcloseQualityAnalysisCloses the water quality analysis system, freeing all allocated memorycopyReportCopies the current contents of a project's report file to another filecreateProjectCreates a new epanet projecdeleteAllTempsDelete all temporary files (.inp, .bin) created in networks folderdeleteControlsDeletes an existing simple controldeleteCurveDeletes a data curve from a projectdeleteLinkDeletes a linkdeleteNodeDeletes nodesdeletePatternDeletes a time pattern from a projectdeletePatternsAllDeletes all time patterns from a projectdeleteProjectDeletes the epanet projectdeleteRulesDeletes an existing rule-based control given it's indexgetAdjacencyMatrixCompute the adjacency matrix (connectivity graph) considering the flows, using mean flowgetCMDCODERetrieves the CMC codegetComputedHydraulicTimeSeriesComputes hydraulic simulation and retrieves all time-seriesgetComputedQualityTimeSeriesComputes Quality simulation and retrieves all or some time-seriesgetComputedTimeSeriesRun analysis with binary filgetConnectivityMatrixRetrieve the Connectivity Matrix of the networgetControlRulesCountRetrieves the number of controlsgetControlsRetrieves the parameters of all control statementsgetCountsRetrieves the number of network componentsgetCurveCommentRetrieves the comment string of a curvegetCurveCountRetrieves the number of curvesgetCurveIndexRetrieves the index of a curve with specific IDgetCurveLengthsRetrieves number of points in a curvegetCurveNameIDRetrieves the IDs of curvesgetCurveTypeRetrieves the curve-type for all curvesgetCurveTypeIndexRetrieves the curve-type index for all curvesgetCurveValueRetrieves the X, Y values of points of curvesgetCurvesInfoRetrieves all the info of curvesgetDemandModelRetrieves the type of demand model in use and its parametersgetENfunctionsImpementedRetrieves the epanet functions that have been developedgetErrorRetrieves the text of the message associated with a particular error or warning codegetFlowUnitsRetrieves flow units used to express all flow ratesgetLibFunctionsRetrieves the functions of DLLgetLinkActualQualityRetrieves the current computed link quality (read only)getLinkBulkReactionCoeffRetrieves the value of all link bulk chemical reaction coefficientgetLinkCommentRetrieves the comment string assigned to the link objectgetLinkCountRetrieves the number of linksgetLinkDiameterRetrieves the value of link diametersgetLinkEnergyRetrieves the current computed pump energy usage (read only)getLinkFlowsRetrieves the current computed flow rate (read only)getLinkHeadlossRetrieves the current computed head loss (read only)getLinkIndexRetrieves the indices of all links, or the indices of an ID set of linksgetLinkInitialSettingRetrieves the value of all link roughness for pipes or initial speed for pumps or initial setting for valvesgetLinkInitialStatusRetrieves the value of all link initial statusgetLinkLengthRetrieves the value of link lengthsgetLinkMinorLossCoeffRetrieves the value of link minor loss coefficientsgetLinkNameIDRetrieves the ID label(s) of all links, or the IDs of an index set of linksgetLinkNodesIndexRetrieves the indexes of the from/to nodes of all linksgetLinkPipeCountRetrieves the number of pipesgetLinkPipeIndexRetrieves the pipe indicesgetLinkPipeNameIDRetrieves the pipe IDgetLinkPumpCountRetrieves the number of pumpsgetLinkPumpECostRetrieves the pump average energy pricegetLinkPumpECurveRetrieves the pump efficiency vgetLinkPumpEPatRetrieves the pump energy price time pattern indexgetLinkPumpEfficiencyRetrieves the current computed pump efficiency (read only)getLinkPumpHCurveRetrieves the pump head vgetLinkPumpHeadCurveIndexRetrieves the index of a head curve for all pumpsgetLinkPumpIndexRetrieves the pump indicesgetLinkPumpNameIDRetrieves the pump IDgetLinkPumpPatternIndexRetrieves the pump speed time pattern indexgetLinkPumpPatternNameIDRetrieves pump pattern name IDgetLinkPumpPowerRetrieves the pump constant power rating (read only)getLinkPumpStateRetrieves the current computed pump state (read only) (see @ref EN_PumpStateType)getLinkPumpSwitchesRetrieves the number of pump switchesgetLinkPumpTypeRetrieves the type of a pumpgetLinkPumpTypeCodeRetrieves the code of type of a pumpgetLinkQualityRetrieves the value of link qualitygetLinkResultIndexRetrieves the order in which a link's results were saved to an output filegetLinkRoughnessCoeffRetrieves the value of link roughness coefficientgetLinkSettingsRetrieves the current computed value of all link roughness for pipes or actual speed for pumps or actual setting for valvesgetLinkStatusRetrieves the current link status (see @ref EN_LinkStatusType) (0 = closed, 1 = open)getLinkTypeRetrieves the link-type code for all linksgetLinkTypeIndexRetrieves the link-type code for all linksgetLinkValveCountRetrieves the number of valvesgetLinkValveIndexRetrieves the valve indicesgetLinkValveNameIDRetrieves the valve IDgetLinkVelocityRetrieves the current computed flow velocity (read only)getLinkVerticesRetrieves the coordinate's of a vertex point assigned to a linkgetLinkVerticesCountRetrieves the number of internal vertex points assigned to a linkgetLinkWallReactionCoeffRetrieves the value of all pipe wall chemical reaction coefficientgetLinksInfoRetrieves all link infogetNetworksDatabaseRetrieves all EPANET Input Files from EPyT databasegetNodeActualDemandRetrieves the computed value of all node actual demandsgetNodeActualDemandSensingNodesRetrieves the computed demand values at some sensing nodesgetNodeActualQualityRetrieves the computed values of the actual quality for all nodesgetNodeActualQualitySensingNodesRetrieves the computed quality values at some sensing nodegetNodeBaseDemandsRetrieves the value of all node base demandsgetNodeCommentRetrieves the comment string assigned to the node objectgetNodeCoordinatesgetNodeCountRetrieves the number of nodesgetNodeDemandCategoriesNumberRetrieves the value of all node base demands categorie numbergetNodeDemandDeficitRetrieves the amount that full demand is reduced under PDAgetNodeDemandPatternIndexRetrieves the value of all node base demands pattern indexgetNodeDemandPatternNameIDRetrieves the value of all node base demands pattern name IDgetNodeElevationsRetrieves the value of all node elevationsgetNodeEmitterCoeffRetrieves the value of all node emmitter coefficientsgetNodeHydraulicHeadRetrieves the computed values of all node hydraulic headsgetNodeIndexRetrieves the indices of all nodes or some nodes with a specified IDgetNodeInitialQualityRetrieves the value of all node initial qualitygetNodeJunctionCountRetrieves the number of junction nodesgetNodeJunctionDemandIndexRetrieves the demand index of the junctionsgetNodeJunctionDemandNameGets the name of a node's demand categorygetNodeJunctionIndexRetrieves the indices of junctionsgetNodeJunctionNameIDRetrieves the junction ID labelgetNodeMassFlowRateRetrieves the computed mass flow rates per minute of chemical sources for all nodesgetNodeNameIDRetrieves the ID label of all nodes or some nodes with a specified indexgetNodePatternIndexRetrieves the value of all node demand pattern indicesgetNodePressureRetrieves the computed values of all node pressuresgetNodeReservoirCountRetrieves the number of ReservoirsgetNodeReservoirIndexRetrieves the indices of reservoirsgetNodeReservoirNameIDRetrieves the reservoir ID labelgetNodeResultIndexRetrieves the order in which a node's results were saved to an output filegetNodeSourcePatternIndexRetrieves the value of all node source pattern indexgetNodeSourceQualityRetrieves the value of all node source qualitygetNodeSourceTypeRetrieves the value of all node source typegetNodeSourceTypeIndexRetrieves the value of all node source type indexgetNodeTankBulkReactionCoeffRetrieves the tank bulk rate coefficientgetNodeTankCanOverFlowRetrieves the tank can overflow (= 1) or not (= 0)getNodeTankCountRetrieves the number of TanksgetNodeTankDataRetrieves a group of properties for a tankgetNodeTankDiameterRetrieves the tank diametersgetNodeTankIndexRetrieves the tank indicesgetNodeTankInitialLevelRetrieves the value of all tank initial water levelsgetNodeTankInitialWaterVolumeRetrieves the tank initial water volumegetNodeTankMaximumWaterLevelRetrieves the tank maximum water levelgetNodeTankMaximumWaterVolumeRetrieves the tank maximum water volumegetNodeTankMinimumWaterLevelRetrieves the tank minimum water levelgetNodeTankMinimumWaterVolumeRetrieves the tank minimum water volumegetNodeTankMixZoneVolumeRetrieves the tank mixing zone volumegetNodeTankMixingFractionRetrieves the tank Fraction of total volume occupied by the inlet/outlet zone in a 2-compartment tankgetNodeTankMixingModelCodeRetrieves the tank mixing model codegetNodeTankMixingModelTypeRetrieves the tank mixing model typegetNodeTankNameIDRetrieves the tank IDsgetNodeTankReservoirCountRetrieves the number of tanksgetNodeTankVolumeRetrieves the tank volumegetNodeTankVolumeCurveIndexRetrieves the tank volume curve indexgetNodeTypeRetrieves the node-type code for all nodesgetNodeTypeIndexRetrieves the node-type code for all nodesgetNodesConnectingLinksIDRetrieves the id of the from/to nodes of all linksgetNodesConnectingLinksIndexRetrieves the indexes of the from/to nodes of all linksgetNodesInfoRetrieves 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 convergencegetOptionsCheckFrequencyRetrieves the frequency of hydraulic status checksgetOptionsDampLimitRetrieves the accuracy level where solution damping beginsgetOptionsDemandChargeRetrieves the energy charge per maximum KW usagegetOptionsEmitterExponentRetrieves the power exponent for the emmittersgetOptionsExtraTrialsRetrieves the extra trials allowed if hydraulics don't convergegetOptionsFlowChangeRetrieves the maximum flow change for hydraulic convergencegetOptionsGlobalEfficRetrieves the global efficiency for pumps(percent)getOptionsGlobalPatternRetrieves the index of the global energy price patterngetOptionsGlobalPriceRetrieves the global average energy price per kW-HourgetOptionsHeadErrorRetrieves the maximum head loss error for hydraulic convergencegetOptionsHeadLossFormulaRetrieves the headloss formulagetOptionsLimitingConcentrationRetrieves the limiting concentration for growth reactionsgetOptionsMaxTrialsRetrieves the maximum hydraulic trials allowed for hydraulic convergencegetOptionsMaximumCheckRetrieves the maximum trials for status checkinggetOptionsPatternDemandMultiplierRetrieves the global pattern demand multipliergetOptionsPipeBulkReactionOrderRetrieves the bulk water reaction order for pipesgetOptionsPipeWallReactionOrderRetrieves the wall reaction order for pipes (either 0 or 1)getOptionsQualityToleranceRetrieves the water quality analysis tolerancegetOptionsSpecificDiffusivityRetrieves the specific diffusivity (relative to chlorine at 20 deg C)getOptionsSpecificGravityRetrieves the specific gravitygetOptionsSpecificViscosityRetrieves the specific viscositygetOptionsTankBulkReactionOrderRetrieves the bulk water reaction order for tanksgetPatternRetrieves the multiplier factor for all patterns and all timesgetPatternAverageValueRetrieves the average values of all the time patternsgetPatternCommentRetrieves the comment string assigned to the pattern objectgetPatternCountRetrieves the number of patternsgetPatternIndexRetrieves the index of all or some time patterns given their IDsgetPatternLengthsRetrieves the number of time periods in all or some time patternsgetPatternNameIDRetrieves the ID label of all or some time patterns indicesgetPatternValueRetrieves the multiplier factor for a certain pattern and timegetQualityCodeRetrieves the code of water quality analysis typegetQualityInfoRetrieves quality analysis information (type, chemical name, units, trace node ID)getQualityTraceNodeIndexRetrieves the trace node index of water quality analysis typegetQualityTypeRetrieves the type of water quality analysis typegetRuleCountRetrieves the number of rulesgetRuleIDRetrieves the ID name of a rule-based control given its indexgetRuleInfoRetrieves summary information about a rule-based control given it's indexgetRulesRetrieves the rule - based control statementsgetStatisticReturns error codegetTimeHTimeRetrieves the elapsed time of current hydraulic solutiongetTimeHaltFlagRetrieves the number of halt flag indicating if the simulation was haltedgetTimeHydraulicStepRetrieves the value of the hydraulic time stepgetTimeNextEventRetrieves the shortest time until a tank becomes empty or fullgetTimeNextEventTankRetrieves the index of tank with shortest time to become empty or fullgetTimePatternStartRetrieves the value of pattern start timegetTimePatternStepRetrieves the value of the pattern time stepgetTimeQTimeRetrieves the elapsed time of current quality solutiongetTimeQualityStepRetrieves the value of the water quality time stepgetTimeReportingPeriodsRetrieves the number of reporting periods saved to the binarygetTimeReportingStartRetrieves the value of the reporting start timegetTimeReportingStepRetrieves the value of the reporting time stepgetTimeRuleControlStepRetrieves the time step for evaluating rule-based controlsgetTimeSimulationDurationRetrieves the value of simulation durationgetTimeStartTimeRetrieves the simulation starting time of daygetTimeStatisticsIndexRetrieves the index of the type of time series post-processinggetTimeStatisticsTypeRetrieves the type of time series post-processinggetTitleRetrieves the title lines of the projectgetUnitsRetrieves the Units of MeasurementgetVersionRetrieves the current EPANET version of DLLinitializeEPANETInitializes an EPANET project that isn't opened with an input filinitializeHydraulicAnalysisInitializes storage tank levels, link status and settings, and the simulation clock time prior to running a hydraulic analysisinitializeQualityAnalysisInitializes water quality and the simulation clock time prior to running a water quality analysisloadEPANETFileLoad epanet file when use bin functionsnextHydraulicAnalysisStepDetermines the length of time until the next hydraulic event occurs in an extended period simulationnextQualityAnalysisStepAdvances the water quality simulation to the start of the next hydraulic time periodopenAnyInpOpen as on matlab editor any EPANET input file using built function openopenCurrentInpOpens EPANET input file who is loadeopenHydraulicAnalysisOpens the hydraulics analysis systemopenQualityAnalysisOpens the water quality analysis systemplotPlot Network, show all components, plot pressure/flow/elevationplot_closeClose all open figuresplot_saveSave plotplot_showShow plotreloadNetworkReloads the Network (ENopen)runEPANETexeRuns epanet .exe filerunHydraulicAnalysisRuns a single period hydraulic analysis, retrieving the current simulation clock time trunQualityAnalysisMakes 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 trunsCompleteSimulationRuns 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_epanesaveHydraulicFileSaves the current contents of the binary hydraulics file to a filesaveHydraulicsOutputReportingFileTransfers results of a hydraulic simulation from the binary Hydraulics file to the binary Output file, where results are only reported at uniform reporting intervalssaveInputFileWrites all current network input data to a file using the format of an EPANET input filesetCMDCODESets the CMC codesetControlsSets the parameters of a simple control statementsetCurveSets x, y values for a specific curvesetCurveCommentSets the comment string of a curvesetCurveNameIDSets the name ID of a curve given it's index and the new IDsetCurveValueSets x, y point for a specific point number and curvesetDemandModelSets the type of demand model to use and its parameterssetFlowUnitsAFDSets 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)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 coefficientsetLinkCommentSets the comment string assigned to the link objectsetLinkDiameterSets the values of diameterssetLinkInitialSettingSets the values of initial settings, roughness for pipes or initial speed for pumps or initial setting for valvessetLinkInitialStatusSets the values of initial statussetLinkLengthSets the values of lengthssetLinkMinorLossCoeffSets the values of minor loss coefficientsetLinkNameIDSets the ID name for linkssetLinkNodesIndexSets the indexes of a link's start- and end-nodessetLinkPipeDataSets a group of properties for a pipesetLinkPumpECostSets the pump average energy pricesetLinkPumpECurveSets the pump efficiency vsetLinkPumpEPatSets the pump energy price time pattern indexsetLinkPumpHCurveSets the pump head vsetLinkPumpHeadCurveIndexSets the curves index for pumps indexsetLinkPumpPatternIndexSets the pump speed time pattern indexsetLinkPumpPowerSets the power for pumpssetLinkRoughnessCoeffSets the values of roughness coefficientsetLinkSettingsSets the values of current settings, roughness for pipes or initial speed for pumps or initial setting for valvessetLinkStatusSets the values of current status for linkssetLinkTypePipeSets the link type pipe for a specified linksetLinkTypePipeCVSets the link type cvpipe(pipe with check valve) for a specified linksetLinkTypePumpSets the link type pump for a specified linksetLinkTypeValveFCVSets the link type valve FCV(flow control valve) for a specified linksetLinkTypeValveGPVSets the link type valve GPV(general purpose valve) for a specified linksetLinkTypeValvePBVSets the link type valve PBV(pressure breaker valve) for a specified linksetLinkTypeValvePRVSets the link type valve PRV(pressure reducing valve) for a specified linksetLinkTypeValvePSVSets the link type valve PSV(pressure sustaining valve) for a specified linksetLinkTypeValveTCVSets the link type valve TCV(throttle control valve) for a specified linksetLinkVerticesAssigns a set of internal vertex points to a linksetLinkWallReactionCoeffSets the value of wall chemical reaction coefficientsetNodeBaseDemandsSets the values of demand for nodessetNodeCommentSets the comment string assigned to the node objectsetNodeCoordinatesSets node coordinatessetNodeDemandPatternIndexSets the values of demand time pattern indicessetNodeElevationsSets the values of elevation for nodessetNodeEmitterCoeffSets the values of emitter coefficient for nodessetNodeInitialQualitySets the values of initial quality for nodessetNodeJunctionDataSets a group of properties for a junction nodesetNodeJunctionDemandNameAssigns a name to a node's demand categorysetNodeNameIDSets the ID name for nodessetNodeSourcePatternIndexSets the values of quality source pattern indexsetNodeSourceQualitySets the values of quality source strengthsetNodeSourceTypeSets the values of quality source typesetNodeTankBulkReactionCoeffSets the tank bulk reaction coefficientsetNodeTankCanOverFlowSets the tank can-overflow (= 1) or not (= 0)setNodeTankDataSets a group of properties for a tanksetNodeTankDiameterSets the diameter value for tankssetNodeTankInitialLevelSets the values of initial level for tankssetNodeTankMaximumWaterLevelSets the maximum water level value for tankssetNodeTankMinimumWaterLevelSets the minimum water level value for tankssetNodeTankMinimumWaterVolumeSets the minimum water volume value for tankssetNodeTankMixingFractionSets the tank mixing fraction of total volume occupied by the inlet/outlet zone in a 2-compartment tanksetNodeTankMixingModelTypeSets the mixing model type value for tankssetNodeTypeJunctionTransforms a node to JUNCTION The new node keeps the id,coordinates and elevation of the deleted onsetNodeTypeReservoirTransforms a node to RESERVOIR The new node keeps the id,coordinates and elevation of the deleted onsetNodeTypeTankTransforms a node to TANK The new node keeps the id,coordinates and elevation of the deleted onsetNodesConnectingLinksIDSets the IDs of a link's start- and end-nodessetOptionsAccuracyValueSets the total normalized flow change for hydraulic convergencesetOptionsCheckFrequencySets the frequency of hydraulic status checkssetOptionsDampLimitSets the accuracy level where solution damping beginssetOptionsDemandChargeSets the energy charge per maximum KW usagesetOptionsEmitterExponentSets the power exponent for the emmitterssetOptionsExtraTrialsSets the extra trials allowed if hydraulics don't convergesetOptionsFlowChangeSets the maximum flow change for hydraulic convergencesetOptionsGlobalEfficSets the global efficiency for pumps(percent)setOptionsGlobalPatternSets the global energy price patternsetOptionsGlobalPriceSets the global average energy price per kW-HoursetOptionsHeadErrorSets the maximum head loss error for hydraulic convergencesetOptionsHeadLossFormulaSets the headloss formulasetOptionsLimitingConcentrationSets the limiting concentration for growth reactionssetOptionsMaxTrialsSets the maximum hydraulic trials allowed for hydraulic convergencesetOptionsMaximumCheckSets the maximum trials for status checkingsetOptionsPatternDemandMultiplierSets the global pattern demand multipliersetOptionsPipeBulkReactionOrderSets the bulk water reaction order for pipessetOptionsPipeWallReactionOrderSets the wall reaction order for pipes (either 0 or 1)setOptionsQualityToleranceSets the water quality analysis tolerancesetOptionsSpecificDiffusivitySets the specific diffusivity (relative to chlorine at 20 deg C)setOptionsSpecificGravitySets the specific gravitysetOptionsSpecificViscositySets the specific viscositysetOptionsTankBulkReactionOrderSets the bulk water reaction order for tankssetPatternSets all of the multiplier factors for a specific time patternsetPatternCommentSets the comment string assigned to the pattern objectsetPatternMatrixSets all of the multiplier factors for all time patternssetPatternNameIDSets the name ID of a time pattern given it's index and the new IDsetPatternValueSets the multiplier factor for a specific period within a time patternsetQualityTypeSets the type of water quality analysis called forsetReportIssues a report formatting commandsetReportFormatResetResets a project's report options to their default valuessetReportStatusSets the level of hydraulic status reportingsetRuleElseActionSets rule - based control else actionssetRulePremiseSets the premise of a rule - based controlsetRulePremiseObejctNameIDSets the ID of an object in a premise of a rule-based controlsetRulePremiseStatusSets the status being compared to in a premise of a rule-based controlsetRulePremiseValueSets the value being compared to in a premise of a rule-based controlsetRulePrioritySets rule - based control prioritysetRuleThenActionSets rule - based control then actionssetRulesSets a rule - based controlsetTimeHydraulicStepSets the hydraulic time stepsetTimePatternStartSets the time when time patterns beginsetTimePatternStepSets the time pattern stepsetTimeQualityStepSets the quality time stepsetTimeReportingStartSets the time when reporting startssetTimeReportingStepSets the reporting time stepsetTimeRuleControlStepSets the rule-based control evaluation time stepsetTimeSimulationDurationSets the simulation duration (in seconds)setTimeStatisticsTypeSets the statistic typesetTitleSets the title lines of the projectsolveCompleteHydraulicsRuns a complete hydraulic simulation with results for all time periods written to the binary Hydraulics filesolveCompleteQualityRuns a complete water quality simulation with results at uniform reporting intervals written to EPANET's binary Output filesplitPipeSplits a pipe, creating two new pipes and adds a junction/node in betweenstepQualityAnalysisTimeLeftAdvances the water quality simulation one water quality time stepunloadunload library and close the EPANET Toolkit systemuseHydraulicFileUses the contents of the specified file as the current binary hydraulics filewriteLineInReportFileWrites a line of text to the EPANET report filewriteReportWrites a formatted text report on simulation results to the Report fileList of EPANET 2.2 FunctionsFunctionDescriptionENepanetRuns a complete EPANET simulationENaddcontrolAdds a new simple control to a projectENaddcurveAdds a new data curve to a projectENadddemandAppends a new demand to a junction node demands listENaddlinkAdds a new link to a projectENaddnodeAdds a new node to a projectENaddpatternAdds a new time pattern to a projectENaddruleAdds a new rule-based control to a projectENclearreportClears the contents of a project's report fileENcloseCloses a project and frees all of its memoryENcloseHCloses the hydraulic solver freeing all of its allocated memoryENcloseQCloses the water quality solver, freeing all of its allocated memoryENcopyreportCopies the current contents of a project's report file to another fileENcreateprojectCopies the current contents of a project's report file to another fileENdeletecontrolDeletes an existing simple controlENdeletecurveDeletes a data curve from a projectENdeletedemandDeletes a demand from a junction nodeENdeletelinkDeletes a link from the projectENdeletenodeDeletes a node from a projectENdeletepatternDeletes a time pattern from a projectENdeleteprojectDeletes an EPANET projectENdeleteruleDeletes an existing rule-based controlENgetaveragepatternvalueRetrieves the average of all pattern factors in a time patternENgetbasedemandGets the base demand for one of a node's demand categoriesENgetcommentSets a comment to a specific indexENgetcontrolRetrieves the comment of a specific index of a type objectENgetcoordGets the (x,y) coordinates of a nodeENgetcountRetrieves the number of objects of a given type in a projectENgetcurveRetrieves all of a curve's dataENgetcurveidRetrieves the ID name of a curve given its indexENgetcurveindexRetrieves the index of a curve given its ID nameENgetcurvelenRetrieves the number of points in a curveENgetcurvetypeRetrieves a curve's typeENgetcurvevalueRetrieves the value of a single data point for a curveENgetdemandindexRetrieves the index of a node's named demand categoryENgetdemandmodelRetrieves the type of demand model in use and its parametersENgetdemandnameRetrieves the name of a node's demand categoryENgetdemandpatternRetrieves the index of a time pattern assigned to one of a node's demand categoriesENgetelseactionGets the properties of an ELSE action in a rule-based controlENgeterrorReturns the text of an error message generated by an error code, as warningENgetflowunitsRetrieves a project's flow unitsENgetheadcurveindexRetrieves the curve assigned to a pump's head curveENgetlinkidGets the ID name of a link given its indexENgetlinkindexGets the index of a link given its ID nameENgetlinknodesGets the indexes of a link's start- and end-nodesENgetlinktypeRetrieves a link's typeENgetlinkvalueRetrieves a property value for a linkENgetnodeidGets the ID name of a node given its indexENgetnodeindexGets the index of a node given its ID nameENgetnodetypeRetrieves a node's type given its indexENgetnodevalueRetrieves a property value for a nodeENgetnumdemandsRetrieves the number of demand categories for a junction nodeENgetoptionRetrieves the value of an analysis optionENgetpatternidRetrieves the ID name of a time pattern given its indexENgetpatternindexRetrieves the index of a time pattern given its ID nameENgetpatternlenRetrieves the number of time periods in a time patternENgetpatternvalueRetrieves a time pattern's factor for a given time periodENgetpremiseGets the properties of a premise in a rule-based controlENgetpumptypeRetrieves the type of head curve used by a pumpENgetqualinfoGets information about the type of water quality analysis requestedENgetqualtypeRetrieves the type of water quality analysis to be runENgetresultindexRetrieves the order in which a node or link appears in an output fileENgetruleRetrieves summary information about a rule-based controlENgetruleIDGets the ID name of a rule-based control given its indexENgetstatisticRetrieves a particular simulation statisticENgetthenactionGets the properties of a THEN action in a rule-based controlENgettimeparamRetrieves the value of a time parameterENgettitleRetrieves the title lines of the projectENgetversionRetrieves the toolkit API version numberENgetvertexRetrieves the coordinate's of a vertex point assigned to a linkENgetvertexcountRetrieves the number of internal vertex points assigned to a linkENinitInitializes an EPANET projectENinitHInitializes a network prior to running a hydraulic analysisENinitQInitializes a network prior to running a water quality analysisENnextHDetermines the length of time until the next hydraulic event occurs in an extended period simulationENnextQAdvances a water quality simulation over the time until the next hydraulic eventENopenOpens an EPANET input file & reads in network dataENopenHOpens a project's hydraulic solverENopenQOpens a project's water quality solverENreportWrites simulation results in a tabular format to a project's report fileENresetreportResets a project's report options to their default valuesENrunHComputes a hydraulic solution for the current point in timeENrunQMakes hydraulic and water quality results at the start of the current time period available to a project's water quality solverENsaveHTransfers a project's hydraulics results from its temporary hydraulics file to its binary output file, where results are only reported at uniform reporting intervalsENsavehydfileSaves a project's temporary hydraulics file to diskENsaveinpfileSaves a project's data to an EPANET-formatted text fileENsetbasedemandSets the base demand for one of a node's demand categoriesENsetcommentSets a comment to a specific indexENsetcontrolSets the properties of an existing simple controlENsetcoordSets the (x,y) coordinates of a nodeENsetcurveAssigns a set of data points to a curveENsetcurveidChanges the ID name of a data curve given its indexENsetcurvevalueSets the value of a single data point for a curveENsetdemandmodelSets the Type of demand model to use and its parametersENsetdemandnameAssigns a name to a node's demand categoryENsetdemandpatternSets the index of a time pattern used for one of a node's demand categoriesENsetelseactionSets the properties of an ELSE action in a rule-based controlENsetflowunitsSets a project's flow unitsENsetheadcurveindexAssigns a curve to a pump's head curveENsetjuncdataSets a group of properties for a junction nodeENsetlinkidChanges the ID name of a linkENsetlinknodesSets the indexes of a link's start- and end-nodesENsetlinktypeChanges a link's typeENsetlinkvalueSets a property value for a linkENsetnodeidChanges the ID name of a nodeENsetnodevalueSets a property value for a nodeENsetoptionSets the value for an anlysis optionENsetpatternSets the pattern factors for a given time patternENsetpatternidChanges the ID name of a time pattern given its indexENsetpatternvalueSets a time pattern's factor for a given time periodENsetpipedataSets a group of properties for a pipe linkENsetpremiseSets the properties of a premise in a rule-based controlENsetpremiseindexSets the index of an object in a premise of a rule-based controlENsetpremisestatusSets the status being compared to in a premise of a rule-based controlENsetpremisevalueSets the value in a premise of a rule-based controlENsetqualtypeSets the type of water quality analysis to runENsetreportProcesses a reporting format commandENsetruleprioritySets the priority of a rule-based controlENsetstatusreportSets the level of hydraulic status reportingENsettankdataSets a group of properties for a tank nodeENsetthenactionSets the properties of a THEN action in a rule-based controlENsettimeparamSets the value of a time parameterENsettitleSets the title lines of the projectENsetverticesAssigns a set of internal vertex points to a linkENsolveHRuns a complete hydraulic simulation with results for all time periods written to a temporary hydraulics fileENsolveQRuns a complete water quality simulation with results at uniform reporting intervals written to the project's binary output fileENstepQAdvances a water quality simulation by a single water quality time stepENusehydfileUses a previously saved binary hydraulics file to supply a project's hydraulicsENwritelineWrites a line of text to a project's report file↑Back to top