Function optimize_demand
and
add_battery_optimization
makes use of Quadratic programming
in order to obtain the optimal power load given certain conditions. The
Quadratic programming problem can be formulated according to multiple
objectives. Currently, flextools
package allows to optimize
a time-series power load considering two different goals:
In this article, we’ll cover the optimization problem for the combination of both objectives, net power minimization and energy_cost minimization, for both the flexible demand (e.g. heatpumps, electric vehicles, etc.) and the battery.
Below, the problem formulations are described, similarly to the
corresponding articles for net power and costs minimization, but with an
extra parameter w
. The term w
is the weight for the net power minimization over the cost optimization,
so:
- If , the cost is minimized
- If , the net power is minimized
- If , both net power and cost are minimized
Demand optimization
To minimize the energy cost using the flexibility from a power demand profile, the objective function of the optimization problem has been raised in the following way:
Note that, in contrast to the Net power optimization problem, here we add the average imported energy price in the equation to convert the power units to cost units and balance the value ranges of the multiple terms in the equation.
The objective function and constraints of this optimization problem are represented below, where:
- : Number of time intervals within the optimization window
- : Local power generation time-series vector
- : Non-flexible load time-series vector
- : Flexible load time-series vector (if not optimized)
- : Optimal flexible load time-series vector
- : imported energy
- : exported energy
- : imported energy price
- : exported energy price
- : balancing price for turn-up power
- : balancing price for turn-down power
- : penalty on change for the flexible load
Moreover, this optimization problem has the constraints described in Energy cost optimization article (demand section).
Battery optimization
To minimize the energy cost using the flexibility from a battery, the objective function of the optimization problem has been raised in the following way:
Where:
- : Number of time intervals within the optimization window
- : Local power generation time-series vector
- : Power load time-series vector
- : Optimal battery power time-series vector. Positive charging, negative discharging.
- : imported energy
- : exported energy
- : imported energy price
- : exported energy price
- : balancing price for turn-up power
- : balancing price for turn-down power
- : penalty on change for the flexible load
Moreover, this optimization problem has the constraints described in Energy cost optimization article (battery section).