Store
The Store component connects to a single bus and provides
inter-temporal storage of the carrier of the Bus it attaches to.
Its nominal quantity is the energy capacity e_nom in MWh. The dispatch p is
positive when the store supplies the bus. Where losses or direction-specific costs
require it, a charging variable p_store complements it, so that p + p_store is
the discharge. The outputs p_dispatch and p_store report both directions.
By default, charging and discharging power are not limited. A finite max_hours
limits them to e_nom / max_hours (scaled by p_max_pu and p_min_pu), i.e. it
couples the power capacity to the energy capacity as for a battery with a fixed
energy-to-power ratio. Losses on the way into and out of the store are given by
efficiency_store and efficiency_dispatch, standing losses by standing_loss.
An exogenous inflow (e.g. river inflow to a hydro reservoir) may be spilled at
spill_cost.
For independent charging and discharging power capacities, connect separate
Link components to an auxiliary
Bus to which the Store attaches.
This decoupled approach also enables asymmetric power ratings for charging and discharging.
Hydrogen storage system with a Store and two Link components
graph LR
ElectricityBus["Electricity Bus"]:::bus
HydrogenBus["Hydrogen Bus"]:::bus
SteelTank["Steel Tank Store"]:::store
ElectricityBus -->|Electrolyser Link| HydrogenBus
HydrogenBus -->|Hydrogen Turbine Link| ElectricityBus
HydrogenBus --> SteelTank
classDef bus fill:#f9f,stroke:#333,stroke-width:2,shape:circle;
classDef store fill:#bbf,stroke:#333,stroke-width:2,shape:rect;Marginal costs
The marginal_cost attribute applies to the net dispatch p: discharging incurs
a cost and charging is credited. It represents the value of the stored carrier,
e.g. for trading it at a fixed price or for assigning a water value. The
marginal_cost_dispatch and marginal_cost_store attributes apply to
discharging and charging separately, e.g. for variable operating costs of a
battery inverter or for wear costs per MWh moved.
Relation to storage units
Store covers all functionality of
StorageUnit components and, with infinite
max_hours, leaves the power unconstrained.
n.c.storage_units.convert_to_stores() converts
storage units into equivalent stores. In custom constraints, the net dispatch of
a store is the variable n.model["Store-p"] and the charging power n.model["Store-p_store"].
| attribute | type | unit | default | description | status |
|---|---|---|---|---|---|
| name | string | nan | nan | Unique name | Input (required) |
| bus | string | nan | nan | Name of bus to which store is attached. | Input (required) |
| control | string | nan | PQ | P,Q,V control strategy for PF, must be "PQ", "PV" or "Slack". | Input (optional) |
| type | string | nan | nan | Placeholder for store type. Not yet implemented. | Input (optional) |
| carrier | string | nan | nan | Carrier of the store. | Input (optional) |
| e_nom | float | MWh | 0 | Nominal energy capacity (i.e. limit on e). Ignored if e_nom_extendable=True. | Input (optional) |
| e_nom_mod | float | MWh | 0 | Nominal energy capacity of the store module. Introduces integer variables if set. | Input (optional) |
| e_nom_extendable | boolean | nan | False | Switch to allow capacity e_nom to be extended in optimisation. | Input (optional) |
| e_nom_min | float | MWh | 0 | If e_nom_extendable=True, set the minimum value of e_nom_opt. | Input (optional) |
| e_nom_max | float | MWh | inf | If e_nom_extendable=True, set the maximum value of e_nom_opt. | Input (optional) |
| e_nom_set | float | MWh | nan | If e_nom_extendable=True, set the value of e_nom_opt. | Input (optional) |
| e_min_pu | static or series | per unit | 0 | Minimal value of e relative to e_nom for the optimisation. | Input (optional) |
| e_max_pu | static or series | per unit | 1 | Maximal value of e relative to e_nom for the optimisation. | Input (optional) |
| e_initial | float | MWh | 0 | Energy before the snapshots in the optimisation. | Input (optional) |
| cycles_max | float | cycles | inf | Maximum number of equivalent full cycles over the snapshots of the optimisation, i.e. discharge at the bus divided by e_nom. | Input (optional) |
| e_initial_per_period | boolean | nan | False | Switch: if True, then at the beginning of each investment period e is set to e_initial. | Input (optional) |
| e_cyclic | boolean | nan | 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. | Input (optional) |
| e_cyclic_per_period | boolean | nan | False | Switch: if True, then the cyclic constraints are applied to each investment period separately. | Input (optional) |
| p_set | static or series | MW | nan | Active power set point (for optimisation and power flow) | Input (optional) |
| e_sum_min | float | MWh | -inf | The minimum total net energy dispatched (p) over all snapshots of the optimization, with investment periods weighted by their years, also across the windows of a rolling horizon optimization. | Input (optional) |
| e_sum_max | float | MWh | inf | The maximum total net energy dispatched (p) over all snapshots of the optimization, with investment periods weighted by their years, also across the windows of a rolling horizon optimization. | Input (optional) |
| q_set | static or series | MVar | 0 | Reactive power set point (for power flow only) | Input (optional) |
| e_set | static or series | MWh | nan | Fixed energy filling level set point (for optimisation only) | Input (optional) |
| max_hours | float | hours | inf | Ratio of energy capacity e_nom to power capacity. Limits discharging to p_max_pu * e_nom / max_hours and charging to -p_min_pu * e_nom / max_hours. Infinite by default, i.e. power is unconstrained. | Input (optional) |
| p_min_pu | static or series | per unit | -1 | Minimum output per unit of power capacity e_nom / max_hours. Negative sign implies storing mode withdrawing power from bus. Only applied if max_hours is finite. | Input (optional) |
| p_max_pu | static or series | per unit | 1 | Maximum output per unit of power capacity e_nom / max_hours. Positive sign implies discharging mode injecting power into bus. Only applied if max_hours is finite. | Input (optional) |
| sign | float | nan | 1 | Sign denoting orientation of the energy variable (e). | Input (optional) |
| marginal_cost | static or piecewise or series | currency/MWh | 0 | Marginal cost of net dispatch of 1 MWh (positive p incurs cost; negative p is credited). | Input (optional) |
| marginal_cost_dispatch | static or series | currency/MWh | 0 | Marginal cost of discharging 1 MWh (p_dispatch). | Input (optional) |
| marginal_cost_store | static or series | currency/MWh | 0 | Marginal cost of charging 1 MWh (p_store). | Input (optional) |
| marginal_cost_quadratic | static or series | currency/MWh | 0 | Quadratic marginal cost of net dispatch of 1 MWh. | Input (optional) |
| marginal_cost_storage | static or series | currency/MWh/h | 0 | Marginal cost of energy storage of 1 MWh for one hour. | Input (optional) |
| capital_cost | float | currency/MWh | 0 | Fixed period costs of extending e_nom by 1 MWh (e.g. annuitized investment costs). Used directly unless overnight_cost is specified. | Input (optional) |
| overnight_cost | float | currency/MWh | nan | Overnight (upfront) investment cost per MWh. If specified, PyPSA calculates annuity using discount_rate and lifetime. Takes precedence over capital_cost. | Input (optional) |
| discount_rate | float | per unit | nan | Discount rate for annuity calculation when using overnight_cost. Supports 0% rate (simple depreciation). | Input (optional) |
| fom_cost | float | currency/MWh | 0 | Fixed period operation and maintenance costs per MWh, added to annuitized investment cost. | Input (optional) |
| standing_loss | static or series | per unit | 0 | Losses per hour to energy level. | Input (optional) |
| efficiency_store | static or series | per unit | 1 | Efficiency of storage on the way into the storage. | Input (optional) |
| efficiency_dispatch | static or series | per unit | 1 | Efficiency of storage on the way out of the storage. | Input (optional) |
| inflow | static or series | MW | 0 | Inflow to the energy level (e.g. due to river inflow in hydro reservoir). | Input (optional) |
| spill_cost | static or series | currency/MWh | 0 | Cost of spilling 1 MWh | Input (optional) |
| active | boolean | nan | True | Whether to consider the component in optimisation or not | Input (optional) |
| build_year | int | year | 0 | Build year | Input (optional) |
| lifetime | float | years | inf | Lifetime | Input (optional) |
| p | series | MW | 0 | Power at bus (positive if net supply) | Output |
| p_dispatch | series | MW | 0 | Active power dispatch at bus | Output |
| p_store | series | MW | 0 | Active power charging at bus | Output |
| spill | series | MW | 0 | Spillage for each snapshot (e.g. hydro-dam letting water flow over the spillway without generating electricity). | Output |
| q | series | MVar | 0 | Reactive power (positive if net supply) | Output |
| e | series | MWh | 0 | Energy level of store as calculated by the optimisation. | Output |
| e_nom_opt | float | MWh | 0 | Optimised nominal energy capacity outputed by optimisation. | Output |
| mu_upper | series | currency/MWh | nan | Shadow price of upper e_nom limit | Output |
| mu_lower | series | currency/MWh | nan | Shadow price of lower e_nom limit | Output |
| mu_energy_balance | series | currency/MWh | nan | Shadow price of storage consistency equations (i.e. water values) | Output |
| capital_cost_piecewise_opt | float | currency/MWh | 0. | Optimised capital cost when using piecewise linearisation. | Output |
| marginal_cost_piecewise_opt | series | currency/MWh | 0. | Optimised marginal cost when using piecewise linearisation. | Output |
2026-11-02
2025-10-09