Learn R Programming

epanet2toolkit (version 1.0.8)

ENsetnodevalue: Set the parameter value for a node.

Description

ENsetnodevalue sets parameter value for one node.

Usage

ENsetnodevalue(index, paramcode = NULL, value = NULL)

Value

returns NULL invisibly on success or raises an error or warning.

Arguments

index

An integer vector, the node index.

paramcode

An integer vector, the parameter code (see Details below).

value

A numeric vector, the new value of the parameter.

Details

Nodes are indexed starting from 1 in the order in which they were entered into the [NODES] section of the EPANET input file.

Node parameter codes consist of the following constants:

EN_ELEVATION0Elevation
EN_BASEDEMAND1Base demand
EN_PATTERN2Demand pattern index
EN_EMITTER3Emitter coeff.
EN_INITQUAL4Initial quality
EN_SOURCEQUAL5Source quality
EN_SOURCEPAT6Source pattern index
EN_SOURCETYPE7Source type (see note below)
EN_TANKLEVEL8Initial water level in tank

Source types are identified with the following constants:

EN_CONCEN0
EN_MASS1
EN_SETPOINT2
EN_FLOWPACED3

See [SOURCES] for a description of these source types.

Values are supplied in units which depend on the units used for flow rate in the EPANET input file (see Units of Measurement).

Examples

Run this code
# path to Net1.inp example file included with this package
inp <- file.path( find.package("epanet2toolkit"), "extdata","Net1.inp")  
ENopen( inp, "Net1.rpt")
ENgetnodevalue(3, "EN_ELEVATION")
ENsetnodevalue(3, "EN_ELEVATION", 777)
ENgetnodevalue(3, "EN_ELEVATION")
ENclose()

Run the code above in your browser using DataLab