h2integrate.control.control_rules.storage.pyomo_storage_rule_min_operating_cost#

Classes

PyomoRuleStorageMinOperatingCosts(...[, ...])

Class defining Pyomo rules for the optimized dispatch for load following for generic commodity storage components.

class h2integrate.control.control_rules.storage.pyomo_storage_rule_min_operating_cost.PyomoRuleStorageMinOperatingCosts(commodity_info, pyomo_model, index_set, round_digits, time_duration, block_set_name='storage')#

Class defining Pyomo rules for the optimized dispatch for load following for generic commodity storage components.

Parameters:
  • commodity_info (dict) – Dictionary of commodity information. This must contain the keys “commodity_name” and “commodity_storage_units”.

  • pyomo_model (pyo.ConcreteModel) – Externally defined Pyomo model that works as the base model that this class builds off of.

  • index_set (pyo.Set) – Externally defined Pyomo index set for time steps. This should be consistent with the forecast horizon of the optimization problem.

  • round_digits (int) – Number of digits to round to in the Pyomo model.

  • block_set_name (str, optional) – Name of the block set (model variables). Defaults to “storage”.

  • time_duration (float)

initialize_parameters(commodity_in, commodity_demand, dispatch_inputs)#

Initialize parameters for optimization model

Parameters:
  • commodity_in (list) – List of generated commodity in for this time slice.

  • commodity_demand (list) – The demanded commodity for this time slice.

  • dispatch_inputs (dict) – Dictionary of the dispatch input parameters from config

dispatch_block_rule_function(pyomo_model, tech_name)#

Creates and initializes pyomo dispatch model components for a specific technology.

This method sets up all model elements (parameters, variables, constraints, and ports) associated with a technology block within the dispatch model.

Parameters:
  • pyomo_model (pyo.ConcreteModel) – The Pyomo model to which the technology components will be added.

  • tech_name (str) – The name or key identifying the technology (e.g., “battery”, “electrolyzer”) for which model components are created.

_create_parameters(pyomo_model, t)#

Create storage-related parameters in the Pyomo model.

This method defines key storage parameters such as capacity limits, state-of-charge (SOC) bounds, efficiencies, and time duration for each time step. This method also defined system parameters such as the value of load the load met and the production limit of the system.

Parameters:
  • pyomo_model (pyo.ConcreteModel) – Pyomo model instance representing the storage system.

  • t – Time index or iterable representing time steps (unused in this method) but is needed for compatibility with Pyomo.

_create_variables(pyomo_model, t)#

Create storage-related decision variables in the Pyomo model.

This method defines binary and continuous variables representing charging/discharging modes, energy flows, and state-of-charge, as well as system variables such as system load, system production, and commodity produced.

Parameters:
  • pyomo_model (pyo.ConcreteModel) – Pyomo model instance representing the storage system.

  • t – Time index or iterable representing time steps (unused in this method).

_create_constraints(pyomo_model, t)#

Create operational and state-of-charge constraints for storage and the system.

This method defines constraints that enforce: - Mutual exclusivity between charging and discharging. - Upper and lower bounds on charge/discharge flows. - The state-of-charge balance over time. - The system balance of output with system production and load - The system output is less than or equal to the load (because of linear optimization)

Parameters:
  • pyomo_model (pyo.ConcreteModel) – Pyomo model instance representing the storage system.

  • t – Time index or iterable representing time steps (unused in this method).

_set_initial_soc_constraint()#

This method links the SOC between the end of one control period and the beginning of the next control period.

_create_ports(pyomo_model, t)#

Create Pyomo ports for connecting the storage component.

Ports are used to connect inflows and outflows of the storage system (e.g., charging and discharging commodities) to the overall Pyomo model.

Parameters:
  • pyomo_model (pyo.ConcreteModel) – Pyomo model instance representing the storage system.

  • t – Time index or iterable representing time steps (unused in this method).

update_time_series_parameters(commodity_in, commodity_demand, updated_initial_soc)#

Updates the pyomo optimization problem with parameters that change with time

Parameters:
  • commodity_in (list) – List of generated commodity in for this time slice.

  • commodity_demand (list) – The demanded commodity for this time slice.

  • updated_initial_soc (float) – The updated initial state of charge for storage technologies for the current time slice.

min_operating_cost_objective(hybrid_blocks, tech_name)#

Storage instance of minimum operating cost objective.

Parameters:
  • hybrid_blocks (Pyomo.block) – A generalized container for defining hierarchical models by adding modeling components as attributes.

  • tech_name (str) – The name or key identifying the technology for which the objective function.

_create_hybrid_port(hybrid_model, tech_name)#

Create generic storage ports to add to system-level pyomo model instance.

Parameters:
  • hybrid_model (pyo.ConcreteModel) – hybrid_model the ports should be added to.

  • tech_name (str) – The name or key identifying the technology for which

  • created. (ports are)

_create_hybrid_variables(hybrid_model, tech_name)#

Create generic storage variables to add to system-level pyomo model instance.

Parameters:
  • hybrid_model (pyo.ConcreteModel) – hybrid_model the variables should be added to.

  • tech_name (str) – The name or key identifying the technology for which

  • created. (variables are)

static _check_efficiency_value(efficiency)#

Checks efficiency is between 0 and 1 or 0 and 100. Returns fractional value

property time_duration: list#

Time duration.

set_timeseries_parameter(param_name, param_val)#
Parameters:
  • param_name (str)

  • param_val (float)

property charge_efficiency: float#

Charge efficiency.

property discharge_efficiency: float#

Discharge efficiency.

property round_trip_efficiency: float#

Round trip efficiency.

property commodity_load_demand: list#