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 |
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:
As a linearly increasing function is multiplied by a decreasing function (
x'
), it is possible that the maximum of the product can exceed the maximum value of the base (x'
), resulting in a different load factor.As a linearly increasing function is multiplied by a decreasing function (
x'
), it is possible that the product is not strictly decreasing. The product array is re-ordered to produce the final values.
The return object contains a data frame df
, having the
following columns:
x_index
: An index given to the original load shapex
, starting from 1 tolength(x)
.x
: The original arrayx
, unaltered.x_rank
: The rank of the data points of the given arrayx
, from 1 for the peak tolength(x)
for the lowest value.x_ordered
: Sortedx
(largest to smallest).x_pu
: Per unitx
, derived by divingx
bymax(x)
.x_ordered_pu
: Per unitx
, sorted from largest to smallest.mult
: Derived multipliers, would be applied to sorted per unitx
.y_ordered_pu
: Product of per unit sortedx
andmult
.y_ordered_pu2
:y_ordered_pu
, sorted again, in casey_ordered_pu
does not become decreasing.y_pu
: Resultant load shape in per unit. This is derived by re-orderingy_ordered_pu2
with respect to their original rank.y
: Resultant load shape. This is derived by multiplyingy_pu
bytaget_max
/base_max
Value
A list of class "lslin"
, having following elements:
df
: A data frame. See "Details".beta
: Slope of the linearly increasing/decreasing multipliers. See "Details".max_mult
: Maximum of the multipliers.min_mult
: Minimum of the multipliers.base_load_factor
: Load factor of the reference load shapex
.target_load_factor
: Target load factor.derived_load_factor
: Load factor of the derived load shape (object$df$y
).base_max
: Peak value of the base load shape,x
target_max
: Target peak value of the new load shape.derived_max
: Peak value of the derived load shape (object$df$y
)base_min
: Minimum value of the base load shape,x
derived_min
: Minimum value of the derived load shape (object$df$y
)dec_flag
: A logical flag stating whether the multipliers resulted in strictly decreasing values.TRUE
indicates the order was not preserved. Only applicable fortarget_max
>base_max
. See "Details".lf_flag
: A logical flag indicating if the load factor of the derived shape differs from the target by more than 1%.min_pu_flag
: A logical flag indicating existence of negative values in the derived load shape.TRUE
indicates the existence of negative values. Only applicable fortarget_max
<base_max
. See "Details".
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)