fill_time.wateres: Reservoir filling time

View source: R/wateres.R

fill_timeR Documentation

Reservoir filling time

Description

Experimental calculation of filling time of the reservoir. A sample of time series is calculated based on the given beginning time steps (alternatively, these time steps are sampled randomly).

Usage

fill_time(reser, yield, begins, samples)

## S3 method for class 'wateres'
fill_time(reser, yield, begins = NULL, samples = 10)

Arguments

reser

A wateres object.

yield

A required yield.

begins

A vector of time steps that represent begins of time series to be simulated.

samples

A number of time steps of begins to be randomly sampled.

Details

If provided, the begins argument is used to calculate the time series. Alternatively, the samples argument is applied.

Value

A data table of filling times:

begin

time steps when simulation of time series begins

months

number of months during that the reservoir changes from empty to full, or NA if the reservoir is not full and the end of the time series is reached

Examples

reser = data.frame(
    Q = c(0.078, 0.065, 0.168, 0.711, 0.154, 0.107, 0.068, 0.057, 0.07, 0.485, 0.252, 0.236,
          0.498, 0.248, 0.547, 0.197, 0.283, 0.191, 0.104, 0.067, 0.046, 0.161, 0.16, 0.094),
    DTM = seq(as.Date("2000-01-01"), by = "months", length.out = 24))
reser = as.wateres(reser, storage = 4e5, area = 754e3)
fill = fill_time(reser, yield = 0.01)

tgmwri/wateres documentation built on Feb. 13, 2024, 10:25 p.m.