Simple Battery Dispatch Heuristic#
- class hopp.simulation.technologies.dispatch.power_storage.simple_battery_dispatch_heuristic.SimpleBatteryDispatchHeuristic(pyomo_model, index_set, system_model, financial_model, fixed_dispatch=None, block_set_name='heuristic_battery', dispatch_options=None)#
Bases:
SimpleBatteryDispatchFixes battery dispatch operations based on user input.
Currently, enforces available generation and grid limit assuming no battery charging from grid.
- Parameters:
pyomo_model (ConcreteModel)
index_set (Set)
system_model (BatteryStateful)
financial_model (Singleowner)
fixed_dispatch (List | None)
block_set_name (str)
dispatch_options (Dict | None)
- __init__(pyomo_model, index_set, system_model, financial_model, fixed_dispatch=None, block_set_name='heuristic_battery', dispatch_options=None)#
Initialize SimpleBatteryDispatchHeuristic.
- Parameters:
pyomo_model (pyomo.ConcreteModel) – Pyomo concrete model.
index_set (pyomo.Set) – Indexed set.
system_model (PySAMBatteryModel.BatteryStateful) – Battery system model.
financial_model (Singleowner.Singleowner) – Financial model.
fixed_dispatch (Optional[List], optional) – List of normalized values [-1, 1] (Charging (-), Discharging (+)). Defaults to None.
block_set_name (str, optional) – Name of block set. Defaults to ‘heuristic_battery’.
dispatch_options (dict, optional) – Dispatch options. Defaults to None.
- set_fixed_dispatch(gen, grid_limit)#
Sets charge and discharge power of battery dispatch using fixed_dispatch attribute and enforces available generation and grid limits.
- Parameters:
gen (list) – Generation blocks.
grid_limit (list) – Grid capacity.
- Raises:
ValueError – If gen or grid_limit length does not match fixed_dispatch length.
- check_gen_grid_limit(gen, grid_limit)#
Checks if generation and grid limit lengths match fixed_dispatch length.
- Parameters:
gen (list) – Generation blocks.
grid_limit (list) – Grid capacity.
- Raises:
ValueError – If gen or grid_limit length does not match fixed_dispatch length.
- _set_power_fraction_limits(gen, grid_limit)#
Set battery charge and discharge power fraction limits based on available generation and grid capacity, respectively.
- Parameters:
gen (list) – Generation blocks.
grid_limit (list) – Grid capacity.
NOTE: This method assumes that battery cannot be charged by the grid.
- static enforce_power_fraction_simple_bounds(power_fraction)#
Enforces simple bounds (0, .9) for battery power fractions.
- Parameters:
power_fraction (float) – Power fraction from heuristic method.
- Returns:
power_fraction (float) – Bounded power fraction.
- Return type:
float
- update_soc(power_fraction, soc0)#
Updates SOC based on power fraction threshold (0.1).
- Parameters:
power_fraction (float) – Power fraction from heuristic method. Below threshold is charging, above is discharging.
soc0 (float) – Initial SOC.
- Returns:
soc (float) – Updated SOC.
- Return type:
float
- _heuristic_method(_)#
Executes specific heuristic method to fix battery dispatch.
- _enforce_power_fraction_limits()#
Enforces battery power fraction limits and sets _fixed_dispatch attribute.
- _fix_dispatch_model_variables()#
Fixes dispatch model variables based on the fixed dispatch values.
- static _check_efficiency_value(efficiency)#
Checks efficiency is between 0 and 1 or 0 and 100. Returns fractional value
- _check_initial_soc(initial_soc)#
Checks initial state-of-charge.
- Parameters:
initial_soc – Initial state-of-charge value.
- Returns:
float – Checked initial state-of-charge.
- _create_capacity_parameter(storage)#
Creates storage capacity parameter.
- Parameters:
storage – Storage instance.
- _create_efficiency_parameters(storage)#
Creates storage efficiency parameters.
- Parameters:
storage – Storage instance.
- _create_lifecycle_count_constraint()#
Creates lifecycle count constraint.
- _create_lifecycle_model()#
Creates lifecycle model.
- _create_port(hybrid)#
Creates storage port.
- Parameters:
hybrid – Hybrid instance.
- Returns:
Port – Storage port.
- _create_soc_inventory_constraint(storage)#
Creates state-of-charge inventory constraint for storage.
- Parameters:
storage – Storage instance.
- _create_soc_linking_constraint()#
Creates state-of-charge linking constraint.
- _create_storage_constraints(storage)#
- _create_storage_parameters(storage)#
Creates storage parameters.
- Parameters:
storage – Storage instance.
- static _create_storage_port(storage)#
Creates storage port.
- Parameters:
storage – Storage instance.
- _create_storage_variables(storage)#
Creates storage variables.
- Parameters:
storage – Storage instance.
- _create_variables(hybrid)#
Creates storage variables.
- Parameters:
hybrid – Hybrid instance.
- Returns:
Tuple – Tuple containing battery discharge and charge variables.
- _lifecycle_count_rule(m, i)#
Calculates lifecycle count rule.
- Parameters:
m – Model instance.
i – Index.
- Returns:
float – Lifecycle count.
- _set_control_mode()#
Sets control mode.
- _set_model_specific_parameters(round_trip_efficiency=88.0)#
Sets model-specific parameters.
- Parameters:
round_trip_efficiency (float, optional) – The round-trip efficiency including converter efficiency. Defaults to 88.0, which includes converter efficiency.
- property blocks: Block#
- property capacity: float#
Capacity.
- property charge_efficiency: float#
Charge efficiency.
- property charge_power: list#
Charge power.
- property cost_per_charge: float#
Cost per charge.
- property cost_per_discharge: float#
Cost per discharge.
- property current: list#
Current.
- property discharge_efficiency: float#
Discharge efficiency.
- property discharge_power: list#
Discharge power.
- dispatch_block_rule(storage)#
- Initializes storage parameters, variables, and constraints.
Called during Dispatch’s __init__.
- Parameters:
storage – Storage instance.
- property fixed_dispatch: list#
List of fixed dispatch.
- Type:
list
- property generation: list#
Generation.
- property initial_soc: float#
Initial state-of-charge.
- initialize_parameters()#
Initializes parameters.
- property is_charging: list#
Storage is charging.
- property is_discharging: list#
Storage is discharging.
- property lifecycle_cost: float#
Lifecycle cost.
- property lifecycle_cost_per_kWh_cycle: float#
Lifecycle cost per kWh cycle.
- property lifecycles: float#
Lifecycles.
- max_gross_profit_objective(hybrid_blocks)#
Sets the max gross profit objective for the dispatch.
- Parameters:
hybrid_blocks (Pyomo.block) – A generalized container for defining hierarchical models by adding modeling components as attributes.
- property maximum_power: float#
Maximum power.
- property maximum_soc: float#
Maximum state-of-charge.
- min_operating_cost_objective(hybrid_blocks)#
Sets the min operating cost objective for the dispatch.
- Parameters:
hybrid_blocks (Pyomo.block) – A generalized container for defining hierarchical models by adding modeling components as attributes.
- property minimum_power: float#
Minimum power.
- property minimum_soc: float#
Minimum state-of-charge.
- property model: ConcreteModel#
- property power: list#
Power.
- property round_trip_efficiency: float#
Round trip efficiency.
- property soc: list#
State-of-charge.
- property time_duration: list#
Time duration.
- update_dispatch_initial_soc(initial_soc=None)#
Updates dispatch initial state of charge (SOC).
- Parameters:
initial_soc (float, optional) – Initial state of charge. Defaults to None.
- update_time_series_parameters(start_time)#
Updates time series parameters.
- Parameters:
start_time (int) – The start time.
- property user_fixed_dispatch: list#
List of user fixed dispatch.
- Type:
list