read.rpt: Read .rpt file

Description Usage Arguments Details Value References Examples

View source: R/epanet.rpt-s3.r

Description

reads an Epanet .rpt file into R

Usage

1

Arguments

file

the name of the file to read

Details

add lines "Page 0", "Links All" and "Nodes All" to the [REPORT] section of the .inp file to output info to read in with this function

In contrast to the treatment of .inp files, data from .rpt files is stored using a slightly different structure than the .rpt file. The function returns an object (list) with a data.frame for node results and data.frame for link results and a data.frame for energy usage. The node and link results data frames contain results from all the time periods to facilitate time series plots.

Value

Returns an epanet.rpt S3 object with two data.frame elements.

nodeResults

data.frame

linkResults

data.frame

energyUsage

data.frame

References

Rossman, L. A. (2000). Epanet 2 users manual. US EPA, Cincinnati, Ohio.

http://nepis.epa.gov/Adobe/PDF/P1007WWU.pdf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# path to Net1.rpt example file included with this package
rpt <- file.path( find.package("epanetReader"), "extdata","Net1.rpt") 
n1r <- read.rpt(rpt)
summary(n1r)
names(n1r)

#Results for a chosen time period can be retrieved using the subset function.
subset(n1r$nodeResults, Timestamp == "0:00:00")

# time series plot for a nodal value
plot( Chlorine ~ timeInSeconds,  
      data = subset(n1r$nodeResults, ID == "22"))    

# Plotting the epanet.rpt object itself gives a map.
# Note that the object created from the .inp file is required.
inp <- file.path( find.package("epanetReader"), "extdata","Net1.inp") 
n1 <- read.inp(inp)
plot( n1r, n1)

# Energy Usage table
print(n1r$energyUsage)

Example output

Contains node results for  25 time steps 

Summary of Junction Results: 
     Demand         Pressure        Chlorine     
 Min.   :  0.0   Min.   :106.8   Min.   :0.1500  
 1st Qu.: 80.0   1st Qu.:116.1   1st Qu.:0.3500  
 Median :120.0   Median :119.8   Median :0.5100  
 Mean   :122.2   Mean   :119.6   Mean   :0.5434  
 3rd Qu.:160.0   3rd Qu.:123.0   3rd Qu.:0.7400  
 Max.   :320.0   Max.   :133.9   Max.   :1.0000  

Summary of Tank Results:
     Demand             Pressure        Chlorine    
 Min.   :-1100.000   Min.   :48.22   Min.   :0.590  
 1st Qu.: -660.000   1st Qu.:52.00   1st Qu.:0.660  
 Median :  258.000   Median :55.52   Median :0.750  
 Mean   :   -5.741   Mean   :54.86   Mean   :0.764  
 3rd Qu.:  505.380   3rd Qu.:57.54   3rd Qu.:0.850  
 Max.   : 1029.420   Max.   :60.04   Max.   :1.000  

Contains link results for  25 time steps 

Summary of Pipe Results:
      Flow             Velocity         Headloss    
 Min.   :-1029.42   Min.   :0.0000   Min.   :0.000  
 1st Qu.:   41.37   1st Qu.:0.3475   1st Qu.:0.110  
 Median :  113.08   Median :0.5700   Median :0.300  
 Mean   :  245.35   Mean   :0.8070   Mean   :0.644  
 3rd Qu.:  237.23   3rd Qu.:1.0075   3rd Qu.:0.755  
 Max.   : 1909.42   Max.   :2.7300   Max.   :3.210  

Energy Usage:
  Pump usageFactor avgEfficiency kWh_per_Mgal avg_kW peak_kW dailyCost
1    9       57.71            75       880.42  96.25   96.71         0

[1] "nodeResults" "linkResults" "energyUsage"
   ID   Demand    Head Pressure Chlorine      note Timestamp timeInSeconds
1  10     0.00 1004.35   127.54      0.5             0:00:00             0
2  11   150.00  985.23   119.26      0.5             0:00:00             0
3  12   150.00  970.07   117.02      0.5             0:00:00             0
4  13   100.00  968.87   118.67      0.5             0:00:00             0
5  21   150.00  971.55   117.66      0.5             0:00:00             0
6  22   200.00  969.08   118.76      0.5             0:00:00             0
7  23   150.00  968.65   120.74      0.5             0:00:00             0
8  31   100.00  967.39   115.86      0.5             0:00:00             0
9  32   100.00  965.69   110.79      0.5             0:00:00             0
10  9 -1866.18  800.00     0.00      1.0 Reservoir   0:00:00             0
11  2   766.18  970.00    52.00      1.0      Tank   0:00:00             0
    nodeType
1   Junction
2   Junction
3   Junction
4   Junction
5   Junction
6   Junction
7   Junction
8   Junction
9   Junction
10 Reservoir
11      Tank
Warning messages:
1: In PATTERNS(allLines) : patterns have integer IDs, see ?epanet.inp
2: In CURVES(allLines) : curves have integer IDs, see ?epanet.inp
  Pump usageFactor avgEfficiency kWh_per_Mgal avg_kW peak_kW dailyCost
1    9       57.71            75       880.42  96.25   96.71         0

epanetReader documentation built on May 2, 2019, 2:08 p.m.