calculate_metrics: Calculate and summarize loss of load probability metrics

Description Usage Arguments Details See Also Examples

View source: R/calculate_metrics.R

Description

Given a time data object, summarize probabilities into metrics. The function automatically applies these calculation for each scenario, level of aggregation and area.

Usage

1
calculate_metrics(time.data, outage.table, raw = FALSE, ...)

Arguments

time.data

Time series data formatted with format_timedata (must have a NetLoad column, see details)

outage.table

Outage table used in the lookup, created with outage_table

raw

Return summary metrics (FALSE, default) or raw hourly output (TRUE)

...

Additional parameters passed to sliding_window

Details

The time data object must have a column called NetLoad (see the examples for an easy method to generate it).

Summary metrics include daily loss-of-load expectation (LOLE), loss-of-load hours (LOLH), maximum LOLP (PeakLOLP) and expected unserved energy (EUE).

See Also

format_timedata and outage_table to create time.data and outage.table objects, respectively

sliding_window is used internally to extend time.data

calculate_elcc uses this function to calculate ELCC

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Create outage table with 200 5-MW units
gens <- data.frame(Capacity = rep(5, 200),
                   EFOR = rep(0.08, 200))
out.table <- outage_table(gens)

# Create random load and wind data and format
tdata <- data.frame(Time = 1:8760,
                    Load = runif(8760, 450, 850),
                    Wind = runif(8760, 0, 100))
td <- format_timedata(tdata)

# Get metrics for net load (load - wind)
td2 <- td
td2$NetLoad <- td2$Load - td2$Wind
calculate_metrics(td2, out.table)

# Get metrics for just load
td3 <- td
td3$NetLoad <- td3$Load - td3$Wind
calculate_metrics(td3, out.table)

# Get raw data (i.e., not summarized)
calculate_metrics(td2, out.table, raw = TRUE)

NREL/repra documentation built on May 7, 2019, 6:03 p.m.