-
Notifications
You must be signed in to change notification settings - Fork 28
LOLD Implementation #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
akrivi
wants to merge
11
commits into
main
Choose a base branch
from
al/LOLD
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
LOLD Implementation #108
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
95b1c57
initial LOLD implementation
akrivi 1535791
add LOLD tests
akrivi 21dbe08
updates and more efficient LOLD implementation and tests
akrivi ef80290
add LOLD to JSON exports
akrivi f9225cf
add new docs page for metrics
akrivi f481eab
small docs fixes
akrivi 0f745b9
small docs fixes 2
akrivi f4854fc
small docs fixes 3
akrivi 9a795d1
better error handling for ShortfallResult
akrivi 8ea4394
addressing comments
akrivi 0c055a2
add LOLD metric test
akrivi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,143 @@ | ||
| # # Interpreting Resource Adequacy Metrics | ||
| # | ||
| # In practice, no single metric fully captures system adequacy. Instead, | ||
| # multiple complementary metrics should be considered together to understand | ||
| # the frequency, distribution and severity of shortfall events. | ||
| # ([NERC (2018)](https://www.nerc.com/globalassets/who-we-are/standing-committees/rstc/pawg/probabilistic_adequacy_and_measures_report.pdf), | ||
| # [EPRI](https://www.epri.com/research/products/3002027833), | ||
| # [Stephen et al. 2022](https://doi.org/10.1109/PMAPS53380.2022.9810615)). | ||
| # | ||
| # For this reason, PRAS provides multiple result specifications and derived | ||
| # metrics that allow different aspects of system risk to be evaluated | ||
| # consistently. | ||
|
|
||
| # ## Event-Based Interpretation | ||
| # | ||
| # Resource adequacy metrics can be understood by first defining three related concepts ([Stephen et al. 2022](https://doi.org/10.1109/PMAPS53380.2022.9810615)): | ||
| # | ||
| # - An **event-period** is a simulation time step in which a shortfall occurs. | ||
| # - An **event-day** is a day containing at least one event-period. | ||
| # - An **adequacy event** is a set of event-periods that are contiguous at the highest available temporal resolution. | ||
| # | ||
| # These distinctions are important because each resource adequacy metric counts a different quantity, | ||
| # corresponding directly to one of these concepts: | ||
| # | ||
| # - **LOLE** is the expected number of event-periods | ||
| # - **LOLD** is the expected number of event-days | ||
| # | ||
| # These metrics are related, but they are not interchangeable. | ||
| # | ||
| #md # !!! note | ||
| #md # In PRAS the time resolution of LOLE is determined by the | ||
| #md # simulation timestamps of the system and is not assumed to always be hourly. | ||
|
|
||
| # Another important reason to use multiple metrics, as described in | ||
| # ([Stephen et al. 2022](https://doi.org/10.1109/PMAPS53380.2022.9810615)), | ||
| # is that systems with similar shortfall magnitudes or counts of event-periods | ||
| # can exhibit very different temporal patterns. | ||
| # | ||
| # We can consider a simple example of two cases next: | ||
| # | ||
| # **Case A**: One day with 10 hours of shortfall | ||
| # | ||
| # **Case B**: Ten days with 1 hour of shortfall each | ||
| # | ||
| # | Metric | Case A | Case B | | ||
| # |------|--------|--------| | ||
| # | LOLE | same | same | | ||
| # | EUE | same | same | | ||
| # | LOLD | 1 | 10 | | ||
| # | ||
| # As we can see in the table above, even though LOLE and EUE are identical in this case, | ||
| # LOLD reveals that shortfall events are more dispersed in Case B. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a note that LOLD is only callable using Shortfallsamples? |
||
| # | ||
|
|
||
| # Because event-periods may be distributed across many days, a system with the | ||
| # same number of shortfall periods can have very different numbers of event-days. | ||
| # As a result, exact conversions between hourly and daily adequacy | ||
| # criteria are not generally possible | ||
| # ([Stephen et al. 2022](https://doi.org/10.1109/PMAPS53380.2022.9810615)). | ||
|
|
||
| # This behavior is reflected in PRAS results, where LOLE and LOLD provide | ||
| # complementary views of how shortfall events are distributed in time. | ||
|
|
||
| # ## Mathematical Interpretation | ||
| # | ||
| # In PRAS, adequacy metrics can be interpreted from Monte Carlo shortfall | ||
| # samples. | ||
| # | ||
| # Using the following notation: | ||
| # | ||
| # - ``r`` indexes regions | ||
| # - ``t`` indexes timestamps | ||
| # - ``d`` indexes calendar days | ||
| # - ``s`` indexes Monte Carlo samples | ||
| # - ``e`` indexes adequacy events | ||
| # - ``S_{r,t,s}`` denotes the shortfall in region ``r``, at timestamp ``t``, | ||
| # in Monte Carlo sample ``s`` | ||
| # - ``T(d)`` is the set of timestamps in day ``d`` | ||
| # | ||
| # the adequacy metrics can be expressed as expectations over Monte Carlo samples: | ||
| # | ||
| # ### LOLE | ||
| # | ||
| # LOLE counts the expected number of event-periods with shortfall: | ||
|
|
||
| # ```math | ||
| # \mathrm{LOLE} = | ||
| # \mathbb{E}\left[\sum_t | ||
| # \mathbf{1}\left(\sum_r S_{r,t,s} > 0\right)\right] | ||
| # ``` | ||
| # | ||
| # | ||
| # ### LOLD | ||
| # | ||
| # LOLD counts the expected number of days containing at least one shortfall: | ||
|
|
||
| # ```math | ||
| # \mathrm{LOLD} = \mathbb{E}\left[\sum_d I_{d,s}\right] | ||
| # ``` | ||
| # | ||
| # where: | ||
|
|
||
| # ```math | ||
| # I_{d,s} = | ||
| # \begin{cases} | ||
| # 1 & \text{if } \exists t \in T(d) \text{ such that } \sum_r S_{r,t,s} > 0 \\ | ||
| # 0 & \text{otherwise} | ||
| # \end{cases} | ||
| # ``` | ||
|
|
||
| # ## Analysis with PRAS | ||
| # | ||
| # We revisit the [RTS-GMLC](https://github.com/GridMod/RTS-GMLC) with increased system load to induce shortfall | ||
| # which was described in [PRAS walkthrough](@ref pras_walkthrough) | ||
|
|
||
| using PRAS | ||
| sys = PRAS.rts_gmlc() | ||
| sys.regions.load .+= 700.0 | ||
|
|
||
| shortfall_samples, = assess( | ||
| sys, | ||
| SequentialMonteCarlo(samples=100, seed=1), | ||
| ShortfallSamples(), | ||
| ) | ||
|
|
||
| # And print the metrics we discussed above: | ||
| println(LOLE(shortfall_samples)) | ||
| println(LOLD(shortfall_samples)) | ||
|
|
||
| # LOLE describes how many simulation periods experience shortfall, while LOLD | ||
| # describes how many days contain at least one such period. | ||
| # | ||
| # In the RTS example above, the system has approximately 85 shortfall hours | ||
| # but only 25.8 shortfall days. This indicates that shortfall events are | ||
| # temporally clustered, meaning that multiple shortfall hours tend to occur within the | ||
| # same day rather than being evenly distributed across the year. | ||
|
|
||
|
|
||
| # ## References | ||
| # | ||
| # - [NERC (2018), *Probabilistic Adequacy and Measures Technical Reference Report*](https://www.nerc.com/globalassets/who-we-are/standing-committees/rstc/pawg/probabilistic_adequacy_and_measures_report.pdf) | ||
| # - [EPRI, *Resource Adequacy Gap Assessment: Resource Adequacy Assessment Framework*](https://www.epri.com/research/products/3002027833) | ||
| # - [Stephen et al. (2022), *Clarifying the Interpretation and Use of the LOLE Resource Adequacy Metric*](https://doi.org/10.1109/PMAPS53380.2022.9810615) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.