Migrating from version 3.0 to 4.0
This guide outlines the code updates required to upgrade from PowerSystems.jl version 3.0 to 4.0, which was released in June 2024 and includes breaking changes. These are:
- Renamed Types and Parameters
- New and Eliminated Types
- Updates to Energy Storage Parameters
- Hydropower
statusadded - New Cost Functions
- New Time Series Horizon Format
- Minor Type Hierarchy Change
- (Temporary) Use Version 3.0 for
HybridSystem(+ new parameter)
Renamed Types and Parameters
Some Types and fields were renamed, which should require a trivial search and replace:
Renamed Types:
RenewableFixis now namedRenewableNonDispatchStaticReserveis now namedConstantReserveStaticReserveGroupis now namedConstantReserveGroupStaticReserveNonSpinningis now namedConstantReserveNonSpinningPriorityCurrentLimiteris now namedPriorityOutputCurrentLimiterMagnitudeCurrentLimiteris now namedMagnitudeOutputCurrentLimiterInstantaneousCurrentLimiteris now namedInstantaneousOutputCurrentLimiter
Renamed parameters:
- The
rateparameter is now namedratingfor subtypes ofBranch, for consistency with other Types. Affected Types are:
New and Eliminated Types
In addition to cost-related types detailed in New Cost Functions, these new types have been added:
These types are no longer part of PowerSystems.jl, although there are future plans to rework some of them:
RegulationDeviceTransferBatteryEMSGenericBattery(see Updates to Energy Storage Parameters)
Updates to Energy Storage Parameters
EnergyReservoirStorage is now the default battery and energy storage model, replacing GenericBattery.
There are also changes to the data fields compared to GenericBattery to improve clarity and modeling flexibility.
New data fields:
storage_capacityfor the maximum storage capacity (can be in units of, e.g., MWh for batteries or liters for hydrogen)- Example: 10000.0 for 10,000 liters hydrogen
storage_level_limitsfor the minimum and maximum allowable storage levels on [0, 1], which can be used to model derates or other restrictions, such as state-of-charge restrictions on battery cycling- Example: Minimum of 0.2 and maximum of 1.0 to restrict the storage from dropping below 20% capacity to keep some reserve margin available at all times
initial_storage_capacity_levelfor the initial storage capacity level as a ratio [0, 1.0] ofstorage_capacity- Example: 0.5 to start the storage at 50% full
conversion_factoris the (optional) conversion factor ofstorage_capacityto MWh, if different than 1.0 (i.e., no conversion is needed if thestorage_capacityis in MWh)- Example: 0.0005 for 0.5 kWh/l hydrogen
Removed data fields:
state_of_charge_limitswith units of p.u.-hrinitial_energywith units of p.u.-hr
Hydropower status added
A new required parameter, status, was added to HydroEnergyReservoir and HydroPumpedStorage, for the initial condition of the generator.
- For
HydroEnergyReservoir,statuscan betrue= on orfalse= off. - For
HydroPumpedStorage,statuscan bePumpHydroStatus.PUMP,PumpHydroStatus.GEN, orPumpHydroStatus.OFF
New Cost Functions
New Time Series Horizon Format
The horizon for a forecast has changed from a count of time steps (as an Int) to a duration, as a Dates.Period
Example day-ahead forecast: A forecast with hourly resolution for the next 24 hours, with a new forecast available every 24 hours (i.e., 24-hour interval)
- The horizon is now
Dates.Hour(24)orDates.Day(1) - Previously in version 3.0, the horizon would have been
24for the 24 1-hour time-steps in each forecast
Example hour-ahead forecast: A forecast with 5-minute resolution for the next 1 hour, with a new forecast available every hour (i.e., 1-hour interval)
- The horizon is now
Dates.Hour(1) - Previously in version 3.0, the horizon would have been
12for the 12 5-minute time-steps in each forecast
Minor Type Hierarchy Change
ControllableLoadis now a subtype ofStaticLoadrather thanElectricLoad
The vast majority of users are not expected to be impacted by this change.
(Temporary) Use Version 3.0 for HybridSystem (+ new parameter)
The HybridSystem is currently not supported in the rest of the Sienna ecosystem, such as PowerSimulations.jl. To use HybridSystem in simulation, revert to version 3.0. There are plans to update HybridSystem for version 4.0, but they have not been completed.
In addition, HybridSystem has a new required parameter: interconnection_efficiency