Public API
Formulations
StorageSystemsSimulations.StorageDispatchWithReserves
— TypeFormulation type to add storage formulation than can provide ancillary services. If a storage unit does not contribute to any service, then the variables and constraints related to services are ignored.
Example
DeviceModel(
StorageType, # E.g. EnergyReservoirStorage or GenericStorage
StorageDispatchWithReserves;
attributes=Dict(
"reservation" => true,
"cycling_limits" => false,
"energy_target" => false,
"complete_coverage" => false,
"regularization" => true,
),
use_slacks=false,
)
The formulation supports the following attributes when used in a PowerSimulations.DeviceModel
:
Attributes
"reservation"
: Forces the storage to operate exclusively on charge or discharge mode through the entire operation interval. We recommend setting this tofalse
for models with relatively longer time resolutions (e.g., 1-Hr) since the storage can take simultaneous charge or discharge positions on average over the period."cycling_limits"
: This limits the storage's energy cycling. A single charging (discharging) cycle is fully charging (discharging) the storage once. The calculation uses the total energy charge/discharge and the number of cycles. Currently, the formulation only supports a fixed value per operation period. Additional variables forStorageChargeCyclingSlackVariable
andStorageDischargeCyclingSlackVariable
are included in the model ifuse_slacks
is set totrue
."energy_target"
: Set a target at the end of the model horizon for the storage's state of charge. Currently, the formulation only supports a fixed value per operation period. Additional variables forStorageEnergyShortageVariable
andStorageEnergySurplusVariable
are included in the model ifuse_slacks
is set totrue
.
Combining cycle limits and energy target attributes is not recommended. Both attributes impose constraints on energy. There is no guarantee that the constraints can be satisfied simultaneously.
"complete_coverage"
: This attribute implements constraints that require the battery to cover the sum of all the ancillary services it participates in simultaneously. It is equivalent to holding energy in case all the services get deployed simultaneously. This constraint is added to the constraints that cover each service independently and corresponds to a more conservative operation regime."regularization"
: This attribute smooths the charge/discharge profiles to avoid bang-bang solutions via a penalty on the absolute value of the intra-temporal variations of the charge and discharge power. Solving for optimal storage dispatch can stall in models with large amounts of curtailment or long periods with negative or zero prices due to numerical degeneracy. The regularization term is scaled by the storage device's power limits to normalize the term and avoid additional penalties to larger storage units.
Setting the energy target attribute in combination with EnergyTargetFeedforward
or EnergyLimitFeedforward
is not permitted and StorageSystemsSimulations.jl
will throw an exception.
See the StorageDispatchWithReserves
Mathematical Model for the full mathematical description.
Variables
StorageSystemsSimulations.AncillaryServiceVariableDischarge
— TypeAncillary service fraction assigned to Storage Discharging to product p
Docs abbreviation: $sb^{std}_{p,t}$
StorageSystemsSimulations.AncillaryServiceVariableCharge
— TypeAncillary service fraction assigned to Storage Charging to product p
Docs abbreviation: $sb^{stc}_{p,t}$
StorageSystemsSimulations.StorageEnergyShortageVariable
— TypeSlack variable for energy storage levels < target storage levels
Docs abbreviation: $e^{st-}$
StorageSystemsSimulations.StorageEnergySurplusVariable
— TypeSlack variable for energy storage levels > target storage levels
Docs abbreviation: $e^{st+}$
StorageSystemsSimulations.StorageChargeCyclingSlackVariable
— TypeSlack variable for the cycling limits to allow for more charging usage than the allowed limited
Docs nomenclature: $c^{ch-}$
StorageSystemsSimulations.StorageDischargeCyclingSlackVariable
— TypeSlack variable for the cycling limits to allow for more discharging usage than the allowed limited
Docs nomenclature: $c^{ds-}$
StorageSystemsSimulations.StorageRegularizationVariableCharge
— TypeSlack variable for energy storage levels > target storage levels
Docs nomenclature: $z^{st, ch}$
StorageSystemsSimulations.StorageRegularizationVariableDischarge
— TypeSlack variable for energy storage levels > target storage levels
Docs abbreviation: $z^{st, ds}$
Auxiliary Variables
StorageSystemsSimulations.StorageEnergyOutput
— TypeAuxiliary Variable for Storage Models that solve for total energy output
Constraints
StorageSystemsSimulations.StateofChargeLimitsConstraint
— TypeStruct to create the state of charge constraint limits.
The specified constraint is formulated as:
\[E_{st}^{min} \le e^{st}_{t} \le E_{st}^{max}, \quad \forall t \in \{1,\dots, T\}\]
StorageSystemsSimulations.StorageCyclingCharge
— TypeStruct to create the storage cycling limits for the charge variable. Used when cycling_limits = true
.
The specified constraint is formulated as:
\[\sum_{t \in \mathcal{T}} \left(\sum_{p \in \mathcal{P}^{\text{as}_\text{dn}}} R^*_{p,t} sb_{stc,p,t} + p^{st,ch}_{t} \right)\eta^{ch}_{st} \Delta t - c^{ch-} \leq C_{st} E^{max}_{st}\]
StorageSystemsSimulations.StorageCyclingDischarge
— TypeStruct to create the storage cycling limits for the discharge variable. Used when cycling_limits = true
.
The specified constraint is formulated as:
\[\sum_{t \in \mathcal{T}} \left(\sum_{p \in \mathcal{P}^{\text{as}_\text{up}}} R^*_{p,t} sb_{std,p,t} + p^{st,ds}_{t}\right)\frac{1}{\eta^{ds}_{st}} \Delta t - c^{ds-} \leq C_{st} E^{max}_{st}\]
StorageSystemsSimulations.ReserveCoverageConstraint
— TypeStruct to specify the individual product ancillary service coverage at the beginning of the period for charge and discharge variables.
The specified constraints are formulated as:
\[\begin{align*} & sb_{stc,p,1} \eta^{ch}_{st} N_{p} \Delta t \le E_{st}^{max} - e^{st}_0, \quad \forall p \in \mathcal{P}^{as_{dn}} \\ & sb_{stc,p,t} \eta^{ch}_{st} N_{p} \Delta t \le E_{st}^{max} - e^{st}_{t-1}, \quad \forall p \in \mathcal{P}^{as_{dn}}, \forall t \in \{2,\dots, T\} \\ & sb_{std,p,1} \frac{1}{\eta^{ds}_{st}} N_{p} \Delta t \leq e^{st}_0 - E^{min}_{st}, \quad \forall p \in \mathcal{P}^{as_{up}} \\ & sb_{std,p,t} \frac{1}{\eta^{ds}_{st}} N_{p} \Delta t \leq e^{st}_{t-1} - E^{min}_{st}, \quad \forall p \in \mathcal{P}^{as_{up}}, \forall t \in \{2,\dots, T\} \end{align*}\]
StorageSystemsSimulations.ReserveCoverageConstraintEndOfPeriod
— TypeStruct to specify the individual product ancillary service coverage at the end of the period for charge and discharge variables.
The specified constraints are formulated as:
\[\begin{align*} & sb_{stc,p,t} \eta^{ch}_{st} N_{p} \Delta t \le E_{st}^{max} - e^{st}_{t}, \quad \forall p \in \mathcal{P}^{as_{dn}}, \forall t \in \{1,\dots, T\} \\ & sb_{std,p,t} \frac{1}{\eta^{ds}_{st}} N_{p} \Delta t \leq e^{st}_{t}- E^{min}_{st}, \quad \forall p \in \mathcal{P}^{as_{up}}, \forall t \in \{1,\dots, T\} \end{align*}\]
StorageSystemsSimulations.ReserveCompleteCoverageConstraint
— TypeStruct to specify all products ancillary service coverage at the beginning of the period for charge and discharge variables. Used when the attribute complete_coverage = true
.
The specified constraints are formulated as:
\[\begin{align*} & \sum_{p \in \mathcal{P}^{\text{as}_\text{dn}}} sb_{stc,p,1} \eta^{ch}_{st} N_{p} \Delta t \le E_{st}^{max} - e^{st}_0 \\ & \sum_{p \in \mathcal{P}^{\text{as}_\text{dn}}} sb_{stc,p,t} \eta^{ch}_{st} N_{p} \Delta t \le E_{st}^{max} - e^{st}_{t-1}, \quad \forall t \in \{2,\dots, T\} \\ & \sum_{p \in \mathcal{P}^{\text{as}_\text{up}}} sb_{std,p,1} \frac{1}{\eta^{ds}_{st}} N_{p} \Delta t \leq e^{st}_0 - E^{min}_{st} \\ & \sum_{p \in \mathcal{P}^{\text{as}_\text{up}}} sb_{std,p,t} \frac{1}{\eta^{ds}_{st}} N_{p} \Delta t \leq e^{st}_{t-1}- E^{min}_{st}, \quad \forall t \in \{2,\dots, T\} \end{align*}\]
StorageSystemsSimulations.ReserveCompleteCoverageConstraintEndOfPeriod
— TypeStruct to specify all products ancillary service coverage at the end of the period for charge and discharge variables. Used when the attribute complete_coverage = true
.
The specified constraints are formulated as:
\[\begin{align*} & \sum_{p \in \mathcal{P}^{\text{as}_\text{dn}}} sb_{stc,p,t} \eta^{ch}_{st} N_{p} \Delta t \le E_{st}^{max} - e^{st}_{t}, \quad \forall t \in \{1,\dots, T\} \\ & \sum_{p \in \mathcal{P}^{\text{as}_\text{up}}} sb_{std,p,t} \frac{1}{\eta^{ds}_{st}} N_{p} \Delta t \leq e^{st}_{t}- E^{min}_{st}, \quad \forall t \in \{1,\dots, T\} \end{align*}\]
StorageSystemsSimulations.StorageTotalReserveConstraint
— TypeStruct to specify an auxiliary constraint for adding charge and discharge into a single active power reserve variable.
The specified constraint is formulated as:
\[sb_{stc, p, t} + sb_{std, p, t} = r_{p,t}, \quad \forall p \in \mathcal{P}, \forall t \in \{1,\dots, T\}\]
StorageSystemsSimulations.ReserveDischargeConstraint
— TypeStruct to specify the lower and upper bounds of the discharge variable considering reserves.
The specified constraints are formulated as:
\[\begin{align*} & p^{st, ds}_{t} + \sum_{p \in \mathcal{P}^{\text{as}_\text{up}}} sb_{std,p,t} \leq \text{ss}^{st}_{t}P^{max,ds}_{st} \quad \forall t \in \{1,\dots, T\} \\ & p^{st, ds}_{t} - \sum_{p \in \mathcal{P}^{ ext{as}_\text{dn}}} sb_{std,p,t} \geq 0, \quad \forall t \in \{1,\dots, T\} \end{align*}\]
StorageSystemsSimulations.ReserveChargeConstraint
— TypeStruct to specify the lower and upper bounds of the charge variable considering reserves.
The specified constraints are formulated as:
\[\begin{align*} &p^{st, ch}_{t} + \sum_{p \in \mathcal{P}^{\text{as}_\text{dn}}} sb_{stc,p,t} \leq (1 - \text{ss}^{st}_{t})P^{max,ch}_{st}, \quad \forall t \in \{1,\dots, T\} \\ & p^{st, ch}_{t} - \sum_{p \in \mathcal{P}^{\text{as}_\text{up}}} sb_{stc,p,t} \geq 0, \quad \forall t \in \{1,\dots, T\} \end{align*}\]
Parameters
StorageSystemsSimulations.EnergyLimitParameter
— TypeParameter to define energy limit
FeedForwards
StorageSystemsSimulations.EnergyTargetFeedforward
— TypeAdds a constraint to enforce a minimum energy level target with a slack variable associated witha penalty term.
StorageSystemsSimulations.EnergyLimitFeedforward
— TypeAdds a constraint to limit the sum of a variable over the number of periods to the source value