From c8e8d0df83a227ac470c20854f1aff74e7436c05 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Fri, 20 Dec 2024 21:58:17 +0000 Subject: [PATCH] build based on eeced9c --- dev/api/internal/index.html | 12 +-- dev/api/public/index.html | 154 ++++++++++++++++++++++++++-- dev/index.html | 2 +- dev/search/index.html | 2 +- dev/search_index.js | 2 +- dev/tutorials/intro_page/index.html | 2 +- 6 files changed, 149 insertions(+), 25 deletions(-) diff --git a/dev/api/internal/index.html b/dev/api/internal/index.html index 21b50d3..aae0de2 100644 --- a/dev/api/internal/index.html +++ b/dev/api/internal/index.html @@ -1,11 +1,3 @@ -Internal API Reference · SiennaPRASInterface.jl

Internal API

SiennaPRASInterface.get_sorted_linesMethod
get_sorted_lines(lines::Vector{PSY.Branch}, region_names::Vector{String})

Get sorted lines, interface region indices, and interface line indices.

Arguments

  • lines::Vector{PSY.Branch}: Lines
  • region_names::Vector{String}: Region names

Returns

  • sorted_lines::Vector{PSY.Branch}: Sorted lines
  • interface_reg_idxs::Vector{Tuple{Int, Int}}: Interface region indices
  • interface_line_idxs::Vector{UnitRange{Int}}: Interface line indices
source
SiennaPRASInterface.get_timestampsMethod
get_timestamps(initial_time, resolution, steps, horizon)

Return a vector of timestamps starting from initial_time with resolution and steps for horizon steps

source
SiennaPRASInterface.initialize_availability!Method

initializeavailability!(rng, availability, nexttransition, devices, tlast)

Arguments

  • rng::Random.AbstractRNG: Random number generator
  • availability::Vector{Bool}: Vector of availability status
  • nexttransition::Vector{Int}: Vector of next transition time
  • devices::Vector{PSY.Generator}: Vector of devices with outage SupplementalAttributes
  • t_last::Int: Last time step

Returns

Modifies input arguments and rereturns

  • availability::Vector{Bool}: Vector of availability status
  • nexttransition::Vector{Int}: Vector of next transition time
source
SiennaPRASInterface.line_ratingMethod
line_rating(line::Branch)

Get the line rating.

Arguments

  • line::Branch: Line

Returns

  • Tuple{forward_capacity::Float64, backward_capacity::Float64}: Line rating
source
SiennaPRASInterface.make_pras_interfacesMethod
make_pras_interfaces(
-    sorted_lines::Vector{PSY.Branch},
-    interface_reg_idxs::Vector{Tuple{Int64, Int64}},
-    interface_line_idxs::Vector{UnitRange{Int64}},
-    s2p_meta::S2P_metadata,
-)

Converts PSY branches and interaces indices into PRAS Lines and Interfaces.

Returns

  • new_lines::PRAS.Lines: PRAS Lines
  • new_interfaces::PRAS.Interfaces: PRAS Interfaces
source
SiennaPRASInterface.rate_to_probabilityMethod
rate_to_probability(for_gen::Float64, mttr::Int64)

Converts the forced outage rate and mean time to repair to the λ and μ parameters

Arguments

  • for_gen::Float64: Forced outage rate [1/T]
  • mttr::Int64: Mean time to repair [T]

Returns

  • λ::Float64: Transition probability from online to offline [1/T]
  • μ::Float64: Transition rate from offline to online [1/T]

Reference

https://core.ac.uk/download/pdf/13643059.pdf

source
+Internal API Reference · SiennaPRASInterface.jl
diff --git a/dev/api/public/index.html b/dev/api/public/index.html index aa1ba53..2de7f48 100644 --- a/dev/api/public/index.html +++ b/dev/api/public/index.html @@ -1,32 +1,164 @@ -Public API Reference · SiennaPRASInterface.jl

Public API Reference

SiennaPRASInterface.generate_pras_systemFunction
generate_pras_system(sys::PSY.System, aggregation; kwargs...)

Sienna/Data PowerSystems.jl System is the input and an object of PRAS SystemModel is returned. ...

Arguments

  • sys::PSY.System: Sienna/Data PowerSystems.jl System
  • aggregation<:PSY.AggregationTopology: "PSY.Area" (or) "PSY.LoadZone" {Optional}
  • availability::Bool: Takes into account avaialability of StaticInjection components when building the PRAS System {Optional}
  • lump_region_renewable_gens::Bool: Whether to lumps PV and Wind generators in a region because usually these generators don't have FOR data {Optional}
  • export_location::String: Export location of the .pras file ...

Returns

- `PRAS.SystemModel`: PRAS SystemModel object

Examples

julia> generate_pras_system(psy_sys)
-PRAS SystemModel
source
generate_pras_system(sys_location::String, aggregation; kwargs...)

Generate a PRAS SystemModel from a Sienna/Data PowerSystems System JSON file.

Arguments

  • sys_location::String: Location of the Sienna/Data PowerSystems System JSON file
  • aggregation::Type{AT}: Aggregation topology type
  • availability::Bool: Availability of components in the System
  • lump_region_renewable_gens::Bool: Lumping of region renewable generators
  • export_location::Union{Nothing, String}: Export location of the .pras file

Returns

  • PRAS.SystemModel: PRAS SystemModel
source
SiennaPRASInterface.PRASModule
PRAS

Module for Probabilistic Resource Adequacy Studies (PRAS).

Re-exported in SiennaPRASInterface

Source

https://github.com/NREL/PRAS.jl

source
SiennaPRASInterface.PRAS.PRASBase.SystemModelType
SystemModel

SystemModel is the primary data structure for Probabilistic Resource Adequacy Studies (PRAS).

You can also load a SystemModel from an appropriately-formatted HDF5 file on disk.

Examples

pras = SystemModel("path/to/pras.pras")
source
SiennaPRASInterface.PRAS.ResourceAdequacy.assessFunction
assess(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 structure
  • method::SequentialMonteCarlo: method for PRAS analysis
  • resultspecs::ResultSpec...: PRAS metric for metrics like Shortfall missing generation

Returns

  • results::Tuple{Vararg{ResultAccumulator{SequentialMonteCarlo}}}: PRAS metric results
source
assess(
+Public API Reference · SiennaPRASInterface.jl

Public API Reference

SiennaPRASInterface.generate_pras_systemFunction
generate_pras_system(sys::PSY.System, aggregation; kwargs...)

Sienna/Data PowerSystems.jl System is the input and an object of PRAS SystemModel is returned. ...

Arguments

  • sys::PSY.System: Sienna/Data PowerSystems.jl System
  • aggregation<:PSY.AggregationTopology: "PSY.Area" (or) "PSY.LoadZone" {Optional}
  • availability::Bool: Takes into account avaialability of StaticInjection components when building the PRAS System {Optional}
  • lump_region_renewable_gens::Bool: Whether to lumps PV and Wind generators in a region because usually these generators don't have FOR data {Optional}
  • export_location::String: Export location of the .pras file ...

Returns

- `PRASCore.SystemModel`: PRAS SystemModel object

Examples

julia> generate_pras_system(psy_sys)
+PRAS SystemModel
source
generate_pras_system(sys_location::String, aggregation; kwargs...)

Generate a PRAS SystemModel from a Sienna/Data PowerSystems System JSON file.

Arguments

  • sys_location::String: Location of the Sienna/Data PowerSystems System JSON file
  • aggregation::Type{AT}: Aggregation topology type
  • availability::Bool: Availability of components in the System
  • lump_region_renewable_gens::Bool: Lumping of region renewable generators
  • export_location::Union{Nothing, String}: Export location of the .pras file

Returns

  • PRASCore.SystemModel: PRAS SystemModel
source
PRASCore.Simulations.assessFunction
assess(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 structure
  • method::SequentialMonteCarlo: method for PRAS analysis
  • resultspecs::ResultSpec...: PRAS metric for metrics like Shortfall missing generation

Returns

  • results::Tuple{Vararg{ResultAccumulator{SequentialMonteCarlo}}}: PRAS metric results
assess(
     sys::PSY.System,
     aggregation::Type{AT},
-    method::PRAS.SimulationSpec,
-    resultsspecs::PRAS.ResourceAdequacy.ResultSpec...,
-) where {AT <: PSY.AggregationTopology}

Estimate resource adequacy using Monte Carlo simulation.

Arguments

  • sys::PSY.System: PowerSystems.jl system model
  • aggregation::Type{AT}: Aggregation topology to use in translating to PRAS
  • method::PRAS.SimulationSpec: Simulation method to use
  • resultsspec::PRAS.ResourceAdequacy.ResultSpec...: Results to compute

Returns

source
SiennaPRASInterface.PRAS.ResourceAdequacy.SequentialMonteCarloType
SequentialMonteCarlo(;
+    method::PRASCore.SequentialMonteCarlo,
+    resultsspecs::PRASCore.Results.ResultSpec...,
+) where {AT <: PSY.AggregationTopology}

Estimate resource adequacy using Monte Carlo simulation.

Arguments

  • sys::PSY.System: PowerSystems.jl system model
  • aggregation::Type{AT}: Aggregation topology to use in translating to PRAS
  • method::PRASCore.SequentialMonteCarlo: Simulation method to use
  • resultsspec::PRASCore.Results.ResultSpec...: Results to compute

Returns

source
PRASCore.Simulations.SequentialMonteCarloType
SequentialMonteCarlo(;
     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 samples
  • seed::Integer=rand(UInt64): Random seed
  • verbose::Bool=false: Print progress
  • threaded::Bool=true: Use multi-threading

Returns

  • SequentialMonteCarlo: PRAS analysis method
source
Missing docstring.

Missing docstring for val. Check Documenter's build log for details.

Missing docstring.

Missing docstring for stderror. Check Documenter's build log for details.

SiennaPRASInterface.generate_outage_profileFunction
generate_outage_profile(pras_system,num_runs,psy_sys,num_scenarios,location)

Process the assess results to get timeseries of generator status and include this timeseries data to the corresponding component in PSY System and exported using to_json method (serializing the PSY System).

...

Arguments

  • pras_system::PRAS.SystemModel: PRAS System
  • num_runs::Int64: Number of PRAS runs
  • psy_sys::PSY.System: PSY System
  • num_scenarios::Int64: Number of scenarios of user interest.
  • location::String: Location to store outage profile. ...

Examples

julia> generate_outage_profile(results, pras_sys, psy_sys, 1)
-PSY System exported using to_json method in InfrastructureSystems
source
SiennaPRASInterface.generate_csv_outage_profileFunction
generate_outage_profile(pras_system,num_runs,psy_sys,num_scenarios,location)

Process the assess results to get timeseries of generator status and include this timeseries data to the corresponding component in PSY System and exported using to_json method (serializing the PSY System).

...

Arguments

  • pras_system::PRAS.SystemModel: PRAS System
  • num_runs::Int64: Number of PRAS runs
  • psy_sys::PSY.System: PSY System
  • num_scenarios::Int64: Number of scenarios of user interest.
  • location::String: Location to store outage profile. ...

Examples

julia> generate_outage_profile(results, pras_sys, psy_sys, 1)
-PSY System exported using to_json method in InfrastructureSystems
source
SiennaPRASInterface.add_csv_time_series!Function
add_csv_time_series!(
+)

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 samples
  • seed::Integer=rand(UInt64): Random seed
  • verbose::Bool=false: Print progress
  • threaded::Bool=true: Use multi-threading

Returns

  • SequentialMonteCarlo: PRAS simulation specification
PRASCore.Results.ShortfallType
Shortfall

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)
+
+# Regional risk metrics
+regional_eue = EUE(shortfall, "Region A")
+regional_lole = LOLE(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.SurplusType
Surplus

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.FlowType
Flow

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.UtilizationType
Utilization

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.StorageEnergyType
StorageEnergy

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.GeneratorStorageEnergyType
GeneratorStorageEnergy

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.LOLEType
LOLE

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.EUEType
EUE

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.

Missing docstring.

Missing docstring for val. Check Documenter's build log for details.

Missing docstring.

Missing docstring for stderror. Check Documenter's build log for details.

SiennaPRASInterface.generate_outage_profileFunction
generate_outage_profile(pras_system,num_runs,psy_sys,num_scenarios,location)

Process the assess results to get timeseries of generator status and include this timeseries data to the corresponding component in PSY System and exported using to_json method (serializing the PSY System).

...

Arguments

  • pras_system::PRASCore.SystemModel: PRAS System
  • num_runs::Int64: Number of PRAS runs
  • psy_sys::PSY.System: PSY System
  • num_scenarios::Int64: Number of scenarios of user interest.
  • location::String: Location to store outage profile. ...

Examples

julia> generate_outage_profile(results, pras_sys, psy_sys, 1)
+PSY System exported using to_json method in InfrastructureSystems
source
SiennaPRASInterface.generate_csv_outage_profileFunction
generate_outage_profile(pras_system,num_runs,psy_sys,num_scenarios,location)

Process the assess results to get timeseries of generator status and include this timeseries data to the corresponding component in PSY System and exported using to_json method (serializing the PSY System).

...

Arguments

  • pras_system::PRASCore.SystemModel: PRAS System
  • num_runs::Int64: Number of PRAS runs
  • psy_sys::PSY.System: PSY System
  • num_scenarios::Int64: Number of scenarios of user interest.
  • location::String: Location to store outage profile. ...

Examples

julia> generate_outage_profile(results, pras_sys, psy_sys, 1)
+PSY System exported using to_json method in InfrastructureSystems
source
SiennaPRASInterface.add_csv_time_series!Function
add_csv_time_series!(
     sys_DA,
     sys_RT,
     outage_csv_location::String;
     days_of_interest::Union{Nothing, UnitRange}=nothing,
     add_scenario::Union{Nothing, Int}=nothing,
-)

Generates outage profile for two stage PowerSimulation and adds availability time series data to Generators in PSY System from CSV files.

source
SiennaPRASInterface.add_csv_time_series_single_stage!Function
add_csv_time_series_single_stage!(
     sys_DA,
     outage_csv_location::String;
     days_of_interest::Union{Nothing, UnitRange}=nothing,
     add_scenario::Union{Nothing, Int}=nothing,
-)

Generates outage profile for single stage PowerSimulation and adds availability time series.

source
SiennaPRASInterface.make_generator_outage_draws!Function
make_generator_outage_draws!(
     sys,
     initial_time::Dates.DateTime=nothing,
     resolution::TIMEPERIOD=nothing,
     steps::Int=nothing,
     horizon::Int=nothing,
-) where {TIMEPERIOD <: Dates.TimePeriod}

Adds availability time series to the generators in the system.

Main function to make generator outage draws.

source
+) where {TIMEPERIOD <: Dates.TimePeriod}

Adds availability time series to the generators in the system.

Main function to make generator outage draws.

source
PRASCore.Results.ShortfallSamplesType
ShortfallSamples

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)
+
+# Regional risk metrics
+regional_eue = EUE(shortfall, "Region A")
+regional_lole = LOLE(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.SurplusSamplesType
SurplusSamples

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.FlowSamplesType
FlowSamples

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.UtilizationSamplesType
UtilizationSamples

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.StorageEnergySamplesType
StorageEnergySamples

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.GeneratorStorageEnergySamplesType
GeneratorStorageEnergySamples

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.GeneratorAvailabilityType
GeneratorAvailability

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.GeneratorStorageAvailabilityType
GeneratorStorageAvailability

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.LineAvailabilityType
LineAvailability

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
diff --git a/dev/index.html b/dev/index.html index d2aabe9..0a599b3 100644 --- a/dev/index.html +++ b/dev/index.html @@ -8,4 +8,4 @@ add_supplemental_attribute!(sys, component, transition_data)

3. Calculate Shortfalls and Expected Unserved Energy on System

using SiennaPRASInterface
 method = SequentialMonteCarlo(samples=10_000, seed=1)
 shortfalls, = assess(sys, PowerSystems.Area, sequential_monte_carlo, Shortfall())
-eue = EUE(shortfalls)

Documentation

SiennaPRASInterface has been developed as part of the Transmission Planning Tools Maintenance project at the U.S. Department of Energy's National Renewable Energy Laboratory (NREL) funded by DOE Grid Deployment Office (GDO).

+eue = EUE(shortfalls)

Documentation

SiennaPRASInterface has been developed as part of the Transmission Planning Tools Maintenance project at the U.S. Department of Energy's National Renewable Energy Laboratory (NREL) funded by DOE Grid Deployment Office (GDO).

diff --git a/dev/search/index.html b/dev/search/index.html index 0eed93c..08f0846 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · SiennaPRASInterface.jl

Loading search...

    +Search · SiennaPRASInterface.jl

    Loading search...

      diff --git a/dev/search_index.js b/dev/search_index.js index fe6e4c9..1debbd0 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"tutorials/intro_page/#Examples","page":"Tutorials","title":"Examples","text":"","category":"section"},{"location":"tutorials/intro_page/","page":"Tutorials","title":"Tutorials","text":"Tutorials to be created soon.","category":"page"},{"location":"api/internal/#Internal-API","page":"Internal API Reference","title":"Internal API","text":"","category":"section"},{"location":"api/internal/","page":"Internal API Reference","title":"Internal API Reference","text":"Modules = [SiennaPRASInterface, PRAS]\nPublic = false","category":"page"},{"location":"api/internal/#SiennaPRASInterface.CC_RESTRICTIONS_UTIL_FILE","page":"Internal API Reference","title":"SiennaPRASInterface.CC_RESTRICTIONS_UTIL_FILE","text":"FILE with restrictions on CC units in PRAS\n\n\n\n\n\n","category":"constant"},{"location":"api/internal/#SiennaPRASInterface.HVDCLineTypes","page":"Internal API Reference","title":"SiennaPRASInterface.HVDCLineTypes","text":"Supported DC branch Types\n\n\n\n\n\n","category":"type"},{"location":"api/internal/#SiennaPRASInterface.OUTAGE_INFO_FILE","page":"Internal API Reference","title":"SiennaPRASInterface.OUTAGE_INFO_FILE","text":"DEFAULT outage data which is used when outage_flag is set to FALSE\n\nBased on ERCOT historical data\n\n\n\n\n\n","category":"constant"},{"location":"api/internal/#SiennaPRASInterface.TransformerTypes","page":"Internal API Reference","title":"SiennaPRASInterface.TransformerTypes","text":"Filtered Transformer Types\n\nThese transformers are not modeled as lines in PRAS.\n\n\n\n\n\n","category":"constant"},{"location":"api/internal/#SiennaPRASInterface.S2P_metadata","page":"Internal API Reference","title":"SiennaPRASInterface.S2P_metadata","text":"S2P_metadata\n\nStruct to store metadata for the Sienna to PRAS conversion\n\n\n\n\n\n","category":"type"},{"location":"api/internal/#SiennaPRASInterface.outage_data","page":"Internal API Reference","title":"SiennaPRASInterface.outage_data","text":"outage_data\n\nStruct to store the outage information for a component.\n\n\n\n\n\n","category":"type"},{"location":"api/internal/#SiennaPRASInterface.check_file-Tuple{String}","page":"Internal API Reference","title":"SiennaPRASInterface.check_file","text":"check_file(loc::String)\n\nCheck if the file exists and is openable.\n\n\n\n\n\n","category":"method"},{"location":"api/internal/#SiennaPRASInterface.get_available_components_in_aggregation_topology-Tuple{Type{<:PowerSystems.StaticInjection}, PowerSystems.System, PowerSystems.AggregationTopology}","page":"Internal API Reference","title":"SiennaPRASInterface.get_available_components_in_aggregation_topology","text":"get_available_components_in_aggregation_topology(\n type::Type{<:PSY.StaticInjection},\n sys::PSY.System,\n region::PSY.AggregationTopology,\n)\n\nGet available components in the AggregationTopology region of the given type.\n\n\n\n\n\n","category":"method"},{"location":"api/internal/#SiennaPRASInterface.get_first_ts-Tuple{TS} where TS<:Channel{Any}","page":"Internal API Reference","title":"SiennaPRASInterface.get_first_ts","text":"get_first_ts(ts::TS)\n\nGet time series and handle components with no time series (such as unavailable)\n\n\n\n\n\n","category":"method"},{"location":"api/internal/#SiennaPRASInterface.get_generator_category-Tuple{PowerSystems.StaticInjection}","page":"Internal API Reference","title":"SiennaPRASInterface.get_generator_category","text":"get_generator_category(gen::StaticInjection)\n\nGet the category of the generator.\n\nArguments\n\ngen::StaticInjection: Generator\n\nReturns\n\nString: Category of the generator\n\n\n\n\n\n","category":"method"},{"location":"api/internal/#SiennaPRASInterface.get_sorted_lines-Tuple{Vector{PowerSystems.Branch}, Vector{String}}","page":"Internal API Reference","title":"SiennaPRASInterface.get_sorted_lines","text":"get_sorted_lines(lines::Vector{PSY.Branch}, region_names::Vector{String})\n\nGet sorted lines, interface region indices, and interface line indices.\n\nArguments\n\nlines::Vector{PSY.Branch}: Lines\nregion_names::Vector{String}: Region names\n\nReturns\n\nsorted_lines::Vector{PSY.Branch}: Sorted lines\ninterface_reg_idxs::Vector{Tuple{Int, Int}}: Interface region indices\ninterface_line_idxs::Vector{UnitRange{Int}}: Interface line indices\n\n\n\n\n\n","category":"method"},{"location":"api/internal/#SiennaPRASInterface.get_sorted_region_tuples-Tuple{Vector{PowerSystems.Branch}, Vector{String}}","page":"Internal API Reference","title":"SiennaPRASInterface.get_sorted_region_tuples","text":"get_sorted_region_tuples(lines::Vector{PSY.Branch}, region_names::Vector{String})\n\nGet sorted (regfrom, regto) tuples of inter-regional lines.\n\n\n\n\n\n","category":"method"},{"location":"api/internal/#SiennaPRASInterface.get_timestamps-Union{Tuple{TIMEPERIOD}, Tuple{Dates.DateTime, TIMEPERIOD, Int64, Int64}} where TIMEPERIOD<:Dates.TimePeriod","page":"Internal API Reference","title":"SiennaPRASInterface.get_timestamps","text":"get_timestamps(initial_time, resolution, steps, horizon)\n\nReturn a vector of timestamps starting from initial_time with resolution and steps for horizon steps\n\n\n\n\n\n","category":"method"},{"location":"api/internal/#SiennaPRASInterface.get_ts_values-Tuple{InfrastructureSystems.TimeSeriesData}","page":"Internal API Reference","title":"SiennaPRASInterface.get_ts_values","text":"get_ts_values(ts::PSY.TimeSeriesData)\n\nGet the time series values.\n\nArguments\n\nts::TimeSeries: Time series\n\nReturns\n\nArray{Float64}: Time series values\n\n\n\n\n\n","category":"method"},{"location":"api/internal/#SiennaPRASInterface.initialize_availability!-Tuple{Random.AbstractRNG, Vector{Bool}, Vector{Int64}, Vector{PowerSystems.Generator}, Int64}","page":"Internal API Reference","title":"SiennaPRASInterface.initialize_availability!","text":"initializeavailability!(rng, availability, nexttransition, devices, tlast)\n\nArguments\n\nrng::Random.AbstractRNG: Random number generator\navailability::Vector{Bool}: Vector of availability status\nnexttransition::Vector{Int}: Vector of next transition time\ndevices::Vector{PSY.Generator}: Vector of devices with outage SupplementalAttributes\nt_last::Int: Last time step\n\nReturns\n\nModifies input arguments and rereturns\n\navailability::Vector{Bool}: Vector of availability status\nnexttransition::Vector{Int}: Vector of next transition time\n\n\n\n\n\n","category":"method"},{"location":"api/internal/#SiennaPRASInterface.line_rating-Tuple{PowerSystems.Branch}","page":"Internal API Reference","title":"SiennaPRASInterface.line_rating","text":"line_rating(line::Branch)\n\nGet the line rating.\n\nArguments\n\nline::Branch: Line\n\nReturns\n\nTuple{forward_capacity::Float64, backward_capacity::Float64}: Line rating\n\n\n\n\n\n","category":"method"},{"location":"api/internal/#SiennaPRASInterface.make_pras_interfaces-Tuple{Vector{PowerSystems.Branch}, Vector{Tuple{Int64, Int64}}, Vector{UnitRange{Int64}}, SiennaPRASInterface.S2P_metadata}","page":"Internal API Reference","title":"SiennaPRASInterface.make_pras_interfaces","text":"make_pras_interfaces(\n sorted_lines::Vector{PSY.Branch},\n interface_reg_idxs::Vector{Tuple{Int64, Int64}},\n interface_line_idxs::Vector{UnitRange{Int64}},\n s2p_meta::S2P_metadata,\n)\n\nConverts PSY branches and interaces indices into PRAS Lines and Interfaces.\n\nReturns\n\nnew_lines::PRAS.Lines: PRAS Lines\nnew_interfaces::PRAS.Interfaces: PRAS Interfaces\n\n\n\n\n\n","category":"method"},{"location":"api/internal/#SiennaPRASInterface.rate_to_probability-Tuple{Float64, Int64}","page":"Internal API Reference","title":"SiennaPRASInterface.rate_to_probability","text":"rate_to_probability(for_gen::Float64, mttr::Int64)\n\nConverts the forced outage rate and mean time to repair to the λ and μ parameters\n\nArguments\n\nfor_gen::Float64: Forced outage rate [1/T]\nmttr::Int64: Mean time to repair [T]\n\nReturns\n\nλ::Float64: Transition probability from online to offline [1/T]\nμ::Float64: Transition rate from offline to online [1/T]\n\nReference\n\nhttps://core.ac.uk/download/pdf/13643059.pdf\n\n\n\n\n\n","category":"method"},{"location":"api/internal/#SiennaPRASInterface.runchecks-Tuple{String}","page":"Internal API Reference","title":"SiennaPRASInterface.runchecks","text":"runchecks(sys_location::String)\n\nCheck if the System JSON file is serialized as well as other files required.\n\n\n\n\n\n","category":"method"},{"location":"api/internal/#SiennaPRASInterface.update_availability!-Tuple{Random.AbstractRNG, Vector{Bool}, Vector{Int64}, Vector{PowerSystems.Generator}, Int64, Int64}","page":"Internal API Reference","title":"SiennaPRASInterface.update_availability!","text":"update_availability!(rng, availability, nexttransition, devices, t_now, t_last)\n\nReturn availability and next transition with new randomness\n\n\n\n\n\n","category":"method"},{"location":"#SiennaPRASInterface.jl","page":"Welcome Page","title":"SiennaPRASInterface.jl","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"CurrentModule = SiennaPRASInterface","category":"page"},{"location":"#About","page":"Welcome Page","title":"About","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"SiennaPRASInterface.jl is a Julia package that provides an interface to PRAS.jl from Sienna's PowerSystem.jl's System data model.","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"The Probabilistic Resource Adequacy Suite (PRAS) analyzes the resource adequacy of a bulk power system using Monte Carlo methods.","category":"page"},{"location":"#Getting-Started","page":"Welcome Page","title":"Getting Started","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"To use SiennaPRASInterface.jl, you first need a System from PowerSystems.jl","category":"page"},{"location":"#.-Install","page":"Welcome Page","title":"1. Install","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"] add SiennaPRASInterface","category":"page"},{"location":"#.-Add-Data","page":"Welcome Page","title":"2. Add Data","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"Add outage information to generators using the supplemental attribute GeometricDistributionForcedOutage.","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"using PowerSystems\ntransition_data = GeometricDistributionForcedOutage(;\n mean_time_to_recovery=10, # Units of hours\n outage_transition_probability=0.005, # Probability for outage per hour\n)\ncomponent = get_component(Generator, sys, \"test_generator\")\nadd_supplemental_attribute!(sys, component, transition_data)","category":"page"},{"location":"#.-Calculate-Shortfalls-and-Expected-Unserved-Energy-on-System","page":"Welcome Page","title":"3. Calculate Shortfalls and Expected Unserved Energy on System","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"using SiennaPRASInterface\nmethod = SequentialMonteCarlo(samples=10_000, seed=1)\nshortfalls, = assess(sys, PowerSystems.Area, sequential_monte_carlo, Shortfall())\neue = EUE(shortfalls)","category":"page"},{"location":"#Documentation","page":"Welcome Page","title":"Documentation","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"PRAS Documentation","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"Pages = [\"api/public.md\", \"tutorials\"]\nDepth = 2","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"SiennaPRASInterface has been developed as part of the Transmission Planning Tools Maintenance project at the U.S. Department of Energy's National Renewable Energy Laboratory (NREL) funded by DOE Grid Deployment Office (GDO).","category":"page"},{"location":"api/public/#Public-API-Reference","page":"Public API Reference","title":"Public API Reference","text":"","category":"section"},{"location":"api/public/","page":"Public API Reference","title":"Public API Reference","text":"SiennaPRASInterface\ngenerate_pras_system\nPRAS\nSystemModel\nassess\nSequentialMonteCarlo\nShortfall\nSurplus\nFlow\nUtilization\nStorageEnergy\nGeneratorStorageEnergy\nLOLE\nEUE\nval\nstderror\ngenerate_outage_profile\ngenerate_csv_outage_profile\nadd_csv_time_series!\nadd_csv_time_series_single_stage!\nmake_generator_outage_draws!\nShortfallSamples\nSurplusSamples\nFlowSamples\nUtilizationSamples\nStorageEnergySamples\nGeneratorStorageEnergySamples\nGeneratorAvailability\nGeneratorStorageAvailability\nLineAvailability","category":"page"},{"location":"api/public/#SiennaPRASInterface","page":"Public API Reference","title":"SiennaPRASInterface","text":"PowerSystems Interface for Probabilistic Resource Adequacy Studies (PRAS)\n\nKey Functions\n\ngenerate_pras_system: convert PSY to PRAS model\nassess: assess PRAS model\n\nKey PRAS Types\n\nSystemModel: PRAS data structure\nSequentialMonteCarlo: method for PRAS analysis\nShortfall: PRAS metric for missing generation\nLOLE: PRAS metric for loss of load expectation\nEUE: PRAS metric for energy unserved expectation\n\n\n\n\n\n","category":"module"},{"location":"api/public/#SiennaPRASInterface.generate_pras_system","page":"Public API Reference","title":"SiennaPRASInterface.generate_pras_system","text":"generate_pras_system(sys::PSY.System, aggregation; kwargs...)\n\nSienna/Data PowerSystems.jl System is the input and an object of PRAS SystemModel is returned. ...\n\nArguments\n\nsys::PSY.System: Sienna/Data PowerSystems.jl System\naggregation<:PSY.AggregationTopology: \"PSY.Area\" (or) \"PSY.LoadZone\" {Optional}\navailability::Bool: Takes into account avaialability of StaticInjection components when building the PRAS System {Optional}\nlump_region_renewable_gens::Bool: Whether to lumps PV and Wind generators in a region because usually these generators don't have FOR data {Optional}\nexport_location::String: Export location of the .pras file ...\n\nReturns\n\n- `PRAS.SystemModel`: PRAS SystemModel object\n\nExamples\n\njulia> generate_pras_system(psy_sys)\nPRAS SystemModel\n\n\n\n\n\ngenerate_pras_system(sys_location::String, aggregation; kwargs...)\n\nGenerate a PRAS SystemModel from a Sienna/Data PowerSystems System JSON file.\n\nArguments\n\nsys_location::String: Location of the Sienna/Data PowerSystems System JSON file\naggregation::Type{AT}: Aggregation topology type\navailability::Bool: Availability of components in the System\nlump_region_renewable_gens::Bool: Lumping of region renewable generators\nexport_location::Union{Nothing, String}: Export location of the .pras file\n\nReturns\n\nPRAS.SystemModel: PRAS SystemModel\n\n\n\n\n\n","category":"function"},{"location":"api/public/#SiennaPRASInterface.PRAS","page":"Public API Reference","title":"SiennaPRASInterface.PRAS","text":"PRAS\n\nModule for Probabilistic Resource Adequacy Studies (PRAS).\n\nRe-exported in SiennaPRASInterface\n\nSource\n\nhttps://github.com/NREL/PRAS.jl\n\n\n\n\n\n","category":"module"},{"location":"api/public/#SiennaPRASInterface.PRAS.PRASBase.SystemModel","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.PRASBase.SystemModel","text":"SystemModel\n\nSystemModel is the primary data structure for Probabilistic Resource Adequacy Studies (PRAS).\n\nYou can also load a SystemModel from an appropriately-formatted HDF5 file on disk.\n\nExamples\n\npras = SystemModel(\"path/to/pras.pras\")\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.assess","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.assess","text":"assess(system::SystemModel, method::SequentialMonteCarlo, resultspecs::ResultSpec...)\n\nRun a Sequential Monte Carlo simulation on a system using the method data and return resultspecs.\n\nArguments\n\nsystem::SystemModel: PRAS data structure\nmethod::SequentialMonteCarlo: method for PRAS analysis\nresultspecs::ResultSpec...: PRAS metric for metrics like Shortfall missing generation\n\nReturns\n\nresults::Tuple{Vararg{ResultAccumulator{SequentialMonteCarlo}}}: PRAS metric results\n\n\n\n\n\nassess(\n sys::PSY.System,\n aggregation::Type{AT},\n method::PRAS.SimulationSpec,\n resultsspecs::PRAS.ResourceAdequacy.ResultSpec...,\n) where {AT <: PSY.AggregationTopology}\n\nEstimate resource adequacy using Monte Carlo simulation.\n\nArguments\n\nsys::PSY.System: PowerSystems.jl system model\naggregation::Type{AT}: Aggregation topology to use in translating to PRAS\nmethod::PRAS.SimulationSpec: Simulation method to use\nresultsspec::PRAS.ResourceAdequacy.ResultSpec...: Results to compute\n\nReturns\n\nTuple of results from resultsspec: default is (ShortfallResult,)\n\n\n\n\n\n","category":"function"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.SequentialMonteCarlo","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.SequentialMonteCarlo","text":"SequentialMonteCarlo(;\n samples::Int=10_000,\n seed::Integer=rand(UInt64),\n verbose::Bool=false,\n threaded::Bool=true\n)\n\nSequential Monte Carlo simulation parameters for PRAS analysis\n\nIt it recommended that you fix the random seed for reproducibility.\n\nArguments\n\nsamples::Int=10_000: Number of samples\nseed::Integer=rand(UInt64): Random seed\nverbose::Bool=false: Print progress\nthreaded::Bool=true: Use multi-threading\n\nReturns\n\nSequentialMonteCarlo: PRAS analysis method\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.Shortfall","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.Shortfall","text":"Shortfall\n\nShortfall metric represents lost load at regions and timesteps in ShortfallResult with a (regions, timestamps) matrix API.\n\nSeparate samples are averaged together into mean and std values.\n\nSee ShortfallSamples for all shortfall samples.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.Surplus","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.Surplus","text":"Surplus\n\nSurplus metric represents extra generation at regions and timestamps in a SurplusResults with a (regions, timestamps) matrix API.\n\nSeparate samples are averaged together into mean and std values.\n\nSee SurplusSamples for all surplus samples.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.Flow","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.Flow","text":"Flow\n\nFlow metric represents the flow between interfaces at timestamps in a FlowResult with a (interfaces, timestamps) matrix API.\n\nSeparate samples are averaged together into mean and std values.\n\nSee FlowSamples for all flow samples.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.Utilization","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.Utilization","text":"Utilization\n\nUtilization metric represents how much an interface between regions is used across timestamps in a UtilizationResult with a (interfaces, timestamps) matrix API.\n\nSeparate samples are averaged together into mean and std values.\n\nSee UtilizationSamples for all utilization samples.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.StorageEnergy","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.StorageEnergy","text":"StorageEnergy\n\nStorage energy represents the state-of-charge of storage resources at timestamps in a StorageEnergyResult with a (storages, timestamps) matrix API.\n\nSeparate samples are averaged together into mean and std values.\n\nSee StorageEnergySamples for all storage energy samples.\n\nSee GeneratorStorageEnergy for generator storage energy.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.GeneratorStorageEnergy","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.GeneratorStorageEnergy","text":"GeneratorStorageEnergy\n\nGenerator storage energy represents state-of-charge of generatorstorage resources at timestamps in a StorageEnergyResult with a (generatorstorages, timestamps) matrix API.\n\nSeparate samples are averaged together into mean and std values.\n\nSee GeneratorStorageEnergySamples for all generator storage energy samples.\n\nSee StorageEnergy for storage energy.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.LOLE","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.LOLE","text":"LOLE\n\nLoss of load expectation metric. Contains a mean and standard error estimate.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.EUE","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.EUE","text":"EUE\n\nExpected unserved energy expectation metric. Contains a mean and standard error estimate.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.generate_outage_profile","page":"Public API Reference","title":"SiennaPRASInterface.generate_outage_profile","text":"generate_outage_profile(pras_system,num_runs,psy_sys,num_scenarios,location)\n\nProcess the assess results to get timeseries of generator status and include this timeseries data to the corresponding component in PSY System and exported using to_json method (serializing the PSY System).\n\n...\n\nArguments\n\npras_system::PRAS.SystemModel: PRAS System\nnum_runs::Int64: Number of PRAS runs\npsy_sys::PSY.System: PSY System\nnum_scenarios::Int64: Number of scenarios of user interest.\nlocation::String: Location to store outage profile. ...\n\nExamples\n\njulia> generate_outage_profile(results, pras_sys, psy_sys, 1)\nPSY System exported using to_json method in InfrastructureSystems\n\n\n\n\n\n","category":"function"},{"location":"api/public/#SiennaPRASInterface.generate_csv_outage_profile","page":"Public API Reference","title":"SiennaPRASInterface.generate_csv_outage_profile","text":"generate_outage_profile(pras_system,num_runs,psy_sys,num_scenarios,location)\n\nProcess the assess results to get timeseries of generator status and include this timeseries data to the corresponding component in PSY System and exported using to_json method (serializing the PSY System).\n\n...\n\nArguments\n\npras_system::PRAS.SystemModel: PRAS System\nnum_runs::Int64: Number of PRAS runs\npsy_sys::PSY.System: PSY System\nnum_scenarios::Int64: Number of scenarios of user interest.\nlocation::String: Location to store outage profile. ...\n\nExamples\n\njulia> generate_outage_profile(results, pras_sys, psy_sys, 1)\nPSY System exported using to_json method in InfrastructureSystems\n\n\n\n\n\n","category":"function"},{"location":"api/public/#SiennaPRASInterface.add_csv_time_series!","page":"Public API Reference","title":"SiennaPRASInterface.add_csv_time_series!","text":"add_csv_time_series!(\n sys_DA,\n sys_RT,\n outage_csv_location::String;\n days_of_interest::Union{Nothing, UnitRange}=nothing,\n add_scenario::Union{Nothing, Int}=nothing,\n)\n\nGenerates outage profile for two stage PowerSimulation and adds availability time series data to Generators in PSY System from CSV files.\n\n\n\n\n\n","category":"function"},{"location":"api/public/#SiennaPRASInterface.add_csv_time_series_single_stage!","page":"Public API Reference","title":"SiennaPRASInterface.add_csv_time_series_single_stage!","text":"add_csv_time_series_single_stage!(\n sys_DA,\n outage_csv_location::String;\n days_of_interest::Union{Nothing, UnitRange}=nothing,\n add_scenario::Union{Nothing, Int}=nothing,\n)\n\nGenerates outage profile for single stage PowerSimulation and adds availability time series.\n\n\n\n\n\n","category":"function"},{"location":"api/public/#SiennaPRASInterface.make_generator_outage_draws!","page":"Public API Reference","title":"SiennaPRASInterface.make_generator_outage_draws!","text":"make_generator_outage_draws!(\n sys,\n initial_time::Dates.DateTime=nothing,\n resolution::TIMEPERIOD=nothing,\n steps::Int=nothing,\n horizon::Int=nothing,\n) where {TIMEPERIOD <: Dates.TimePeriod}\n\nAdds availability time series to the generators in the system.\n\nMain function to make generator outage draws.\n\n\n\n\n\n","category":"function"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.ShortfallSamples","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.ShortfallSamples","text":"ShortfallSamples\n\nShortfallSamples metric represents lost load at regions and timesteps in ShortfallSamplesResult with a (regions, timestamps, samples) matrix API.\n\nSee Shortfall for averaged shortfall samples.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.SurplusSamples","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.SurplusSamples","text":"SurplusSamples\n\nSurplus samples represent extra generation at regions and timestamps in a SurplusSamplesResult with a (regions, timestamps, samples) matrix API.\n\nSee Surplus for sample-averaged surplus data.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.FlowSamples","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.FlowSamples","text":"FlowSamples\n\nFlow samples represent the flow between interfaces at timestamps, which has not been averaged across different samples. This presents a 3D matrix API (interfaces, timestamps, samples).\n\nSee Flow for sample-averaged flow data.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.UtilizationSamples","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.UtilizationSamples","text":"UtilizationSamples\n\nUtilization samples represent the utilization between interfaces at timestamps, which has not been averaged across different samples. This presents a 3D matrix API (interfaces, timestamps, samples).\n\nSee Utilization for averaged utilization samples.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.StorageEnergySamples","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.StorageEnergySamples","text":"StorageEnergySamples\n\nStorage energy samples represent the state-of-charge of storage resources at timestamps, which has not been averaged across different samples. This presents a 3D matrix API (storages, timestamps, samples).\n\nSee StorageEnergy for sample-averaged storage energy.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.GeneratorStorageEnergySamples","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.GeneratorStorageEnergySamples","text":"GeneratorStorageEnergySamples\n\nGenerator storage energy samples represent the state-of-charge of generatorstorage resources at timestamps, which has not been averaged across different samples. This presents a 3D matrix API (generatorstorages, timestamps, samples).\n\nSee GeneratorStorageEnergy for sample-averaged generator storage energy.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.GeneratorAvailability","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.GeneratorAvailability","text":"GeneratorAvailability\n\nGenerator availability represents the availability of generators at timestamps in a GeneratorAvailabilityResult with a (generators, timestamps, samples) matrix API.\n\nNo averaging occurs.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.GeneratorStorageAvailability","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.GeneratorStorageAvailability","text":"GeneratorStorageAvailability\n\nGenerator storage availability represents the availability of generatorstorage resources at timestamps in a GeneratorStorageAvailabilityResult with a (generatorstorages, timestamps, samples) matrix API.\n\nNo averaging occurs\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.PRAS.ResourceAdequacy.LineAvailability","page":"Public API Reference","title":"SiennaPRASInterface.PRAS.ResourceAdequacy.LineAvailability","text":"LineAvailability\n\nLine availability represents the availability of lines at timestamps in a LineAvailabilityResult with a (lines, timestamps, samples) matrix API.\n\nNo averaging occurs.\n\n\n\n\n\n","category":"type"}] +[{"location":"tutorials/intro_page/#Examples","page":"Tutorials","title":"Examples","text":"","category":"section"},{"location":"tutorials/intro_page/","page":"Tutorials","title":"Tutorials","text":"Tutorials to be created soon.","category":"page"},{"location":"api/internal/#Internal-API","page":"Internal API Reference","title":"Internal API","text":"","category":"section"},{"location":"api/internal/","page":"Internal API Reference","title":"Internal API Reference","text":"Modules = [SiennaPRASInterface, PRAS]\nPublic = false","category":"page"},{"location":"#SiennaPRASInterface.jl","page":"Welcome Page","title":"SiennaPRASInterface.jl","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"CurrentModule = SiennaPRASInterface","category":"page"},{"location":"#About","page":"Welcome Page","title":"About","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"SiennaPRASInterface.jl is a Julia package that provides an interface to PRAS.jl from Sienna's PowerSystem.jl's System data model.","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"The Probabilistic Resource Adequacy Suite (PRAS) analyzes the resource adequacy of a bulk power system using Monte Carlo methods.","category":"page"},{"location":"#Getting-Started","page":"Welcome Page","title":"Getting Started","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"To use SiennaPRASInterface.jl, you first need a System from PowerSystems.jl","category":"page"},{"location":"#.-Install","page":"Welcome Page","title":"1. Install","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"] add SiennaPRASInterface","category":"page"},{"location":"#.-Add-Data","page":"Welcome Page","title":"2. Add Data","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"Add outage information to generators using the supplemental attribute GeometricDistributionForcedOutage.","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"using PowerSystems\ntransition_data = GeometricDistributionForcedOutage(;\n mean_time_to_recovery=10, # Units of hours\n outage_transition_probability=0.005, # Probability for outage per hour\n)\ncomponent = get_component(Generator, sys, \"test_generator\")\nadd_supplemental_attribute!(sys, component, transition_data)","category":"page"},{"location":"#.-Calculate-Shortfalls-and-Expected-Unserved-Energy-on-System","page":"Welcome Page","title":"3. Calculate Shortfalls and Expected Unserved Energy on System","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"using SiennaPRASInterface\nmethod = SequentialMonteCarlo(samples=10_000, seed=1)\nshortfalls, = assess(sys, PowerSystems.Area, sequential_monte_carlo, Shortfall())\neue = EUE(shortfalls)","category":"page"},{"location":"#Documentation","page":"Welcome Page","title":"Documentation","text":"","category":"section"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"PRAS Documentation","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"Pages = [\"api/public.md\", \"tutorials\"]\nDepth = 2","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"","category":"page"},{"location":"","page":"Welcome Page","title":"Welcome Page","text":"SiennaPRASInterface has been developed as part of the Transmission Planning Tools Maintenance project at the U.S. Department of Energy's National Renewable Energy Laboratory (NREL) funded by DOE Grid Deployment Office (GDO).","category":"page"},{"location":"api/public/#Public-API-Reference","page":"Public API Reference","title":"Public API Reference","text":"","category":"section"},{"location":"api/public/","page":"Public API Reference","title":"Public API Reference","text":"SiennaPRASInterface\ngenerate_pras_system\nSystemModel\nassess\nSequentialMonteCarlo\nShortfall\nSurplus\nFlow\nUtilization\nStorageEnergy\nGeneratorStorageEnergy\nLOLE\nEUE\nval\nstderror\ngenerate_outage_profile\ngenerate_csv_outage_profile\nadd_csv_time_series!\nadd_csv_time_series_single_stage!\nmake_generator_outage_draws!\nShortfallSamples\nSurplusSamples\nFlowSamples\nUtilizationSamples\nStorageEnergySamples\nGeneratorStorageEnergySamples\nGeneratorAvailability\nGeneratorStorageAvailability\nLineAvailability","category":"page"},{"location":"api/public/#SiennaPRASInterface","page":"Public API Reference","title":"SiennaPRASInterface","text":"PowerSystems Interface for Probabilistic Resource Adequacy Studies (PRAS)\n\nKey Functions\n\ngenerate_pras_system: convert PSY to PRAS model\nassess: assess PRAS model\n\nKey PRAS Types\n\nSystemModel: PRAS data structure\nSequentialMonteCarlo: method for PRAS analysis\nShortfall: PRAS metric for missing generation\nLOLE: PRAS metric for loss of load expectation\nEUE: PRAS metric for energy unserved expectation\n\n\n\n\n\n","category":"module"},{"location":"api/public/#SiennaPRASInterface.generate_pras_system","page":"Public API Reference","title":"SiennaPRASInterface.generate_pras_system","text":"generate_pras_system(sys::PSY.System, aggregation; kwargs...)\n\nSienna/Data PowerSystems.jl System is the input and an object of PRAS SystemModel is returned. ...\n\nArguments\n\nsys::PSY.System: Sienna/Data PowerSystems.jl System\naggregation<:PSY.AggregationTopology: \"PSY.Area\" (or) \"PSY.LoadZone\" {Optional}\navailability::Bool: Takes into account avaialability of StaticInjection components when building the PRAS System {Optional}\nlump_region_renewable_gens::Bool: Whether to lumps PV and Wind generators in a region because usually these generators don't have FOR data {Optional}\nexport_location::String: Export location of the .pras file ...\n\nReturns\n\n- `PRASCore.SystemModel`: PRAS SystemModel object\n\nExamples\n\njulia> generate_pras_system(psy_sys)\nPRAS SystemModel\n\n\n\n\n\ngenerate_pras_system(sys_location::String, aggregation; kwargs...)\n\nGenerate a PRAS SystemModel from a Sienna/Data PowerSystems System JSON file.\n\nArguments\n\nsys_location::String: Location of the Sienna/Data PowerSystems System JSON file\naggregation::Type{AT}: Aggregation topology type\navailability::Bool: Availability of components in the System\nlump_region_renewable_gens::Bool: Lumping of region renewable generators\nexport_location::Union{Nothing, String}: Export location of the .pras file\n\nReturns\n\nPRASCore.SystemModel: PRAS SystemModel\n\n\n\n\n\n","category":"function"},{"location":"api/public/#PRASCore.Systems.SystemModel","page":"Public API Reference","title":"PRASCore.Systems.SystemModel","text":"SystemModel\n\nA SystemModel contains a representation of a power system to be studied with PRAS.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Simulations.assess","page":"Public API Reference","title":"PRASCore.Simulations.assess","text":"assess(system::SystemModel, method::SequentialMonteCarlo, resultspecs::ResultSpec...)\n\nRun a Sequential Monte Carlo simulation on a system using the method data and return resultspecs.\n\nArguments\n\nsystem::SystemModel: PRAS data structure\nmethod::SequentialMonteCarlo: method for PRAS analysis\nresultspecs::ResultSpec...: PRAS metric for metrics like Shortfall missing generation\n\nReturns\n\nresults::Tuple{Vararg{ResultAccumulator{SequentialMonteCarlo}}}: PRAS metric results\n\n\n\n\n\nassess(\n sys::PSY.System,\n aggregation::Type{AT},\n method::PRASCore.SequentialMonteCarlo,\n resultsspecs::PRASCore.Results.ResultSpec...,\n) where {AT <: PSY.AggregationTopology}\n\nEstimate resource adequacy using Monte Carlo simulation.\n\nArguments\n\nsys::PSY.System: PowerSystems.jl system model\naggregation::Type{AT}: Aggregation topology to use in translating to PRAS\nmethod::PRASCore.SequentialMonteCarlo: Simulation method to use\nresultsspec::PRASCore.Results.ResultSpec...: Results to compute\n\nReturns\n\nTuple of results from resultsspec: default is (ShortfallResult,)\n\n\n\n\n\n","category":"function"},{"location":"api/public/#PRASCore.Simulations.SequentialMonteCarlo","page":"Public API Reference","title":"PRASCore.Simulations.SequentialMonteCarlo","text":"SequentialMonteCarlo(;\n samples::Int=10_000,\n seed::Integer=rand(UInt64),\n verbose::Bool=false,\n threaded::Bool=true\n)\n\nSequential Monte Carlo simulation parameters for PRAS analysis\n\nIt it recommended that you fix the random seed for reproducibility.\n\nArguments\n\nsamples::Int=10_000: Number of samples\nseed::Integer=rand(UInt64): Random seed\nverbose::Bool=false: Print progress\nthreaded::Bool=true: Use multi-threading\n\nReturns\n\nSequentialMonteCarlo: PRAS simulation specification\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Results.Shortfall","page":"Public API Reference","title":"PRASCore.Results.Shortfall","text":"Shortfall\n\nThe Shortfall result specification reports expectation-based resource adequacy risk metrics such as EUE and LOLE, producing a ShortfallResult.\n\nA 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.\n\nExample:\n\nshortfall, =\n assess(sys, SequentialMonteCarlo(samples=1000), Shortfall())\n\nperiod = ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")\n\n# Unserved energy mean and standard deviation\nsf_mean, sf_std = shortfall[\"Region A\", period]\n\n# System-wide risk metrics\neue = EUE(shortfall)\nlole = LOLE(shortfall)\n\n# Regional risk metrics\nregional_eue = EUE(shortfall, \"Region A\")\nregional_lole = LOLE(shortfall, \"Region A\")\n\n# Period-specific risk metrics\nperiod_eue = EUE(shortfall, period)\nperiod_lolp = LOLE(shortfall, period)\n\n# Region- and period-specific risk metrics\nperiod_eue = EUE(shortfall, \"Region A\", period)\nperiod_lolp = LOLE(shortfall, \"Region A\", period)\n\nSee ShortfallSamples for recording sample-level shortfall results.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Results.Surplus","page":"Public API Reference","title":"PRASCore.Results.Surplus","text":"Surplus\n\nThe Surplus result specification reports unused generation and storage discharge capability of Regions, producing a SurplusResult.\n\nA 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.\n\nExample:\n\nsurplus, =\n assess(sys, SequentialMonteCarlo(samples=1000), Surplus())\n\nsurplus_mean, surplus_std =\n surplus[\"Region A\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\n\nSee SurplusSamples for sample-level surplus results.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Results.Flow","page":"Public API Reference","title":"PRASCore.Results.Flow","text":"Flow\n\nThe Flow result specification reports the estimated average flow across transmission Interfaces, producing a FlowResult.\n\nA 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.\n\nExample:\n\nflows, =\n assess(sys, SequentialMonteCarlo(samples=1000), Flow())\n\nflow_mean, flow_std =\n flows[\"Region A\" => \"Region B\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\nflow2_mean, flow2_std =\n flows[\"Region B\" => \"Region A\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\n@assert flow_mean == -flow2_mean\n\nSee FlowSamples for sample-level flow results.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Results.Utilization","page":"Public API Reference","title":"PRASCore.Results.Utilization","text":"Utilization\n\nThe Utilization result specification reports the estimated average absolute utilization of Interfaces, producing a UtilizationResult.\n\nWhereas 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%.\n\nA 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\".\n\nExample:\n\nutils, =\n assess(sys, SequentialMonteCarlo(samples=1000), Utilization())\n\nutil_mean, util_std =\n utils[\"Region A\" => \"Region B\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\n\nutil2_mean, util2_std =\n utils[\"Region B\" => \"Region A\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\n\n@assert util_mean == util2_mean\n\nSee UtilizationSamples for sample-level utilization results.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Results.StorageEnergy","page":"Public API Reference","title":"PRASCore.Results.StorageEnergy","text":"StorageEnergy\n\nThe StorageEnergy result specification reports the average state of charge of Storages, producing a StorageEnergyResult.\n\nA 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.\n\nExample:\n\nstorenergy, =\n assess(sys, SequentialMonteCarlo(samples=1000), StorageEnergy())\n\nsoc_mean, soc_std =\n storenergy[\"MyStorage123\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\n\nSee StorageEnergySamples for sample-level storage states of charge.\n\nSee GeneratorStorageEnergy for average generator-storage states of charge.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Results.GeneratorStorageEnergy","page":"Public API Reference","title":"PRASCore.Results.GeneratorStorageEnergy","text":"GeneratorStorageEnergy\n\nThe GeneratorStorageEnergy result specification reports the average state of charge of GeneratorStorages, producing a GeneratorStorageEnergyResult.\n\nA 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.\n\nExample:\n\ngenstorenergy, =\n assess(sys, SequentialMonteCarlo(samples=1000), GeneratorStorageEnergy())\n\nsoc_mean, soc_std =\n genstorenergy[\"MyGeneratorStorage123\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\n\nSee GeneratorStorageEnergySamples for sample-level generator-storage states of charge.\n\nSee StorageEnergy for average storage states of charge.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Results.LOLE","page":"Public API Reference","title":"PRASCore.Results.LOLE","text":"LOLE\n\nLOLE 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).\n\nContains both the estimated value itself as well as the standard error of that estimate, which can be extracted with val and stderror, respectively.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Results.EUE","page":"Public API Reference","title":"PRASCore.Results.EUE","text":"EUE\n\nEUE reports expected unserved energy over a particular time period and regional extent.\n\nContains both the estimated value itself as well as the standard error of that estimate, which can be extracted with val and stderror, respectively.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#SiennaPRASInterface.generate_outage_profile","page":"Public API Reference","title":"SiennaPRASInterface.generate_outage_profile","text":"generate_outage_profile(pras_system,num_runs,psy_sys,num_scenarios,location)\n\nProcess the assess results to get timeseries of generator status and include this timeseries data to the corresponding component in PSY System and exported using to_json method (serializing the PSY System).\n\n...\n\nArguments\n\npras_system::PRASCore.SystemModel: PRAS System\nnum_runs::Int64: Number of PRAS runs\npsy_sys::PSY.System: PSY System\nnum_scenarios::Int64: Number of scenarios of user interest.\nlocation::String: Location to store outage profile. ...\n\nExamples\n\njulia> generate_outage_profile(results, pras_sys, psy_sys, 1)\nPSY System exported using to_json method in InfrastructureSystems\n\n\n\n\n\n","category":"function"},{"location":"api/public/#SiennaPRASInterface.generate_csv_outage_profile","page":"Public API Reference","title":"SiennaPRASInterface.generate_csv_outage_profile","text":"generate_outage_profile(pras_system,num_runs,psy_sys,num_scenarios,location)\n\nProcess the assess results to get timeseries of generator status and include this timeseries data to the corresponding component in PSY System and exported using to_json method (serializing the PSY System).\n\n...\n\nArguments\n\npras_system::PRASCore.SystemModel: PRAS System\nnum_runs::Int64: Number of PRAS runs\npsy_sys::PSY.System: PSY System\nnum_scenarios::Int64: Number of scenarios of user interest.\nlocation::String: Location to store outage profile. ...\n\nExamples\n\njulia> generate_outage_profile(results, pras_sys, psy_sys, 1)\nPSY System exported using to_json method in InfrastructureSystems\n\n\n\n\n\n","category":"function"},{"location":"api/public/#SiennaPRASInterface.add_csv_time_series!","page":"Public API Reference","title":"SiennaPRASInterface.add_csv_time_series!","text":"add_csv_time_series!(\n sys_DA,\n sys_RT,\n outage_csv_location::String;\n days_of_interest::Union{Nothing, UnitRange}=nothing,\n add_scenario::Union{Nothing, Int}=nothing,\n)\n\nGenerates outage profile for two stage PowerSimulation and adds availability time series data to Generators in PSY System from CSV files.\n\n\n\n\n\n","category":"function"},{"location":"api/public/#SiennaPRASInterface.add_csv_time_series_single_stage!","page":"Public API Reference","title":"SiennaPRASInterface.add_csv_time_series_single_stage!","text":"add_csv_time_series_single_stage!(\n sys_DA,\n outage_csv_location::String;\n days_of_interest::Union{Nothing, UnitRange}=nothing,\n add_scenario::Union{Nothing, Int}=nothing,\n)\n\nGenerates outage profile for single stage PowerSimulation and adds availability time series.\n\n\n\n\n\n","category":"function"},{"location":"api/public/#SiennaPRASInterface.make_generator_outage_draws!","page":"Public API Reference","title":"SiennaPRASInterface.make_generator_outage_draws!","text":"make_generator_outage_draws!(\n sys,\n initial_time::Dates.DateTime=nothing,\n resolution::TIMEPERIOD=nothing,\n steps::Int=nothing,\n horizon::Int=nothing,\n) where {TIMEPERIOD <: Dates.TimePeriod}\n\nAdds availability time series to the generators in the system.\n\nMain function to make generator outage draws.\n\n\n\n\n\n","category":"function"},{"location":"api/public/#PRASCore.Results.ShortfallSamples","page":"Public API Reference","title":"PRASCore.Results.ShortfallSamples","text":"ShortfallSamples\n\nThe ShortfallSamples result specification reports sample-level unserved energy outcomes, producing a ShortfallSamplesResult.\n\nA 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.\n\nExample:\n\nshortfall, =\n assess(sys, SequentialMonteCarlo(samples=10), ShortfallSamples())\n\nperiod = ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")\n\nsamples = shortfall[\"Region A\", period]\n\n@assert samples isa Vector{Float64}\n@assert length(samples) == 10\n\n# System-wide risk metrics\neue = EUE(shortfall)\nlole = LOLE(shortfall)\n\n# Regional risk metrics\nregional_eue = EUE(shortfall, \"Region A\")\nregional_lole = LOLE(shortfall, \"Region A\")\n\n# Period-specific risk metrics\nperiod_eue = EUE(shortfall, period)\nperiod_lolp = LOLE(shortfall, period)\n\n# Region- and period-specific risk metrics\nperiod_eue = EUE(shortfall, \"Region A\", period)\nperiod_lolp = LOLE(shortfall, \"Region A\", period)\n\nNote 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.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Results.SurplusSamples","page":"Public API Reference","title":"PRASCore.Results.SurplusSamples","text":"SurplusSamples\n\nThe SurplusSamples result specification reports sample-level unused generation and storage discharge capability of Regions, producing a SurplusSamplesResult.\n\nA SurplusSamplesResult can be indexed by region name and timestamp to retrieve a vector of sample-level surplus values in that region and timestep.\n\nExample:\n\nsurplus, =\n assess(sys, SequentialMonteCarlo(samples=10), SurplusSamples())\n\nsamples = surplus[\"Region A\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\n\n@assert samples isa Vector{Float64}\n@assert length(samples) == 10\n\nNote 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.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Results.FlowSamples","page":"Public API Reference","title":"PRASCore.Results.FlowSamples","text":"FlowSamples\n\nThe FlowSamples result specification reports the sample-level magnitude and direction of power flows across Interfaces, producing a FlowSamplesResult.\n\nA 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.\n\nExample:\n\nflows, =\n assess(sys, SequentialMonteCarlo(samples=10), FlowSamples())\n\nsamples = flows[\"Region A\" => \"Region B\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\n\n@assert samples isa Vector{Float64}\n@assert length(samples) == 10\n\nsamples2 = flows[\"Region B\" => \"Region A\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\n\n@assert samples == -samples2\n\nNote 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.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Results.UtilizationSamples","page":"Public API Reference","title":"PRASCore.Results.UtilizationSamples","text":"UtilizationSamples\n\nThe UtilizationSamples result specification reports the sample-level absolute utilization of Interfaces, producing a UtilizationSamplesResult.\n\nWhereas 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%.\n\nA 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\".\n\nExample:\n\nutils, =\n assess(sys, SequentialMonteCarlo(samples=10), UtilizationSamples())\n\nsamples =\n utils[\"Region A\" => \"Region B\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\n\n@assert samples isa Vector{Float64}\n@assert length(samples) == 10\n\nsamples2 =\n utils[\"Region B\" => \"Region A\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\n\n@assert samples == samples2\n\nNote 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.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Results.StorageEnergySamples","page":"Public API Reference","title":"PRASCore.Results.StorageEnergySamples","text":"StorageEnergySamples\n\nThe StorageEnergySamples result specification reports the sample-level state of charge of Storages, producing a StorageEnergySamplesResult.\n\nA 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.\n\nExample:\n\nstorenergy, =\n assess(sys, SequentialMonteCarlo(samples=10), StorageEnergySamples())\n\nsamples = storenergy[\"MyStorage123\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\n\n@assert samples isa Vector{Float64}\n@assert length(samples) == 10\n\nNote 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.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Results.GeneratorStorageEnergySamples","page":"Public API Reference","title":"PRASCore.Results.GeneratorStorageEnergySamples","text":"GeneratorStorageEnergySamples\n\nThe GeneratorStorageEnergySamples result specification reports the sample-level state of charge of GeneratorStorages, producing a GeneratorStorageEnergySamplesResult.\n\nA 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.\n\nExample:\n\ngenstorenergy, =\n assess(sys, SequentialMonteCarlo(samples=10), GeneratorStorageEnergySamples())\n\nsamples = genstorenergy[\"MyGeneratorStorage123\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\n\n@assert samples isa Vector{Float64}\n@assert length(samples) == 10\n\nNote 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.\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Results.GeneratorAvailability","page":"Public API Reference","title":"PRASCore.Results.GeneratorAvailability","text":"GeneratorAvailability\n\nThe GeneratorAvailability result specification reports the sample-level discrete availability of Generators, producing a GeneratorAvailabilityResult.\n\nA 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.\n\nExample:\n\ngenavail, =\n assess(sys, SequentialMonteCarlo(samples=10), GeneratorAvailability())\n\nsamples = genavail[\"MyGenerator123\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\n\n@assert samples isa Vector{Bool}\n@assert length(samples) == 10\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Results.GeneratorStorageAvailability","page":"Public API Reference","title":"PRASCore.Results.GeneratorStorageAvailability","text":"GeneratorStorageAvailability\n\nThe GeneratorStorageAvailability result specification reports the sample-level discrete availability of GeneratorStorages, producing a GeneratorStorageAvailabilityResult.\n\nA 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.\n\nExample:\n\ngenstoravail, =\n assess(sys, SequentialMonteCarlo(samples=10), GeneratorStorageAvailability())\n\nsamples = genstoravail[\"MyGenerator123\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\n\n@assert samples isa Vector{Bool}\n@assert length(samples) == 10\n\n\n\n\n\n","category":"type"},{"location":"api/public/#PRASCore.Results.LineAvailability","page":"Public API Reference","title":"PRASCore.Results.LineAvailability","text":"LineAvailability\n\nThe LineAvailability result specification reports the sample-level discrete availability of Lines, producing a LineAvailabilityResult.\n\nA 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.\n\nExample:\n\nlineavail, =\n assess(sys, SequentialMonteCarlo(samples=10), LineAvailability())\n\nsamples = lineavail[\"MyLine123\", ZonedDateTime(2020, 1, 1, 0, tz\"UTC\")]\n\n@assert samples isa Vector{Bool}\n@assert length(samples) == 10\n\n\n\n\n\n","category":"type"}] } diff --git a/dev/tutorials/intro_page/index.html b/dev/tutorials/intro_page/index.html index 74d9092..19eb3c1 100644 --- a/dev/tutorials/intro_page/index.html +++ b/dev/tutorials/intro_page/index.html @@ -1,2 +1,2 @@ -Tutorials · SiennaPRASInterface.jl
      +Tutorials · SiennaPRASInterface.jl