Storage Unit¶
The StorageUnit components connect to a single bus and enable inter-temporal energy shifting with coupled power and energy capacity modelling. This compoenent is suitable for modeling batteries, pumped hydro storage, and other storage technologies where power and energy capacities are coupled.
- Energy capacity is defined as a fixed ratio (
max_hours) of power capacity:e_nom = p_nom * max_hours(MW × h = MWh) - An
inflowattribute (an exogenous parameter representing an energy input from external sources) andspill(energy overflow/spillage) variable are supported - For storage units, if \(p>0\) the storage unit is supplying active power to the bus (discharging) and if \(q>0\) it is supplying reactive power.
When to use Store instead?
For independent optimization of power and energy capacities, use the Store component at an auxiliary Bus combined with separate Link components for charging and discharging. Add a Generator or Load at the auxiliary Bus for modelling spillage and inflow from an external source. See also this example.
| attribute | type | unit | default | description | status |
|---|---|---|---|---|---|
| name | string | nan | nan | Unique name | Input (required) |
| bus | string | nan | nan | Name of bus to which storage unit 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 storage unit type. Not yet implemented. | Input (optional) |
| p_nom | float | MW | 0 | Nominal power for limits on p in optimisation. Ignored if p_nom_extendable=True. |
Input (optional) |
| p_nom_mod | float | MW | 0 | Nominal power of the storage unit module. Introduces integer variables if set. | Input (optional) |
| p_nom_extendable | boolean | nan | False | Switch to allow capacity p_nom to be extended in optimisation. |
Input (optional) |
| p_nom_min | float | MW | 0 | If p_nom_extendable=True, set the minimum value of p_nom_opt. |
Input (optional) |
| p_nom_max | float | MW | inf | If p_nom_extendable=True, set the maximum value of p_nom_opt. |
Input (optional) |
| p_nom_set | float | MW | nan | If p_nom_extendable=True, set the value of p_nom_opt. |
Input (optional) |
| p_min_pu | static or series | per unit | -1 | The minimum output for each snapshot per unit of p_nom for the optimisation. Negative sign implies storing mode withdrawing power from bus. |
Input (optional) |
| p_max_pu | static or series | per unit | 1 | The maximum output for each snapshot per unit of p_nom for the optimisation. Positive sign implies discharging mode injecting power into bus. |
Input (optional) |
| p_set | static or series | MW | nan | Active power set point. Sets p directly in power flow. In LOPF optimisation constrains net power (p_dispatch - p_store) | Input (optional) |
| q_set | static or series | MVar | 0 | Reactive power set point (for power flow only) | Input (optional) |
| p_dispatch_set | static or series | MW | nan | Active power dispatch set point (for optimisation only) | Input (optional) |
| p_store_set | static or series | MW | nan | Active power charging set point (for optimisation only) | Input (optional) |
| sign | float | nan | 1 | Sign denoting the orientation of the dispatch variable. | Input (optional) |
| carrier | string | nan | nan | Prime mover energy carrier (e.g. coal, gas, wind, solar); required for global constraints on primary energy in optimisation | Input (optional) |
| spill_cost | static or series | currency/MWh | 0 | Cost of spilling 1 MWh | Input (optional) |
| marginal_cost | static or series | currency/MWh | 0 | Marginal cost of production (discharge) of 1 MWh. | Input (optional) |
| marginal_cost_quadratic | static or series | currency/MWh | 0 | Quadratic marginal cost of production (discharge) 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/MW | 0 | Fixed period costs of extending p_nom by 1 MW (e.g. annuitized investment costs). Used directly unless overnight_cost is specified. |
Input (optional) |
| overnight_cost | float | currency/MW | nan | Overnight (upfront) investment cost per MW. 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/MW | 0 | Fixed period operation and maintenance costs per MW, added to annuitized investment cost. | 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) |
| state_of_charge_initial | float | MWh | 0 | State of charge before the snapshots in the optimisation. | Input (optional) |
| state_of_charge_initial_per_period | boolean | nan | False | Switch: if True, the state of charge at the beginning of an investment period is set to state_of_charge_initial. |
Input (optional) |
| state_of_charge_set | static or series | MWh | nan | State of charge set points for snapshots in the optimisation. | Input (optional) |
| cyclic_state_of_charge | boolean | nan | False | Switch: if True, then state_of_charge_initial is ignored and the initial state of charge is set to the final state of charge for the group of snapshots in the optimisation (soc[-1] = soc[len(snapshots)-1]). |
Input (optional) |
| cyclic_state_of_charge_per_period | boolean | nan | False | Switch: if True, the cyclic constraints are applied to each investment period separately. | Input (optional) |
| max_hours | float | hours | 1 | Maximum state of charge capacity in terms of hours at full output power capacity p_nom |
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) |
| standing_loss | static or series | per unit | 0 | Losses per hour to state of charge. | Input (optional) |
| inflow | static or series | MW | 0 | Inflow to the state of charge (e.g. due to river inflow in hydro reservoir). | Input (optional) |
| p | series | MW | 0 | Active power at bus (positive if net generation) | Output |
| p_dispatch | series | MW | 0 | Active power dispatch at bus | Output |
| p_store | series | MW | 0 | Active power charging at bus | Output |
| q | series | MVar | 0 | Reactive power (positive if net generation) | Output |
| state_of_charge | series | MWh | nan | State of charge as calculated by the optimisation. | Output |
| spill | series | MW | 0 | Spillage for each snapshot (e.g. hydro-dam letting water flow over the spillway without generating electricity). | Output |
| p_nom_opt | float | MW | 0 | Optimised nominal power. | Output |
| mu_upper | series | currency/MWh | nan | Shadow price of upper p_nom limit | Output |
| mu_lower | series | currency/MWh | nan | Shadow price of lower p_nom limit | Output |
| mu_state_of_charge_set | series | currency/MWh | nan | Shadow price of fixed state of charge state_of_charge_set | Output |
| mu_energy_balance | series | currency/MWh | nan | Shadow price of storage consistency equations | Output |