plotNetPositionFB | R Documentation |
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.
plotNetPositionFB( data, dayType, hour, country1, country2, areaName = "cwe_at", fb_opts = antaresRead::simOptions(), filteringEmptyDomains = FALSE, nbMaxPt = 10000, palette = "rainbow", xlim = c(-12000, 12000), ylim = c(-12000, 12000) )
data |
|
dayType |
|
hour |
|
country1 |
|
country2 |
|
areaName |
|
fb_opts |
|
filteringEmptyDomains |
|
nbMaxPt |
|
palette |
|
xlim |
|
ylim |
|
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.
## Not run: # Choose an Antares study and import its output # Change the study path for the path of a study you have on your computer study <- "../../Pour Julien/blop/MT_base_nucM2_2023" opts <- antaresRead::setSimulationPath(study, 17) dta <- antaresRead::readAntares(areas = c("fr", "be", "de", "nl", "at"), links = c("be - de","be - fr","be - nl", "de - fr","de - nl", "at - de"), mcYears = 1:2, 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 = 3, hour = c(0, 19), country1 = "BE", country2 = "FR", areaName = "cwe_at", xlim = c(-10000, 10000), ylim = c(-10000, 10000)) dta2 <- antaresRead::readAntares(areas = c("fr", "be", "de", "nl"), links = c("be - de","be - fr","be - nl", "de - fr","de - nl"), mcYears = 1:2, select = c("LOLD", "UNSP. ENRG", "DTG MRG", "UNSP. ENRG", "BALANCE", "FLOW LIN."), opts = opts) # Change color palette and areaName plotNetPositionFB(fb_opts = opts, data = dta2, dayType = 3, hour = c(0, 19), country1 = "BE", country2 = "FR", palette = "topo.colors", areaName = "cwe") # plot a single idTime : the data is filtered beforehand # in this case all domains are plotted, also all are empty except one # change also country1 -> DE dta$areas <- dta$areas[timeId == 1] plotNetPositionFB(fb_opts = opts, data = dta, dayType = "all", hour = 0, country1 = "DE", country2 = "FR", areaName = "cwe_at") # 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 with DE AT and changing of axes limits plotNetPositionFB(fb_opts = opts, data = dta, dayType = "all", hour = 0, country1 = "AT", country2 = "DE", areaName = "cwe_at", filteringEmptyDomains = TRUE, xlim = c(-12000, 12000), ylim = c(-12000, 12000)) #### Example with the virtual area zz_flowbased ## If you gave virtualFBarea = TRUE in the function \link{computeFB}, ## the areas and links are built with a virtual area on the center. # Change the study path for the path of a study you have on your computer study <- "../Etude Antares/BP19_costs18_FB18_2023Virtual/" opts <- antaresRead::setSimulationPath(study, 5) dta <- antaresRead::readAntares(areas = c("fr", "be", "de", "nl", "at", "zz_flowbased"), links = c("be - zz_flowbased", "fr - zz_flowbased", "nl - zz_flowbased", "de - zz_flowbased", "at - zz_flowbased"), mcYears = 1:2, select = c("LOLD", "UNSP. ENRG", "DTG MRG", "UNSP. ENRG", "BALANCE", "FLOW LIN."), opts = opts) plotNetPositionFB(fb_opts = opts, data = dta, dayType = 6, hour = c(0, 19), country1 = "BE", country2 = "FR", areaName = "cwe_at", xlim = c(-10000, 10000), ylim = c(-10000, 10000)) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.