Skip to content

ShortfallEvents and LOLEv Implementation - #106

Closed
akrivi wants to merge 12 commits into
NatLabRockies:mainfrom
akrivi:al/shortfallEvents
Closed

akrivi wants to merge 12 commits into
NatLabRockies:mainfrom
akrivi:al/shortfallEvents

Conversation

@akrivi

@akrivi akrivi commented May 4, 2026

Copy link
Copy Markdown
Collaborator

This PR adds a new ShortfallEvents result specification that records shortfall events directly during simulation.

We define an "adequacy event" as a set of event-periods that are contiguous at the highest available temporal resolution [1].
Events are recorded separately for each Monte Carlo sample at both system and regional levels.

ShortfallResult does not retain sufficient information to reconstruct individual events.
 At the same time, obtaining this information from ShortfallSamplesResult requires storing and postprocessing the full regions × timestamps × samples shortfall tensor.


ShortfallEvents instead stores event boundaries and accumulated unserved energy, avoiding that dense tensor, which provides a more compact representation for event analysis, particularly when shortfalls are sparse.

Screenshot 2026-09-06 at 14 29 20

The implementation adds the following metrics at both system and regional levels:

  1. LOLEv: the expected number of shortfall events per simulation horizon, estimated by averaging event counts across Monte Carlo samples [2].
  2. MeanEventDuration: mean duration across all recorded events.
  3. MaxEventDuration: maximum duration among all recorded events.
  4. MeanEventEnergy: mean unserved energy across all recorded events.
  5. MaxEventEnergy: maximum unserved energy among all recorded events.

With the implementation of LOLEv, all metrics defined in [2] are now included in PRAS.

Additionally, this PR extends PRASFiles to support JSON export of ShortfallEventsResult. This includes both aggregate event-level metrics and optionally raw event records at the system and regional levels.

Benchmarks

1) RTS-GMLC with 10× regional load: 3 regions, 8,784 hourly timesteps (2,000 MC samples, 6 threads)

The run recorded 2,000 system events and 6,000 regional events across all samples.

Result specification assess time (s) Max RSS (GB) Result size (MB)
ShortfallSamples() 3.513 1.514 421.843
ShortfallEvents() 3.455 0.669 2.131

2) 13-region system: 8,761 hourly timesteps (2,000 MC samples, 6 threads)

The run recorded 362 system events and 1,839 regional events across all samples.

Result specification assess time (s) Max RSS (GB) Result size (MB)
ShortfallSamples() 12.929 4.084 1,823.200
ShortfallEvents() 10.090 0.685 2.122

Note on Result size: ShortfallSamples stores every region-timestep-sample value, whereas ShortfallEvents stores event records plus per-sample bookkeeping. Both results also reference regional metadata.

Event storage is particularly compact when shortfalls are infrequent or persist across consecutive timesteps, while many separate short events can reduce or eliminate the size advantage.

[1] Stephen et al. (2022), "Clarifying the Interpretation and Use of the LOLE Resource Adequacy Metric"
[2] NERC (2018), "Probabilistic Adequacy and Measures Technical Reference Report"

@akrivi akrivi mentioned this pull request May 4, 2026
3 tasks
@akrivi akrivi changed the title ShortfallEvents Implementation ShortfallEvents and LOLEv Implementation Jun 6, 2026
@akrivi
akrivi force-pushed the al/shortfallEvents branch from 46aaa6d to 14edc4b Compare September 3, 2026 19:27
@sriharisundar

Copy link
Copy Markdown
Member

Closing in favor of #115

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants