h2integrate.control.control_strategies.storage.demand_openloop_storage_controller#
Classes
|
A controller that manages commodity flow based on demand and storage constraints. |
Configuration class for the DemandOpenLoopStorageController. |
- class h2integrate.control.control_strategies.storage.demand_openloop_storage_controller.DemandOpenLoopStorageControllerConfig(*, commodity, commodity_rate_units, demand_profile, commodity_amount_units=None, max_capacity, max_soc_fraction, min_soc_fraction, init_soc_fraction, max_charge_rate, charge_equals_discharge=True, max_discharge_rate=None, charge_efficiency=None, discharge_efficiency=None, round_trip_efficiency=None)#
Configuration class for the DemandOpenLoopStorageController.
This class defines the parameters required to configure the DemandOpenLoopStorageController.
- Parameters:
commodity (str)
commodity_rate_units (str)
demand_profile (int | float | list)
commodity_amount_units (str)
max_capacity (float)
max_soc_fraction (float)
min_soc_fraction (float)
init_soc_fraction (float)
max_charge_rate (float)
charge_equals_discharge (bool)
max_discharge_rate (float | None)
charge_efficiency (float | None)
discharge_efficiency (float | None)
round_trip_efficiency (float | None)
- commodity#
Name of the commodity being controlled (e.g., “hydrogen”). Stripped of whitespace.
- Type:
str
- commodity_rate_units#
Units of the commodity (e.g., “kg/h”).
- Type:
str
- demand_profile#
Demand values for each timestep, in the same units as commodity_rate_units. May be a scalar for constant demand or a list/array for time-varying demand.
- Type:
int | float | list
- max_capacity#
Maximum storage capacity of the commodity (in non-rate units, e.g., “kg” if commodity_rate_units is “kg/h”).
- Type:
float
- max_soc_fraction#
Maximum allowable state of charge (SOC) as a fraction of max_capacity, between 0 and 1.
- Type:
float
- min_soc_fraction#
Minimum allowable SOC as a fraction of max_capacity, between 0 and 1.
- Type:
float
- init_soc_fraction#
Initial SOC as a fraction of max_capacity, between 0 and 1.
- Type:
float
- max_charge_rate#
Maximum rate at which the commodity can be charged (in units per time step, e.g., “kg/time step”). This rate does not include the charge_efficiency.
- Type:
float
- charge_equals_discharge#
If True, set the max_discharge_rate equal to the max_charge_rate. If False, specify the max_discharge_rate as a value different than the max_charge_rate. Defaults to True.
- Type:
bool, optional
- max_discharge_rate#
Maximum rate at which the commodity can be discharged (in units per time step, e.g., “kg/time step”). This rate does not include the discharge_efficiency. Only required if charge_equals_discharge is False.
- Type:
float | None, optional
- charge_efficiency#
Efficiency of charging the storage, represented as a decimal between 0 and 1 (e.g., 0.9 for 90% efficiency). Optional 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). Optional 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). Optional if charge_efficiency and discharge_efficiency are provided.
- Type:
float | None, optional
- commodity_amount_units#
Units of the commodity as an amount (i.e., kW*h or kg). If not provided, defaults to commodity_rate_units*h.
- Type:
str | None, optional
- max_capacity: float#
- max_soc_fraction: float#
- min_soc_fraction: float#
- init_soc_fraction: float#
- max_charge_rate: float#
- charge_equals_discharge: bool#
- max_discharge_rate: float | None#
- charge_efficiency: float | None#
- discharge_efficiency: float | None#
- round_trip_efficiency: float | None#
- class h2integrate.control.control_strategies.storage.demand_openloop_storage_controller.DemandOpenLoopStorageController(**kwargs)#
A controller that manages commodity flow based on demand and storage constraints.
The DemandOpenLoopStorageController computes the dispatch commands for a commodity storage system. It uses a demand profile and storage parameters to determine how much of the commodity to charge, discharge, or curtail at each time step.
- _time_step_bounds = (3600, 3600)#
- setup()#
Declare inputs and outputs.
- Available attributes:
name pathname comm options
- compute(inputs, outputs)#
Compute storage state of charge (SOC), delivered output, curtailment, and unmet demand over the simulation horizon.
This method applies an open-loop storage control strategy to balance the commodity demand and input flow. When input exceeds demand, excess commodity is used to charge storage (subject to rate, efficiency, and SOC limits). When demand exceeds input, storage is discharged to meet the deficit (also subject to constraints). SOC is updated at each time step, ensuring it remains within allowable bounds.
- Expected input keys:
<commodity>_in: Timeseries of commodity available at each time step.<commodity>_demand: Timeseries demand profile.max_charge_rate: Maximum charge rate permitted.max_capacity: Maximum total storage capacity.
- Outputs populated:
<commodity>_set_point: Dispatch command to storage,negative when charging, positive when discharging.
- Control logic includes:
Enforcing SOC limits (min, max, and initial conditions).
Applying charge and discharge efficiencies.
Observing charge/discharge rate limits.
Tracking energy shortfalls and excesses at each time step.
- Raises:
UserWarning – If the demand profile is entirely zero.
UserWarning – If
max_charge_rateormax_capacityis negative.
- Returns:
None