Description Usage Arguments Details Examples
This function is used after running an Antares simulation to visualize how the domains have been used by the optimizer to fix the exchanges in the CWE area. The user chooses one (or several) domain (typical day + hour) and the function will then filter the given Antares output data to only keep the times when this domain has been used and calculate the Net Position, inside the CWE area, of the 2 countries chosen as axis. A plot gathers then the domain(s) and the points representing the Net Positions in the same color. The user can choose whether to plot Net Positions before and/or after applying the adequacy patch.
1 2 3 4 |
data |
|
dayType |
|
hour |
|
country1 |
|
country2 |
|
fb_opts |
|
filteringEmptyDomains |
|
nbMaxPt |
|
drawPositionsBeforeAdqP |
|
drawPositionsAdqP |
|
palette |
|
The Antares output data must respect the antaresDataList
format (imported with readAntares). But it can be
filtered (see examples) to only keep days presenting unsupplied energy or a specific timeline.
In that case, choose the value 'all'
for the parameters dayType
and/or hour
and set the parameter
filteringEmptyDomains
as TRUE. The function will then filter by itself the domains which are not used.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | ## Not run:
# Choose an ANtares study and import its output
study <- "D:/Users/titorobe/Desktop/antaresStudy"
opts <- antaresRead::setSimulationPath(study, 2)
dta <- antaresRead::readAntares(areas = c("fr", "be", "de", "nl"),
links = c("be - de","be - fr","be - nl",
"de - fr","de - nl"), mcYears = 1:10,
select = c("LOLD", "UNSP. ENRG",
"DTG MRG", "UNSP. ENRG", "BALANCE", "FLOW LIN."),
opts = opts)
# plot the typical domain 1 at 00:00 and 19:00 and the matching output
# points of the study on the axis France-Belgium
plotNetPositionFB(fb_opts = opts,
data = dta,
dayType = 1, hour = c(0, 19),
country1 = "BE", country2 = "FR")
# Change color palette
plotNetPositionFB(fb_opts = opts,
data = dta,
dayType = 1, hour = c(0, 19),
country1 = "BE", country2 = "FR", palette = "topo.colors")
# plot a single idTime : the data is filtered beforehand
# in this case all domains are plotted, also all are empty except one
dta$areas <- dta$areas[timeId == 1]
plotNetPositionFB(fb_opts = opts,
data = dta,
dayType = "all", hour = 0,
country1 = "BE", country2 = "FR")
# Filtering empty domains : only the matching domain of timeid 1 will be drawn
plotNetPositionFB(fb_opts = opts,
data = dta,
dayType = "all", hour = 0,
country1 = "BE", country2 = "FR", filteringEmptyDomains = TRUE)
# Plot Net Positions with adequacy patch Net Positions
# Run adequacy patch on the output
dta_adq <- adqPatch(fb_opts = opts)
###### Filter on situations with unsupplied energy :
# If you want to keep only timeId with LOLD!=0 you can't use :
# dta$areas <- dta$areas[LOLD!=0] otherwise some areas
# Otherwise some areas are forgotten: the data must be filtered to
# keep all areas at specific timesteps.
## An exemple of authorized filter :
idC <- c(antaresRead::getIdCols(dta$areas))
idC <- idC[idC!="area"]
LOLD <- dta$areas[,lapply(.SD, sum), by = idC, .SDcols = "LOLD"]
LOLD <- LOLD[LOLD!=0]
LOLD[,LOLD := NULL]
# Merge to filter data
dta$areas <- merge(dta$areas, LOLD, by = idC)
## End filter
######
# Plot the positions, filtering empty domains. Only adequacy positions available.
plotNetPositionFB(fb_opts = opts,
data = dta_adq,
dayType = "all", hour = 19,
country1 = "BE", country2 = "FR", filteringEmptyDomains = TRUE)
# Plot the adequacy positions (only adequacy positions available),
# for domain typical day 6 and hour 17:00
plotNetPositionFB(fb_opts = opts,
data = dta_adq,
dayType = 6, hour = 17,
country1 = "DE", country2 = "FR")
# Plot the adequacy positions for domain typical day 6 and hour 17:00
plotNetPositionFB(fb_opts = opts,
data = dta_adq,
dayType = 6, hour = 17,
country1 = "BE", country2 = "FR", drawPositionsBeforeAdqP = FALSE)
# Plot the positions before adequacy patch for domain typical day 6
# and hour 17:00 : impossible because no data
plotNetPositionFB(fb_opts = opts,
data = dta_adq,
dayType = 6, hour = 17,
country1 = "BE", country2 = "FR", drawPositionsAdqP = FALSE)
# Calculate data containing both before and after adequacy patch
dta_complete <- adqPatch(fb_opts = opts, keepOldColumns = FALSE)
plotNetPositionFB(fb_opts = opts,
data = dta_complete,
dayType = 6, hour = 17,
country1 = "BE", country2 = "FR", filteringEmptyDomains = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.