|
| | GurobiLPController (unsigned long cuID, unsigned int time_horizon, unsigned long n_cars) |
| |
| bool | updateController (const unsigned long ts, double max_p_bs_kW, double max_e_bs_kWh, double max_p_cs_kW, double current_bs_charge_kWh, const std::vector< float > &future_resid_demand_kW, const std::vector< double > &future_pv_generation_kW, const std::vector< double > &future_hp_shiftable_maxP, const std::vector< double > &future_hp_shiftable_minP, const std::vector< double > &future_hp_shiftable_maxE, const std::vector< double > &future_hp_shiftable_minE, const std::vector< const std::vector< double > * > *future_ev_shiftable_maxE, const std::vector< const std::vector< double > * > *future_ev_shiftable_minE, const std::vector< const std::vector< double > * > *future_ev_maxP, const bool optimize_PV_size, const bool optimize_BS_size, const std::list< std::vector< double > > *total_PV_generation_per_section_kW, const std::list< double > *max_PV_power_per_section_kWp) |
| | Executes the controller with all (future) states in the current horizon and stores the results the member variables BaseOptimizedController::bs_power, BaseOptimizedController::hp_power and BaseOptimizedController::ev_power.
|
| |
| virtual bool | updateController (const unsigned long ts, double max_p_bs_kW, double max_e_bs_kWh, double max_p_cs_kW, double current_bs_charge_kWh, const std::vector< float > &future_resid_demand_kW, const std::vector< double > &future_pv_generation_kW, const std::vector< double > &future_hp_shiftable_maxP, const std::vector< double > &future_hp_shiftable_minP, const std::vector< double > &future_hp_shiftable_maxE, const std::vector< double > &future_hp_shiftable_minE, const std::vector< const std::vector< double > * > *future_ev_shiftable_maxE, const std::vector< const std::vector< double > * > *future_ev_shiftable_minE, const std::vector< const std::vector< double > * > *future_ev_maxP, const bool optimize_PV_size, const bool optimize_BS_size, const std::list< std::vector< double > > *total_PV_generation_per_section_kW, const std::list< double > *max_PV_power_per_section_kWp)=0 |
| | Executes the controller with all (future) states in the current horizon and stores the results the member variables BaseOptimizedController::bs_power, BaseOptimizedController::hp_power and BaseOptimizedController::ev_power.
|
| |
| | BaseOptimizedController (unsigned long cuID, unsigned int time_horizon, unsigned long n_cars) |
| |
| virtual | ~BaseOptimizedController ()=default |
| |
| const std::vector< double > & | get_future_hp_power_kW () |
| |
| const std::vector< double > & | get_future_bs_power_kW () |
| |
| const std::vector< std::vector< double > > & | get_future_ev_power_kW () |
| |
| const std::list< double > & | get_optimal_PV_size_per_section_kW () |
| |
| double | get_optimal_BS_size_kWh () |
| |
| void | reset (unsigned int new_horizon) |
| |
| void | shiftVectorsByOnePlace () |
| |
|
| const unsigned long | controlUnitID |
| | ID of the connected control unit.
|
| |
| const unsigned long | n_cars |
| | Number of EVs with the given control unit as home place.
|
| |
| unsigned long | time_horizon |
| |
| std::vector< double > | bs_power |
| | The battery storage power for every time step in the time horizon.
|
| |
| std::vector< double > | hp_power |
| | The heat pump power for every time step in the time horizon.
|
| |
| std::vector< std::vector< double > > | ev_power |
| | The charging power per EV (index 0) for every time step (index 1) in the time horizon.
|
| |
| std::list< double > | optimal_pv_size_per_section_kW |
| | If the PV size should be optimized, this value contains the optimal PV size per section in kW.
|
| |
| double | optimal_bs_size_kWh |
| | If the BS size should be optimized, this value contains the optimal BS size in kWh.
|
| |
optimization_unit_gurobi.hpp
This file contains all functions required to call gurobi as optimizer inside the control units.
| bool GurobiLPController::updateController |
( |
const unsigned long |
ts, |
|
|
double |
max_p_bs_kW, |
|
|
double |
max_e_bs_kWh, |
|
|
double |
max_p_cs_kW, |
|
|
double |
current_bs_charge_kWh, |
|
|
const std::vector< float > & |
future_resid_demand_kW, |
|
|
const std::vector< double > & |
future_pv_generation_kW, |
|
|
const std::vector< double > & |
future_hp_shiftable_maxP, |
|
|
const std::vector< double > & |
future_hp_shiftable_minP, |
|
|
const std::vector< double > & |
future_hp_shiftable_maxE, |
|
|
const std::vector< double > & |
future_hp_shiftable_minE, |
|
|
const std::vector< const std::vector< double > * > * |
future_ev_shiftable_maxE, |
|
|
const std::vector< const std::vector< double > * > * |
future_ev_shiftable_minE, |
|
|
const std::vector< const std::vector< double > * > * |
future_ev_maxP, |
|
|
const bool |
optimize_PV_size, |
|
|
const bool |
optimize_BS_size, |
|
|
const std::list< std::vector< double > > * |
total_PV_generation_per_section_kW, |
|
|
const std::list< double > * |
max_PV_power_per_section_kWp |
|
) |
| |
|
virtual |
Executes the controller with all (future) states in the current horizon and stores the results the member variables BaseOptimizedController::bs_power, BaseOptimizedController::hp_power and BaseOptimizedController::ev_power.
If parameter optimize_PV_size is set to true, the value of the parameter future_pv_generation_kW is ignored, and parameters total_PV_generation_per_section_kW and must be a valid reference. Otherwise, the last two parameters are ignored. If parameter optimize_BS_size is set to true, the value of max_e_bs_kWh and max_p_cs_kW are ignored. They are a result of the optimization. Moreover, in this case, current_bs_charge_kWh must be set to 0.0.
- Parameters
-
| ts | The current time step ID |
| max_p_bs_kW | Maximum battery power in kW |
| max_e_bs_kWh | Battery capacity in kWh |
| max_p_cs_kW | Maximum charging station power in kW |
| current_bs_charge_kWh | Current charge of the battery in kWh |
| future_resid_demand_kW | Vector with future residential energy demand in kW per time step in the horizon |
| future_pv_generation_kW | Vector with future PV generation power in kW per time step in the horizon |
| future_hp_shiftable_maxP | Vector with maximum power of the heat pump per time step |
| future_hp_shiftable_minP | Vector with minimum power of the heat pump per time step |
| future_hp_shiftable_maxE | Vector with maximum accumulated energy consumption of the heat pump in kWh until the end of each time step in the horizon |
| future_hp_shiftable_minE | Vector with minimum accumulated energy consumption of the heat pump in kWh until the end of each time step in the horizon |
| future_ev_shiftable_maxE | Vector with maximum accumulated energy consumption of the charging station in kWh for every step over the considered horizon (first index) and every EV (second index) |
| future_ev_shiftable_minE | Vector with minimum accumulated energy consumption of the charging station in kWh for every step over the considered horizon (first index) and every EV (second index) |
| future_ev_maxP | Vector with maximum charging power per EV in kW for every step over the considered horizon (first index) and every EV (second index) |
| optimize_PV_size | Flag indicating if the PV size (per section) should be part of the optimization |
| optimize_BS_size | Flag indicating if the BS size should be part of the optimization |
| total_PV_generation_per_section_kW | Total PV generation over the simulation horizon. Only required, if PV sizing (flag optimize_PV_size) is also a result of the optimization - otherwise, this parameter can be NULL |
| max_PV_power_per_section_kWp | The maximum installable power per roof section in kWp. Only required, if PV sizing (flag optimize_PV_size) is also a result of the optimization - otherwise, this parameter can be NULL |
- Returns
- : Returns a boolean value, with true indicating if the optimization succeded, or false indicating an error (e.g., an unfeasable problem)
Implements BaseOptimizedController.
| virtual bool BaseOptimizedController::updateController |
( |
const unsigned long |
ts, |
|
|
double |
max_p_bs_kW, |
|
|
double |
max_e_bs_kWh, |
|
|
double |
max_p_cs_kW, |
|
|
double |
current_bs_charge_kWh, |
|
|
const std::vector< float > & |
future_resid_demand_kW, |
|
|
const std::vector< double > & |
future_pv_generation_kW, |
|
|
const std::vector< double > & |
future_hp_shiftable_maxP, |
|
|
const std::vector< double > & |
future_hp_shiftable_minP, |
|
|
const std::vector< double > & |
future_hp_shiftable_maxE, |
|
|
const std::vector< double > & |
future_hp_shiftable_minE, |
|
|
const std::vector< const std::vector< double > * > * |
future_ev_shiftable_maxE, |
|
|
const std::vector< const std::vector< double > * > * |
future_ev_shiftable_minE, |
|
|
const std::vector< const std::vector< double > * > * |
future_ev_maxP, |
|
|
const bool |
optimize_PV_size, |
|
|
const bool |
optimize_BS_size, |
|
|
const std::list< std::vector< double > > * |
total_PV_generation_per_section_kW, |
|
|
const std::list< double > * |
max_PV_power_per_section_kWp |
|
) |
| |
|
virtual |
Executes the controller with all (future) states in the current horizon and stores the results the member variables BaseOptimizedController::bs_power, BaseOptimizedController::hp_power and BaseOptimizedController::ev_power.
If parameter optimize_PV_size is set to true, the value of the parameter future_pv_generation_kW is ignored, and parameters total_PV_generation_per_section_kW and must be a valid reference. Otherwise, the last two parameters are ignored. If parameter optimize_BS_size is set to true, the value of max_e_bs_kWh and max_p_cs_kW are ignored. They are a result of the optimization. Moreover, in this case, current_bs_charge_kWh must be set to 0.0.
- Parameters
-
| ts | The current time step ID |
| max_p_bs_kW | Maximum battery power in kW |
| max_e_bs_kWh | Battery capacity in kWh |
| max_p_cs_kW | Maximum charging station power in kW |
| current_bs_charge_kWh | Current charge of the battery in kWh |
| future_resid_demand_kW | Vector with future residential energy demand in kW per time step in the horizon |
| future_pv_generation_kW | Vector with future PV generation power in kW per time step in the horizon |
| future_hp_shiftable_maxP | Vector with maximum power of the heat pump per time step |
| future_hp_shiftable_minP | Vector with minimum power of the heat pump per time step |
| future_hp_shiftable_maxE | Vector with maximum accumulated energy consumption of the heat pump in kWh until the end of each time step in the horizon |
| future_hp_shiftable_minE | Vector with minimum accumulated energy consumption of the heat pump in kWh until the end of each time step in the horizon |
| future_ev_shiftable_maxE | Vector with maximum accumulated energy consumption of the charging station in kWh for every step over the considered horizon (first index) and every EV (second index) |
| future_ev_shiftable_minE | Vector with minimum accumulated energy consumption of the charging station in kWh for every step over the considered horizon (first index) and every EV (second index) |
| future_ev_maxP | Vector with maximum charging power per EV in kW for every step over the considered horizon (first index) and every EV (second index) |
| optimize_PV_size | Flag indicating if the PV size (per section) should be part of the optimization |
| optimize_BS_size | Flag indicating if the BS size should be part of the optimization |
| total_PV_generation_per_section_kW | Total PV generation over the simulation horizon. Only required, if PV sizing (flag optimize_PV_size) is also a result of the optimization - otherwise, this parameter can be NULL |
| max_PV_power_per_section_kWp | The maximum installable power per roof section in kWp. Only required, if PV sizing (flag optimize_PV_size) is also a result of the optimization - otherwise, this parameter can be NULL |
- Returns
- : Returns a boolean value, with true indicating if the optimization succeded, or false indicating an error (e.g., an unfeasable problem)
Implements BaseOptimizedController.