Skip to content

Storage Unit - Inputs

Storage units represent energy storage systems that can both charge (withdraw power) and discharge (inject power) at a bus. Below are all input attributes that you can set for storage unit components.

Basic

AttributeData TypeUnitDefaultRequiredStorage TypeDescription
typestringn/an/aNostaticPlaceholder for storage unit type. Not yet implemented.
carrierstringn/an/aNostaticCarrier type for the storage unit (e.g. battery, hydro, hydrogen); required for global constraints on primary energy in optimization
activebooleann/aTrueNostaticWhether this storage unit is active and should be included in network calculations. Set to False to temporarily disable the storage unit without deleting it.

Capacity

AttributeData TypeUnitDefaultRequiredStorage TypeDescription
p_nomfloatMW0YesstaticThe maximum rated power capacity of the storage unit in MW. This sets the limit for both charging (negative power) and discharging (positive power) in all calculations.
p_nom_modfloatMW0NostaticThe unit size for capacity expansion. When extending the nominal power (p_nom), it can only be increased in multiples of this module size.
p_nom_extendablebooleann/aFalseNostaticSwitch to allow the nominal power (p_nom) to be extended in optimization.
p_nom_minfloatMW0NostaticIf the nominal power (p_nom) is extendable in optimization, set its minimum value.
p_nom_maxfloatMWinfNostaticIf the nominal power (p_nom) is extendable in optimization, set its maximum value (e.g. limited by technical potential).
build_yearintyear0NostaticThe year when the storage unit can be built or commissioned. Essential for multi-year capacity expansion planning models, which determine optimal investment timing and storage unit retirement schedules.
lifetimefloatyearsinfNostaticThe operational lifetime of the storage unit in years. Essential for multi-year capacity expansion planning models, which use this to determine when storage units retire (build year + lifetime). Set to "inf" for storage units that never retire.

Power Limits

AttributeData TypeUnitDefaultRequiredStorage TypeDescription
p_min_pufloatper unit-1Nostatic or timeseriesThe minimum power flow per unit of the nominal power (p_nom). Negative values represent charging (withdrawing power from the bus), positive values represent discharging. Can be static or time-varying.
p_max_pufloatper unit1Nostatic or timeseriesThe maximum power flow per unit of the nominal power (p_nom). Positive values represent discharging (injecting power into the bus), negative values represent charging. Can be static or time-varying.
p_setfloatMW0Nostatic or timeseriesFixed active power output that the storage unit must produce (positive for discharging, negative for charging). Used when the power output is predetermined rather than optimized.
q_setfloatMVar0Nostatic or timeseriesFixed reactive power output that the storage unit must produce. Used when the reactive power output is predetermined rather than optimized.
signfloatn/a1NostaticPower flow direction convention: 1 for generation/discharging (positive power flows into the network), -1 for consumption/charging (positive power flows out of the network).

Energy

AttributeData TypeUnitDefaultRequiredStorage TypeDescription
state_of_charge_initialfloatMWh0NostaticThe state of charge (energy stored) at the beginning of the optimization period, before the first snapshot. Ignored if cyclic_state_of_charge is True.
state_of_charge_initial_per_periodbooleann/aFalseNostaticIf True, the initial state of charge is applied at the beginning of each investment period separately, rather than only at the start of the entire optimization horizon.
state_of_charge_setfloatMWh1Nostatic or timeseriesFixed state of charge values that the storage unit must maintain at specific snapshots. Used when the state of charge is predetermined rather than optimized. Can be static or time-varying.
cyclic_state_of_chargebooleann/aFalseNostaticIf True, the initial state of charge is ignored and the storage unit must end with the same state of charge as it started (cyclic constraint). This ensures the storage unit returns to its initial state at the end of the optimization period.
cyclic_state_of_charge_per_periodbooleann/aTrueNostaticIf True, the cyclic state of charge constraint is applied to each investment period separately, rather than only to the entire optimization horizon.
max_hoursfloathours1NostaticThe maximum energy storage capacity expressed as the number of hours the storage unit can discharge at full nominal power (p_nom). The maximum state of charge in MWh equals max_hours × p_nom.
efficiency_storefloatper unit1Nostatic or timeseriesThe round-trip efficiency for charging (storing energy). A value of 1.0 means no losses, while lower values represent energy losses during charging. Can be time-varying to model temperature-dependent performance.
efficiency_dispatchfloatper unit1Nostatic or timeseriesThe round-trip efficiency for discharging (releasing stored energy). A value of 1.0 means no losses, while lower values represent energy losses during discharging. Can be time-varying to model temperature-dependent performance.
standing_lossfloatper unit0Nostatic or timeseriesThe self-discharge rate per hour, expressed as a fraction of the current state of charge. Represents energy losses that occur even when the storage unit is idle (e.g., battery self-discharge, reservoir evaporation). Can be time-varying.
inflowfloatMW0Nostatic or timeseriesNatural inflow of energy to the state of charge (e.g., river inflow to a hydro reservoir, solar charging for a battery). Positive values increase the stored energy without drawing power from the bus. Can be static or time-varying.

Costs

AttributeData TypeUnitDefaultRequiredStorage TypeDescription
spill_costfloatcurrency/MWh0Nostatic or timeseriesThe cost of spilling 1 MWh of energy that cannot be stored (e.g., water spillage from a hydro reservoir when the reservoir is full).
marginal_costfloatcurrency/MWh0Nostatic or timeseriesThe variable cost of discharging one additional MWh of electricity. Used by the optimizer to determine the economic dispatch order (lower cost storage units are dispatched first).
marginal_cost_quadraticfloatcurrency/MWh²0Nostatic or timeseriesQuadratic term for non-linear cost curves. When set, the total discharge cost includes a quadratic component that increases with the square of discharge power, modeling increasing marginal costs at higher discharge levels.
marginal_cost_storagefloatcurrency/MWh/h0Nostatic or timeseriesThe variable cost of storing 1 MWh of energy for one hour. This represents the opportunity cost or wear-and-tear cost associated with storing energy in the storage unit.
capital_costfloatcurrency/MW0NostaticThe cost per MW of adding new storage capacity. Includes investment costs (spread over the planning period) and fixed operations & maintenance costs. Only relevant when p_nom_extendable is True.

Electrical

AttributeData TypeUnitDefaultRequiredStorage TypeDescription
controlstringn/aPQNostaticPower flow control mode: "PQ" (fixed active and reactive power), "PV" (fixed active power and voltage magnitude), or "Slack" (balances system power, typically one per network).

© Copyright 2025 Bayesian Energy