For computing the critical period of a reservoir from its storage time series. The critical period is defined as the length of time for the reservoir to go from full to empty (without spilling in between). Input storage should fill and empty at least once for correct calculation of critical period.
vector or time series object giving the reservoir storage behaviour. The sequence should contain at least one zero values for the critical period to be estimated.
character string giving the critical period to report... "shortest" (default) returns shortest of all critical periods (i.e., the most severe drought); "average" returns the mean of all critical periods; "longest" returns the longest critical drawdown period; "all" returns all critical drawdown periods in the time series.
Returns the critical drawdown period of the reservoir, giving the shortest time from full to empty by default.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
storage_behavior <- simRes(Q=resX$Q_Mm3, target = 0.9*mean(resX$Q_Mm3), capacity=1000, plot=FALSE)$storage plot(storage_behavior) ## longest critical period critPeriod(storage_behavior) # or critPeriod(x, "longest") ## shortest critical period critPeriod(storage_behavior, "shortest") ## average critical period critPeriod(storage_behavior, "average") ## all critical periods critPeriod(storage_behavior, "all")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.