PRASCore API reference
Systems
PRASCore.Systems.SystemModel
— TypeSystemModel{N, L, T<:Period, P<:PowerUnit, E<:EnergyUnit}
A SystemModel struct contains a representation of a power system to be studied with PRAS. See system specifications for more details on components of a system model.
Type Parameters
N
: Number of timesteps in the system modelL
: Length of each timestep in T unitsT
: Time period type (e.g.,Hour
,Minute
)P
: Power unit type (e.g.,MW
,GW
)E
: Energy unit type (e.g.,MWh
,GWh
)
Fields
regions
: Representation of system regions (Type - Regions)interfaces
: Information about connections between regions (Type - Interfaces)generators
: Collection of system generators (Type - Generators)region_gen_idxs
: Mapping of generators to their respective regionsstorages
: Collection of system storages (Type - Storages)region_stor_idxs
: Mapping of storage resources to their respective regionsgeneratorstorages
: Collection of system generation-storages (Type - GeneratorStorages)region_genstor_idxs
: Mapping of hybrid resources to their respective regionslines
: Collection of transmission lines connecting regions (Type - Lines)interface_line_idxs
: Mapping of transmission lines to interfacestimestamps
: Time range for the simulation periodattrs
: Dictionary of system metadata and attributes
Constructors
SystemModel(regions, interfaces, generators, region_gen_idxs, storages, region_stor_idxs,
generatorstorages, region_genstor_idxs, lines, interface_line_idxs,
timestamps, [attrs])
Create a system model with all components specified.
SystemModel(generators, storages, generatorstorages, timestamps, load, [attrs])
Create a single-node system model with specified generators, storage, and load profile.
SystemModel(regions, interfaces, generators, region_gen_idxs, storages, region_stor_idxs,
generatorstorages, region_genstor_idxs, lines, interface_line_idxs,
timestamps::StepRange{DateTime}, [attrs])
Create a system model with DateTime
timestamps (will be converted to UTC time zone).
PRASCore.Systems.Regions
— TypeRegions{N,P<:PowerUnit}
A struct representing regions within a power system.
Type Parameters
N
: Number of timesteps in the system modelP
: The power unit used for demand measurements, subtype ofPowerUnit
Fields
names
: Name of region (unique)load
: Aggregated electricity demand in each region for each timeperiod, inpower_units
(P
)
PRASCore.Systems.Generators
— TypeGenerators{N,L,T<:Period,P<:PowerUnit}
A struct representing generating assets within a power system.
Type Parameters
N
: Number of timesteps in the system modelL
: Length of each timestep in T unitsT
: The time period type used for temporal representation, subtype ofPeriod
P
: The power unit used for capacity measurements, subtype ofPowerUnit
Fields
names
: Name of generatorcategories
: Category of generatorcapacity
: Maximum available generation capacity in each timeperiod, expressed in units given by thepower_units
(P
) type parameterλ
(failure probability): probability the generator transitions from operational to forced outage during a given simulation timestep (unitless)μ
(repair probability): probability the generator transitions from forced outage to operational during a given simulation timestep (unitless)
PRASCore.Systems.Storages
— TypeStorages{N,L,T<:Period,P<:PowerUnit,E<:EnergyUnit}
A struct representing storage devices in the system.
Type Parameters
N
: Number of timesteps in the system modelL
: Length of each timestep in T unitsT
: The time period type used for temporal representation, subtype ofPeriod
P
: The power unit used for capacity measurements, subtype ofPowerUnit
E
: The energy unit used for energy storage, subtype ofEnergyUnit
Fields
names
: Name of storage devicecategories
: Category of storage devicecharge_capacity
: Maximum available charging capacity for each storage unit in each timeperiod, expressed in units given by thepower_units
(P
) type parameterdischarge_capacity
: Maximum available discharging capacity for each storage unit in each timeperiod, expressed in units given by thepower_units
(P
) type parameterenergy_capacity
: Maximum available energy storage capacity for each storage unit in each timeperiod, expressed in units given by theenergy_units
(E
) type parametercharge_efficiency
: Ratio of power injected into the storage device's reservoir to power withdrawn from the grid, for each storage unit in each timeperiod. Unitless.discharge_efficiency
: Ratio of power injected into the grid to power withdrawn from the storage device's reservoir, for each storage unit in each timeperiod. Unitless.carryover_efficiency
: Ratio of energy available in the storage device's reservoir at the beginning of one period to energy retained at the end of the previous period, for each storage unit in each timeperiod. Unitless.λ
(failure probability): Probability the unit transitions from operational to forced outage during a given simulation timestep, for each storage unit in each timeperiod. Unitless.μ
(repair probability): Probability the unit transitions from forced outage to operational during a given simulation timestep, for each storage unit in each timeperiod. Unitless.
PRASCore.Systems.GeneratorStorages
— TypeGeneratorStorages{N,L,T<:Period,P<:PowerUnit,E<:EnergyUnit}
A struct representing generator-storage hybrid devices within a power system.
Type Parameters
N
: Number of timesteps in the system modelL
: Length of each timestep in T unitsT
: The time period type used for temporal representation, subtype ofPeriod
P
: The power unit used for capacity measurements, subtype ofPowerUnit
E
: The energy unit used for energy storage, subtype ofEnergyUnit
Fields
names
: Name of generator-storage unitcategories
: Category of generator-storage unitcharge_capacity
: Maximum available charging capacity for each generator-storage unit in each timeperiod, inpower_units
(P
)discharge_capacity
: Maximum available discharging capacity for each generator-storage unit in each timeperiod, inpower_units
(P
)energy_capacity
: Maximum available energy storage capacity for each generator-storage unit in each timeperiod, inenergy_units
(E
)charge_efficiency
: Ratio of power injected into the device's reservoir to power withdrawn from the grid, for each generator-storage unit in each timeperiod. Unitless.discharge_efficiency
: Ratio of power injected into the grid to power withdrawn from the device's reservoir, for each generator-storage unit in each timeperiod. Unitless.carryover_efficiency
: Ratio of energy available in the device's reservoir at the beginning of one period to energy retained at the end of the previous period, for each generator-storage unit in each timeperiod. Unitless.inflow
: Exogenous power inflow available to each generator-storage unit in each timeperiod, inpower_units
(P
)gridwithdrawal_capacity
: Maximum available capacity to withdraw power from the grid for each generator-storage unit in each timeperiod, inpower_units
(P
)gridinjection_capacity
: Maximum available capacity to inject power to the grid for each generator-storage unit in each timeperiod, inpower_units
(P
)λ
(failure probability): Probability the unit transitions from operational to forced outage during a given simulation timestep, for each generator-storage unit in each timeperiod. Unitless.μ
(repair probability): Probability the unit transitions from forced outage to operational during a given simulation timestep, for each generator-storage unit in each timeperiod. Unitless.
PRASCore.Systems.Lines
— TypeLines{N,L,T<:Period,P<:PowerUnit}
A struct representing individual transmission lines between regions in a power system.
Type Parameters
N
: Number of timesteps in the system modelL
: Length of each timestep in T unitsT
: The time period type used for temporal representation, subtype ofPeriod
P
: The power unit used for capacity measurements, subtype ofPowerUnit
Fields
names
: Name of linecategories
: Category of lineforward_capacity
: Maximum available power transfer capacity fromregion_from
toregion_to
along the line, for each line in each timeperiod, inpower_units
(P
)backward_capacity
: Maximum available power transfer capacity fromregion_to
toregion_from
along the line, for each line in each timeperiod, inpower_units
(P
)λ
(failure probability): Probability the line transitions from operational to forced outage during a given simulation timestep, for each line in each timeperiod. Unitless.μ
(repair probability): Probability the line transitions from forced outage to operational during a given simulation timestep, for each line in each timeperiod. Unitless.
PRASCore.Systems.Interfaces
— TypeInterfaces{N,P<:PowerUnit}
A struct representing transmission interfaces between regions in a power system.
Type Parameters
N
: Number of timesteps in the system modelP
: The power unit used for interface limits, subtype ofPowerUnit
Fields
regions_from
: Index of the first region connected by the interfaceregions_to
: Index of the second region connected by the interfacelimit_forward
: Maximum possible total power transfer fromregions_from
toregions_to
, for each interface in each timeperiod, inpower_units
(P
)limit_backward
: Maximum possible total power transfer fromregions_to
toregions_from
, for each interface in each timeperiod, inpower_units
(P
)
Simulations
PRASCore.Simulations.assess
— Methodassess(system::SystemModel, method::SequentialMonteCarlo, resultspecs::ResultSpec...)
Run a Sequential Monte Carlo simulation on a system
using the method
data and return resultspecs
.
Arguments
system::SystemModel
: PRAS data structuremethod::SequentialMonteCarlo
: method for PRAS analysisresultspecs::ResultSpec...
: PRAS metric for metrics likeShortfall
missing generation
Returns
results::Tuple{Vararg{ResultAccumulator{SequentialMonteCarlo}}}
: PRAS metric results
PRASCore.Simulations.DispatchProblem
— TypeDispatchProblem(sys::SystemModel)
Create a min-cost flow problem for the multi-region max power delivery problem with generation and storage discharging in decreasing order of priority, and storage charging with excess capacity. Storage and GeneratorStorage devices within a region are represented individually on the network.
This involves injections/withdrawals at one node (regional capacity surplus/shortfall) for each modelled region, as well as two/three nodes associated with each Storage/GeneratorStorage device, and a supplementary "slack" node in the network that can absorb undispatched power or pass unserved energy or unused charging capability through to satisfy power balance constraints.
Flows from the generation nodes are free, while flows to charging and from discharging nodes are costed or rewarded according to the time-to-discharge of the storage device, ensuring efficient coordination across units, while enforcing that storage is only discharged once generation capacity is exhausted (implying an operational strategy that prioritizes resource adequacy over economic arbitrage). This is based on the storage dispatch strategy of Evans, Tindemans, and Angeli, as outlined in "Minimizing Unserved Energy Using Heterogenous Storage Units" (IEEE Transactions on Power Systems, 2019).
Flows to the charging node have an attenuated negative cost (reward), incentivizing immediate storage charging if generation and transmission allows it, while avoiding charging by discharging other storage (since that would incur an overall positive cost).
Flows to the slack node (representing unused generation or storage discharge capacity) are free, but flows from the slack node to serve load incur the lost load penalty of 9999. Flows from the slack node in lieu of storage charging or discharging are free.
Flows on transmission interfaces assume a hurdle rate of 1 to keep unserved energy close to the source of the shortage and eliminate loop flows. This has the side-effect of disincentivising wheeling power across multiple regions for charging purposes, however.
Nodes in the problem are ordered as:
- Regions generation surplus/shortfall (Regions order)
- Storage discharge capacity (Storage order)
- Storage charge capacity (Storage order)
- GenerationStorage inflow capacity (GeneratorStorage order)
- GenerationStorage discharge capacity (GeneratorStorage order)
- GenerationStorage grid injection (GeneratorStorage order)
- GenerationStorage charge capacity (GeneratorStorage order)
- Slack node
Edges are ordered as:
- Regions demand unserved (Regions order)
- Regions generation unused (Regions order)
- Interfaces forward flow (Interfaces order)
- Interfaces reverse flow (Interfaces order)
- Storage discharge to grid (Storage order)
- Storage discharge unused (Storage order)
- Storage charge from grid (Storage order)
- Storage charge unused (Storage order)
- GenerationStorage discharge to grid (GeneratorStorage order)
- GenerationStorage discharge unused (GeneratorStorage order)
- GenerationStorage inflow to grid (GenerationStorage order)
- GenerationStorage total to grid (GeneratorStorage order)
- GenerationStorage charge from grid (GeneratorStorage order)
- GenerationStorage charge from inflow (GeneratorStorage order)
- GenerationStorage charge unused (GeneratorStorage order)
- GenerationStorage inflow unused (GeneratorStorage order)
PRASCore.Simulations.SequentialMonteCarlo
— TypeSequentialMonteCarlo(;
samples::Int=10_000,
seed::Integer=rand(UInt64),
verbose::Bool=false,
threaded::Bool=true
)
Sequential Monte Carlo simulation parameters for PRAS analysis
It it recommended that you fix the random seed for reproducibility.
Arguments
samples::Int=10_000
: Number of samplesseed::Integer=rand(UInt64)
: Random seedverbose::Bool=false
: Print progressthreaded::Bool=true
: Use multi-threading
Returns
SequentialMonteCarlo
: PRAS simulation specification
Results
PRASCore.Results.LOLE
— TypeLOLE
LOLE
reports loss of load expectation over a particular time period and regional extent. When the reporting period is a single simulation timestep, the metric is equivalent to loss of load probability (LOLP).
Contains both the estimated value itself as well as the standard error of that estimate, which can be extracted with val
and stderror
, respectively.
PRASCore.Results.EUE
— TypeEUE
EUE
reports expected unserved energy over a particular time period and regional extent.
Contains both the estimated value itself as well as the standard error of that estimate, which can be extracted with val
and stderror
, respectively.
PRASCore.Results.NEUE
— TypeNEUE
NEUE
reports normalized expected unserved energy over a regional extent.
Contains both the estimated value itself as well as the standard error of that estimate, which can be extracted with val
and stderror
, respectively.
PRASCore.Results.Shortfall
— TypeShortfall
The Shortfall
result specification reports expectation-based resource adequacy risk metrics such as EUE and LOLE, producing a ShortfallResult
.
A ShortfallResult
can be directly indexed by a region name and a timestamp to retrieve a tuple of sample mean and standard deviation, estimating the average unserved energy in that region and timestep. However, in most cases it's simpler to use EUE
and LOLE
constructors to directly retrieve standard risk metrics.
Example:
shortfall, =
assess(sys, SequentialMonteCarlo(samples=1000), Shortfall())
period = ZonedDateTime(2020, 1, 1, 0, tz"UTC")
# Unserved energy mean and standard deviation
sf_mean, sf_std = shortfall["Region A", period]
# System-wide risk metrics
eue = EUE(shortfall)
lole = LOLE(shortfall)
neue = NEUE(shorfall)
# Regional risk metrics
regional_eue = EUE(shortfall, "Region A")
regional_lole = LOLE(shortfall, "Region A")
regional_neue = NEUE(shortfall, "Region A")
# Period-specific risk metrics
period_eue = EUE(shortfall, period)
period_lolp = LOLE(shortfall, period)
# Region- and period-specific risk metrics
period_eue = EUE(shortfall, "Region A", period)
period_lolp = LOLE(shortfall, "Region A", period)
See ShortfallSamples
for recording sample-level shortfall results.
PRASCore.Results.ShortfallSamples
— TypeShortfallSamples
The ShortfallSamples
result specification reports sample-level unserved energy outcomes, producing a ShortfallSamplesResult
.
A ShortfallSamplesResult
can be directly indexed by a region name and a timestamp to retrieve a vector of sample-level unserved energy results in that region and timestep. EUE
and LOLE
constructors can also be used to retrieve standard risk metrics.
Example:
shortfall, =
assess(sys, SequentialMonteCarlo(samples=10), ShortfallSamples())
period = ZonedDateTime(2020, 1, 1, 0, tz"UTC")
samples = shortfall["Region A", period]
@assert samples isa Vector{Float64}
@assert length(samples) == 10
# System-wide risk metrics
eue = EUE(shortfall)
lole = LOLE(shortfall)
neue = NEUE(shortfall)
# Regional risk metrics
regional_eue = EUE(shortfall, "Region A")
regional_lole = LOLE(shortfall, "Region A")
regional_neue = NEUE(shortfall, "Region A")
# Period-specific risk metrics
period_eue = EUE(shortfall, period)
period_lolp = LOLE(shortfall, period)
# Region- and period-specific risk metrics
period_eue = EUE(shortfall, "Region A", period)
period_lolp = LOLE(shortfall, "Region A", period)
Note that this result specification requires large amounts of memory for larger sample sizes. See Shortfall
for average shortfall outcomes when sample-level granularity isn't required.
PRASCore.Results.Surplus
— TypeSurplus
The Surplus
result specification reports unused generation and storage discharge capability of Regions
, producing a SurplusResult
.
A SurplusResult
can be indexed by region name and timestamp to retrieve a tuple of sample mean and standard deviation, estimating the average unused capacity in that region and timestep.
Example:
surplus, =
assess(sys, SequentialMonteCarlo(samples=1000), Surplus())
surplus_mean, surplus_std =
surplus["Region A", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
See SurplusSamples
for sample-level surplus results.
PRASCore.Results.SurplusSamples
— TypeSurplusSamples
The SurplusSamples
result specification reports sample-level unused generation and storage discharge capability of Regions
, producing a SurplusSamplesResult
.
A SurplusSamplesResult
can be indexed by region name and timestamp to retrieve a vector of sample-level surplus values in that region and timestep.
Example:
surplus, =
assess(sys, SequentialMonteCarlo(samples=10), SurplusSamples())
samples = surplus["Region A", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
@assert samples isa Vector{Float64}
@assert length(samples) == 10
Note that this result specification requires large amounts of memory for larger sample sizes. See Surplus
for estimated average surplus values when sample-level granularity isn't required.
PRASCore.Results.Flow
— TypeFlow
The Flow
result specification reports the estimated average flow across transmission Interfaces
, producing a FlowResult
.
A FlowResult
can be indexed by a directional Pair
of region names and a timestamp to retrieve a tuple of sample mean and standard deviation, estimating the average net flow magnitude and direction relative to the given directed interface in that timestep. For a query of "Region A" => "Region B"
, if estimated average flow was from A to B, the reported value would be positive, while if average flow was in the reverse direction, from B to A, the value would be negative.
Example:
flows, =
assess(sys, SequentialMonteCarlo(samples=1000), Flow())
flow_mean, flow_std =
flows["Region A" => "Region B", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
flow2_mean, flow2_std =
flows["Region B" => "Region A", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
@assert flow_mean == -flow2_mean
See FlowSamples
for sample-level flow results.
PRASCore.Results.FlowSamples
— TypeFlowSamples
The FlowSamples
result specification reports the sample-level magnitude and direction of power flows across Interfaces
, producing a FlowSamplesResult
.
A FlowSamplesResult
can be indexed by a directional Pair
of region names and a timestamp to retrieve a vector of sample-level net flow magnitudes and directions relative to the given directed interface in that timestep. For a query of "Region A" => "Region B"
, if flow in one sample was from A to B, the reported value would be positive, while if flow was in the reverse direction, from B to A, the value would be negative.
Example:
flows, =
assess(sys, SequentialMonteCarlo(samples=10), FlowSamples())
samples = flows["Region A" => "Region B", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
@assert samples isa Vector{Float64}
@assert length(samples) == 10
samples2 = flows["Region B" => "Region A", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
@assert samples == -samples2
Note that this result specification requires large amounts of memory for larger sample sizes. See Flow
for estimated average flow results when sample-level granularity isn't required.
PRASCore.Results.Utilization
— TypeUtilization
The Utilization
result specification reports the estimated average absolute utilization of Interfaces
, producing a UtilizationResult
.
Whereas Flow
reports the average directional power transfer across an interface, Utilization
reports the absolute value of flow relative to the interface's transfer capability (counting the effects of line outages). For example, a symmetrically-constrained interface which is fully congested with max power flowing in one direction in half of the samples, and the other direction in the remaining samples, would have an average flow of 0 MW, but an average utilization of 100%.
A UtilizationResult
can be indexed by a Pair
of region names and a timestamp to retrieve a tuple of sample mean and standard deviation, estimating the average utilization of the interface. Given the absolute value nature of the outcome, results are independent of direction. Querying "Region A" => "Region B"
will yield the same result as "Region B" => "Region A"
.
Example:
utils, =
assess(sys, SequentialMonteCarlo(samples=1000), Utilization())
util_mean, util_std =
utils["Region A" => "Region B", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
util2_mean, util2_std =
utils["Region B" => "Region A", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
@assert util_mean == util2_mean
See UtilizationSamples
for sample-level utilization results.
PRASCore.Results.UtilizationSamples
— TypeUtilizationSamples
The UtilizationSamples
result specification reports the sample-level absolute utilization of Interfaces
, producing a UtilizationSamplesResult
.
Whereas FlowSamples
reports the directional power transfer across an interface, UtilizationSamples
reports the absolute value of flow relative to the interface's transfer capability (counting the effects of line outages). For example, a 100 MW symmetrically-constrained interface which is fully congested may have a flow of +100 or -100 MW, but in both cases the utilization will be 100%. If a 50 MW line in the interface went on outage, flow may drop to +50 or -50 MW, but utilization would remain at 100%.
A UtilizationSamplesResult
can be indexed by a Pair
of region names and a timestamp to retrieve a vector of sample-level utilizations of the interface in that timestep. Given the absolute value nature of the outcome, results are independent of direction. Querying "Region A" => "Region B"
will yield the same result as "Region B" => "Region A"
.
Example:
utils, =
assess(sys, SequentialMonteCarlo(samples=10), UtilizationSamples())
samples =
utils["Region A" => "Region B", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
@assert samples isa Vector{Float64}
@assert length(samples) == 10
samples2 =
utils["Region B" => "Region A", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
@assert samples == samples2
Note that this result specification requires large amounts of memory for larger sample sizes. See Utilization
for sample-averaged utilization results when sample-level granularity isn't required.
PRASCore.Results.GeneratorAvailability
— TypeGeneratorAvailability
The GeneratorAvailability
result specification reports the sample-level discrete availability of Generators
, producing a GeneratorAvailabilityResult
.
A GeneratorAvailabilityResult
can be indexed by generator name and timestamp to retrieve a vector of sample-level availability states for the unit in the given timestep. States are provided as a boolean with true
indicating that the unit is available and false
indicating that it's unavailable.
Example:
genavail, =
assess(sys, SequentialMonteCarlo(samples=10), GeneratorAvailability())
samples = genavail["MyGenerator123", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
@assert samples isa Vector{Bool}
@assert length(samples) == 10
PRASCore.Results.GeneratorStorageAvailability
— TypeGeneratorStorageAvailability
The GeneratorStorageAvailability
result specification reports the sample-level discrete availability of GeneratorStorages
, producing a GeneratorStorageAvailabilityResult
.
A GeneratorStorageAvailabilityResult
can be indexed by generator-storage name and timestamp to retrieve a vector of sample-level availability states for the unit in the given timestep. States are provided as a boolean with true
indicating that the unit is available and false
indicating that it's unavailable.
Example:
genstoravail, =
assess(sys, SequentialMonteCarlo(samples=10), GeneratorStorageAvailability())
samples = genstoravail["MyGenerator123", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
@assert samples isa Vector{Bool}
@assert length(samples) == 10
PRASCore.Results.GeneratorStorageEnergy
— TypeGeneratorStorageEnergy
The GeneratorStorageEnergy
result specification reports the average state of charge of GeneratorStorages
, producing a GeneratorStorageEnergyResult
.
A GeneratorStorageEnergyResult
can be indexed by generator-storage device name and a timestamp to retrieve a tuple of sample mean and standard deviation, estimating the average energy level for the given generator-storage device in that timestep.
Example:
genstorenergy, =
assess(sys, SequentialMonteCarlo(samples=1000), GeneratorStorageEnergy())
soc_mean, soc_std =
genstorenergy["MyGeneratorStorage123", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
See GeneratorStorageEnergySamples
for sample-level generator-storage states of charge.
See StorageEnergy
for average storage states of charge.
PRASCore.Results.GeneratorStorageEnergySamples
— TypeGeneratorStorageEnergySamples
The GeneratorStorageEnergySamples
result specification reports the sample-level state of charge of GeneratorStorages
, producing a GeneratorStorageEnergySamplesResult
.
A GeneratorStorageEnergySamplesResult
can be indexed by generator-storage device name and a timestamp to retrieve a vector of sample-level charge states for the device in the given timestep.
Example:
genstorenergy, =
assess(sys, SequentialMonteCarlo(samples=10), GeneratorStorageEnergySamples())
samples = genstorenergy["MyGeneratorStorage123", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
@assert samples isa Vector{Float64}
@assert length(samples) == 10
Note that this result specification requires large amounts of memory for larger sample sizes. See GeneratorStorageEnergy
for estimated average generator-storage state of charge when sample-level granularity isn't required.
PRASCore.Results.StorageAvailability
— TypeStorageAvailability
The StorageAvailability
result specification reports the sample-level discrete availability of Storages
, producing a StorageAvailabilityResult
.
A StorageAvailabilityResult
can be indexed by storage device name and a timestamp to retrieve a vector of sample-level availability states for the unit in the given timestep. States are provided as a boolean with true
indicating that the unit is available and false
indicating that it's unavailable.
Example:
storavail, =
assess(sys, SequentialMonteCarlo(samples=10), StorageAvailability())
samples = storavail["MyStorage123", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
@assert samples isa Vector{Bool}
@assert length(samples) == 10
PRASCore.Results.StorageEnergy
— TypeStorageEnergy
The StorageEnergy
result specification reports the average state of charge of Storages
, producing a StorageEnergyResult
.
A StorageEnergyResult
can be indexed by storage device name and a timestamp to retrieve a tuple of sample mean and standard deviation, estimating the average energy level for the given storage device in that timestep.
Example:
storenergy, =
assess(sys, SequentialMonteCarlo(samples=1000), StorageEnergy())
soc_mean, soc_std =
storenergy["MyStorage123", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
See StorageEnergySamples
for sample-level storage states of charge.
See GeneratorStorageEnergy
for average generator-storage states of charge.
PRASCore.Results.StorageEnergySamples
— TypeStorageEnergySamples
The StorageEnergySamples
result specification reports the sample-level state of charge of Storages
, producing a StorageEnergySamplesResult
.
A StorageEnergySamplesResult
can be indexed by storage device name and a timestamp to retrieve a vector of sample-level charge states for the device in the given timestep.
Example:
storenergy, =
assess(sys, SequentialMonteCarlo(samples=10), StorageEnergySamples())
samples = storenergy["MyStorage123", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
@assert samples isa Vector{Float64}
@assert length(samples) == 10
Note that this result specification requires large amounts of memory for larger sample sizes. See StorageEnergy
for estimated average storage state of charge when sample-level granularity isn't required.
PRASCore.Results.LineAvailability
— TypeLineAvailability
The LineAvailability
result specification reports the sample-level discrete availability of Lines
, producing a LineAvailabilityResult
.
A LineAvailabilityResult
can be indexed by line name and timestamp to retrieve a vector of sample-level availability states for the unit in the given timestep. States are provided as a boolean with true
indicating that the unit is available and false
indicating that it's unavailable.
Example:
lineavail, =
assess(sys, SequentialMonteCarlo(samples=10), LineAvailability())
samples = lineavail["MyLine123", ZonedDateTime(2020, 1, 1, 0, tz"UTC")]
@assert samples isa Vector{Bool}
@assert length(samples) == 10