h2integrate.control.control_strategies.storage.heuristic_pyomo_controller

Contents

h2integrate.control.control_strategies.storage.heuristic_pyomo_controller#

Classes

HeuristicLoadFollowingStorageController(**kwargs)

Operates storage based on heuristic rules to meet the demand profile based on

HeuristicLoadFollowingStorageControllerConfig(*, ...)

Configuration class for the HeuristicLoadFollowingStorageController.

class h2integrate.control.control_strategies.storage.heuristic_pyomo_controller.HeuristicLoadFollowingStorageControllerConfig(*, max_capacity, max_soc_fraction, min_soc_fraction, init_soc_fraction, n_control_window, commodity, commodity_rate_units, tech_name, system_commodity_interface_limit, round_digits=4, charge_efficiency=None, discharge_efficiency=None, round_trip_efficiency=None)#

Configuration class for the HeuristicLoadFollowingStorageController.

Parameters:
  • max_capacity (float)

  • max_soc_fraction (float)

  • min_soc_fraction (float)

  • init_soc_fraction (float)

  • n_control_window (int)

  • commodity (str)

  • commodity_rate_units (str)

  • tech_name (str)

  • system_commodity_interface_limit (float | int | str | list[float])

  • round_digits (int)

  • charge_efficiency (float)

  • discharge_efficiency (float)

  • round_trip_efficiency (float | None)

charge_efficiency#

Efficiency of charging the storage, represented as a decimal between 0 and 1 (e.g., 0.9 for 90% efficiency). Must be None if round_trip_efficiency is provided.

Type:

float | None, optional

discharge_efficiency#

Efficiency of discharging the storage, represented as a decimal between 0 and 1 (e.g., 0.9 for 90% efficiency). Must be None if round_trip_efficiency is provided.

Type:

float | None, optional

round_trip_efficiency#

Combined efficiency of charging and discharging the storage, represented as a decimal between 0 and 1 (e.g., 0.81 for 81% efficiency). Must be None if charge_efficiency or discharge_efficiency are provided.

Type:

float | None, optional

charge_efficiency: float#
discharge_efficiency: float#
round_trip_efficiency: float | None#
class h2integrate.control.control_strategies.storage.heuristic_pyomo_controller.HeuristicLoadFollowingStorageController(**kwargs)#
Operates storage based on heuristic rules to meet the demand profile based on

available commodity from generation profiles and demand profile.

Currently, enforces available generation and system interface limit assuming no storage charging from external sources.

_time_step_bounds = (3600, 3600)#
setup()#

Initialize the heuristic load-following controller.

pyomo_setup(discrete_inputs)#

Create the Pyomo model, attach per-tech Blocks, and return dispatch solver.

Returns:

callable

Function(performance_model, performance_model_kwargs, inputs, commodity)

executing rolling-window heuristic dispatch and returning: (total_out, storage_out, unmet_demand, unused_commodity, soc)

initialize_parameters(inputs)#

Initializes parameters.

update_time_series_parameters(start_time=0)#

Updates time series parameters.

Parameters:

start_time (int) – The start time.

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.

check_commodity_in_discharge_limit(commodity_in, system_commodity_interface_limit)#

Checks if commodity in and discharge limit lengths match fixed_dispatch length.

Parameters:
  • commodity_in (list) – commodity blocks.

  • system_commodity_interface_limit (list) – Maximum flow rate of commodity through

  • interface (the system)

Raises:
  • ValueError – If commodity_in or system_commodity_interface_limit length does not

  • match fixed_dispatch length.

set_fixed_dispatch(commodity_in, system_commodity_interface_limit, commodity_demand)#
Sets charge and discharge amount of storage dispatch using fixed_dispatch attribute

and enforces available generation and charge/discharge limits.

Parameters:
  • commodity_in (list) – List of generated commodity in.

  • system_commodity_interface_limit (list) – List of max flow rates through system interface (e.g. grid interface).

  • commodity_demand (list) – The demanded commodity.

_set_commodity_fraction_limits(commodity_in, system_commodity_interface_limit)#

Set storage charge and discharge fraction limits based on available generation and system interface capacity, respectively.

Parameters:
  • commodity_in (list) – commodity blocks.

  • system_commodity_interface_limit (list) – Maximum flow rate of commodity

  • interface (through the system)

NOTE: This method assumes that storage cannot be charged by the grid.

_heuristic_method(commodity_in, commodity_demand)#

Enforces storage fraction limits and sets _fixed_dispatch attribute. Sets the _fixed_dispatch based on commodity_demand and commodity_in.

Parameters:
  • commodity_in – commodity generation profile.

  • commodity_demand – Goal amount of commodity.

static enforce_power_fraction_simple_bounds(storage_fraction, minimum_soc, maximum_soc)#

Enforces simple bounds for storage power fractions.

Parameters:
  • storage_fraction (float) – Storage fraction from heuristic method.

  • minimum_soc (float) – Minimum state of charge fraction.

  • maximum_soc (float) – Maximum state of charge fraction.

Returns:

float – Bounded storage fraction within [minimum_soc, maximum_soc].

Return type:

float

update_soc(storage_fraction, soc0)#

Updates SOC based on storage fraction threshold.

Parameters:
  • storage_fraction (float) – Storage fraction from heuristic method. Below threshold is charging, above is discharging.

  • soc0 (float) – Initial SOC.

Returns:

soc (float) – Updated SOC.

Return type:

float

_enforce_power_fraction_limits()#

Enforces storage fraction limits and sets _fixed_dispatch attribute.

_fix_dispatch_model_variables()#

Fixes dispatch model variables based on the fixed dispatch values.

_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.

property fixed_dispatch: list#

List of fixed dispatch.

Type:

list

property user_fixed_dispatch: list#

List of user fixed dispatch.

Type:

list

property storage_dispatch_commands: list#

Commanded dispatch including available commodity at current time step that has not been used to charge storage.

property soc: list#

State-of-charge.

property charge_commodity: list#

Charge commodity.

property discharge_commodity: list#

Discharge commodity.

property initial_soc: float#

Initial state-of-charge.

property minimum_soc: float#

Minimum state-of-charge.

property maximum_soc: float#

Maximum state-of-charge.

property charge_efficiency: float#

Charge efficiency.

property discharge_efficiency: float#

Discharge efficiency.