ENnextH | R Documentation |
ENnextH
determines the length of time until the next
hydraulic event occurs in an extended period simulation.
ENnextH()
This function is used in conjunction with ENrunH
to
perform an extended period hydraulic analysis (see example below).
The return value is automatically computed as the smaller of:
the time interval until the next hydraulic time step begins
the time interval until the next reporting time step begins
the time interval until the next change in demands occurs
the time interval until a tank becomes full or empty
the time interval until a control or rule fires
An integer, the time (in seconds) until next hydraulic event occurs or 0 if at the end of the simulation period.
ENopenH
, ENinitH
, ENrunH
, ENcloseH
, ENsettimeparam
# path to Net1.inp example file included with this package
inp <- file.path( find.package("epanet2toolkit"), "extdata","Net1.inp")
ENopen( inp, "Net1.rpt")
# store simulation times
t = NULL
ENopenH()
ENinitH(11)
repeat {
t <- c(t, ENrunH())
tstep <- ENnextH()
if (tstep == 0) {
break
}
}
ENcloseH()
ENclose()
# clean-up the created files
file.remove("Net1.rpt")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.