h2integrate.control.control_strategies.storage.demand_openloop_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_controller.DemandOpenLoopStorageControllerConfig(*, commodity_units, commodity_name, demand_profile, max_capacity, max_charge_percent, min_charge_percent, init_charge_percent, 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_units (str)
commodity_name (str)
demand_profile (int | float | list)
max_capacity (float)
max_charge_percent (float)
min_charge_percent (float)
init_charge_percent (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)
- max_capacity#
Maximum storage capacity of the commodity (in non-rate units, e.g., "kg" if commodity_units is "kg/h").
- Type:
float
- max_charge_percent#
Maximum allowable state of charge (SOC) as a percentage of max_capacity, represented as a decimal between 0 and 1.
- Type:
float
- min_charge_percent#
Minimum allowable SOC as a percentage of max_capacity, represented as a decimal between 0 and 1.
- Type:
float
- init_charge_percent#
Initial SOC as a percentage of max_capacity, represented as a decimal 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
- max_capacity: float#
- max_charge_percent: float#
- min_charge_percent: float#
- init_charge_percent: 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_controller.DemandOpenLoopStorageController(**kwargs)#
A controller that manages commodity flow based on demand and storage constraints.
The DemandOpenLoopStorageController computes the state of charge (SOC), output flow, curtailment, and missed load 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.
Note: the units of the outputs are the same as the commodity units, which is typically a rate in H2Integrate (e.g. kg/h)
- config#
Configuration object containing parameters such as commodity name, units, time steps, storage capacity, charge/discharge rates, efficiencies, and demand profile.
- Inputs:
- {commodity}_in (float): Input commodity flow timeseries (e.g., hydrogen production).
Units: Defined in commodity_units (e.g., "kg/h").
- Outputs:
- {commodity}_out (float): Output commodity flow timeseries after storage to meet demand.
Units: Defined in commodity_units (e.g., "kg/h").
- Note: the may include commodity from commodity_in that was never used to charge the
storage system but was directly dispatched to meet demand.
- {commodity}_soc (float): State of charge (SOC) timeseries for the storage system.
Units: "unitless" (percentage of maximum capacity given as a ratio between 0 and 1).
{commodity}_unused_commodity (float): Curtailment timeseries for unused input commodity.
Units: Defined in commodity_units (e.g., "kg/h").
- Note: curtailment in this case does not reduce what the converter produces, but
rather the system just does not use it (throws it away) because this controller is specific to the storage technology and has no influence on other technologies in the system.
- {commodity}_unmet_demand (float): Unmet demand timeseries when demand exceeds supply.
Same meaning as missed load. - Units: Defined in commodity_units (e.g., "kg/h").
- total_{commodity}_unmet_demand (float): Total unmet demand over the simulation period.
Units: Defined in commodity_units (e.g., "kg").
- setup()#
Set up inputs, outputs, and configuration for the open-loop storage controller.
This method initializes the controller configuration from the technology configuration, establishes the number of simulation time steps, adds inputs related to storage constraints (e.g., maximum charge rate and storage capacity), and defines outputs such as the commodity state-of-charge (SOC) timeseries and the estimated storage duration.
- Inputs defined:
max_charge_rate: Maximum rate at which storage can charge/discharge.max_capacity: Maximum total storage capacity.
- Outputs defined:
<commodity>_soc: Timeseries of storage state of charge.storage_duration: Estimated duration (hours) the storage can
discharge at its maximum rate.
- Returns:
None
- 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>_soc: State-of-charge timeseries (unitless).<commodity>_out: Output delivered to meet demand.<commodity>_unused_commodity: Curtailment timeseries.<commodity>_unmet_demand: Missed load timeseries.total_<commodity>_unmet_demand: Aggregated unmet demand.storage_duration: Estimated discharge duration at maximum rate (hours).
- 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