lslin {loadshaper}R Documentation

Linear Method for Matching Peak and Load Factor

Description

lslin applies linear method to a reference load shape to match the peak and load factor to target values. See "Details" for the algorithm.

Usage

lslin(x, target_max = 10000, target_lf = 0.7)

Arguments

x

A numeric array, representing reference load shape. All values must be strictly positive containing no NA(s). The length of x must be greater > 167.

target_max

Target peak value of resultant load shape, must be > 0.

target_lf

Target load factor of resultant load shape, must be numeric in between 0 and 1 (exclusive).

Details

The algorithm first evaluates the load factor of the reference load shape x, which is defined by the ratio of average to peak value. If the target load factor is greater than reference level, then all base values are multiplied by a number > 1. If the target load factor is less than reference level, then all base values are multiplied by a number < 1. The multipliers increase/decrease linearly and are applied to the based values after ordered.

If x' is the ordered version of x, then x'_{i} will be multiplied by 1-(i-1)*\beta, where \beta is a constant calculated as:

\beta = \frac{\sum_{i=1}^n x'_{i} - target\ load\ factor } {\sum_{i=1}^n x'_{i}(i-1)}

The load factor of the derived series matches the target. For target < base, \beta is positive and vice-versa.

The algorithm attempts hard to match the load factor of the derived load shape to the base load factor. \beta becomes large in magnitude for large difference of base and target load factor. In case \beta > 1, it is possible to get negative multipliers which force the values to be negative. This particular situation can occur when target load factor is significantly smaller than the base load factor.

If the target load factor is much bigger than the base load factor, one/both of the followings can occur:

The return object contains a data frame df, having the following columns:

Value

A list of class "lslin", having following elements:

See Also

lslog, print.lslin, summary.lslin, plot.lslin, lscore

Examples

loads <- ercot[ercot$Year == 2019, ]$COAST
plot(loads, type = "l")
linear_loadshape <- lslin(loads, target_lf = 0.50)
summary(linear_loadshape)
#-------------------------------------
loads2 <- ercot[ercot$Year == 2020, ]$ERCOT
plot(loads2, type = "l")
linear_loadshape2 <- lslin(loads2, target_lf = 0.7)
summary(linear_loadshape2)#'
#-------------------------------------
loads3 <- ercot[ercot$Year == 2020, ]$ERCOT
plot(loads3, type = "l")
linear_loadshape3 <- lslin(loads3, target_lf = 0.95)
summary(linear_loadshape3)
#-------------------------------------
loads4 <- ercot[ercot$Year == 2020, ]$SCENT
plot(loads3, type = "l")
linear_loadshape4 <- lslin(loads4, target_lf = 0.3)
summary(linear_loadshape4)




[Package loadshaper version 1.1.1 Index]