Skip to content

Store

Use the Store class to represent an energy store with unlimited power capacity and given energy capacity (e_nom), in order to optimize its active power over time (StoreOptimizationDynamicResults.p).

Use the ExtendableStore class to represent a hypothetical store with an energy capacity that is flexible, in order to also optimize the energy capacity (ExtendableStoreOptimizationStaticResults.e_nom_opt).

API Reference

Store and ExtendableStore both inherit from the BaseStore parent class.

BaseStore

Bases: ENomExtendableComponent[T]

Stores provide fundamental inter-temporal storage functionality not limited in charging or discharging power.

PyPSA user guide for this component.

bus: str = Field(min_length=1)

Name of bus to which store is attached.

carrier: str | None = Field(default=None, min_length=1)

Carrier of the store.

e_nom_extendable: bool

Switch to allow capacity e_nom to be extended in optimisation.

e_min_pu: float | Series[T] = Field(default=0.0, ge=0.0, le=1.0)

Minimal value of e relative to e_nom for the optimisation.

e_max_pu: float | Series[T] = Field(default=1.0, ge=0.0, le=1.0)

Maximal value of e relative to e_nom for the optimisation.

e_initial: float = Field(default=0.0, ge=0.0)

Energy before the snapshots in the optimisation.

e_initial_per_period: bool = False

Switch: if True, then at the beginning of each investment period e is set to e_initial.

e_cyclic: bool = False

Switch: if True, then e_initial is ignored and the initial energy is set to the final energy for the group of snapshots in the optimisation.

e_cyclic_per_period: bool = False

Switch: if True, then the cyclic constraints are applied to each investment period separately.

p_set: float | Series[T] | None = Field(default=None, ge=0.0)

Active power set point (for power flow only).

q_set: float | Series[T] = Field(default=0.0, ge=0.0)

Reactive power set point (for power flow only).

e_set: float | Series[T] | None = Field(default=None, ge=0.0)

Fixed energy filling level set point (for optimisation only).

sign: SignType = +1

Sign denoting orientation of the energy variable (e).

marginal_cost: float | Series[T] = Field(default=0.0, ge=0.0)

Marginal cost applied to both charging and discharging of 1 MWh.

marginal_cost_quadratic: float | Series[T] = Field(default=0.0, ge=0.0)

Quadratic marginal cost of applied to charging and discharging of 1 MWh.

marginal_cost_storage: float | Series[T] = Field(default=0.0, ge=0.0)

Marginal cost of energy storage of 1 MWh for one hour.

standing_loss: float | Series[T] = Field(default=0.0, ge=0.0)

Losses per hour to energy level.

active: bool = True

Whether to consider the component in optimisation or not.

build_year: int | None = None

Build year.

lifetime: float | None = Field(default=None, gt=0.0)

Lifetime.

Store

Bases: BaseStore[T]

e_nom: float = Field(default=0.0, ge=0.0)

Nominal energy capacity (i.e. limit on e).

ExtendableStore

Bases: BaseStore[T]

e_nom_mod: float = Field(default=0.0, ge=0.0)

Nominal energy capacity of the store module. Introduces integer variables if set.

e_nom_min: float = Field(default=0.0, ge=0.0)

Minimum value of e_nom_opt.

e_nom_max: float | None = Field(default=None, gt=0.0)

Maximum value of e_nom_opt.

e_nom_set: float | None = Field(default=None, ge=0.0)

Set value of e_nom_opt.

capital_cost: float = Field(default=0.0, ge=0.0)

Fixed period costs of extending e_nom by 1 MWh, including periodized investment costs and periodic fixed O&M costs (e.g. annuitized investment costs).

StoreBaseDynamicResults

Bases: BaseDynamicResults

p: pandas.DataFrame

Power at bus (positive if net supply).

StoreOptimizationDynamicResults

Bases: StoreBaseDynamicResults

e: pandas.DataFrame

Energy level of store as calculated by the optimisation.

mu_upper: pandas.DataFrame

Shadow price of upper e_nom limit.

mu_lower: pandas.DataFrame

Shadow price of lower e_nom limit.

mu_energy_balance: pandas.DataFrame

Shadow price of storage consistency equations (i.e. water values).

StorePfDynamicResults

StoreNonlinearPfDynamicResults

Bases: StorePfDynamicResults

q: pandas.DataFrame

Reactive power (positive if net supply).