See the formulation of the optimization problems in the documentation website.
Usage
optimize_demand(
opt_data,
opt_objective = "grid",
direction = "forward",
time_horizon = NULL,
window_days = 1,
window_start_hour = 0,
flex_window_hours = NULL,
lambda = 0,
mc.cores = 1
)
Arguments
- opt_data
tibble, optimization contextual data. The first column must be named
datetime
(mandatory) containing the date time sequence where the optimization algorithm is applied.The second column must be named
flexible
(mandatory), being the power demand (in kW) vector that will be optimized.The other columns can be (optional):
static
: static power demand (in kW) from other sectors like buildings, offices, etc.import_capacity
: maximum imported power from the grid (in kW), for example the contracted power with the energy company.load_capacity
: maximum power that theflexible
load can consume (in kW).production
: local power generation (in kW). This is used whenopt_objective = "grid"
.price_imported
: price for imported energy (€/kWh). This is used whenopt_objective = "cost"
.price_exported
: price for exported energy (€/kWh). This is used whenopt_objective = "cost"
.price_turn_down
: price for turn-down energy use (€/kWh). This is used whenopt_objective = "cost"
.price_turn_up
: price for turn-up energy use (€/kWh). This is used whenopt_objective = "cost"
.
- opt_objective
character, optimization objective being
"grid"
(default),"cost"
or a value between 0 (cost) and 1 (grid).- direction
character, being
forward
orbackward
. The direction where energy can be shifted- time_horizon
integer, maximum number of positions to shift energy from. If
NULL
, thetime_horizon
will be the number of rows ofop_data
.- window_days
integer, number of days to consider as optimization window.
- window_start_hour
integer, starting hour of the optimization window.
- flex_window_hours
integer, flexibility window length, in hours. This optional feature lets you apply flexibility only during few hours from the
window_start_hour
. It must be lower thanwindow_days*24
hours.- lambda
numeric, penalty on change for the flexible load.
- mc.cores
integer, number of cores to use. Must be at least one, and parallelization requires at least two cores.