runAppPosition: Run a shiny application to visualise the flow-based typical...

View source: R/graphs.R

runAppPositionR Documentation

Run a shiny application to visualise the flow-based typical domains and the Net Positions reached within in an Antares simulation

Description

Run a shiny application displaying, after running an Antares simulation, how the domains have been used by the optimizer to fix the exchanges in the CWE area. The user can in the application select a period of time on a calendar, choose to only display some typical days and hours, change the colors palette, filter unused domains... (all the parameters of the function plotNetPositionFB). It is possible to filter the output data beforehand to only display situations with loss of load (see examples).

Usage

runAppPosition(
  dta,
  fb_opts = antaresRead::simOptions(),
  country_list = c("fr", "be", "de", "nl", "at"),
  areaName = "cwe_at"
)

Arguments

dta

antaresDataList Antares output data, imported with readAntares. It can be filtered (see examples).

fb_opts

list of simulation parameters returned by the function setSimulationPath or flow-based model directory obtained with setFlowbasedPath. By default, the value will be indicated by antaresRead::simOptions()

country_list

character Names of the countries used in the study

areaName

character The name of the area of your study, possible values are cwe_at (default), cwe and other. If you choose other, you have to give a csv file which explains how your area work.

Examples


## Not run: 
## Select a study and import the data
# 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, 18)
dta <- antaresRead::readAntares(areas = c("fr", "be", "de", "nl", "at"),
         links = c("be - de","be - fr","be - nl","de - fr","de - nl", "at - de"), 
         select = c("LOLD", "UNSP. ENRG", "DTG MRG", "UNSP. ENRG", "BALANCE", "FLOW LIN."), 
         mcYears = 1, opts = opts)

## Run the application
runAppPosition(dta, country_list = c("fr", "be", "de", "nl", "at"))

## Filter the data 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

 runAppPosition(dta)

## End(Not run)


rte-antares-rpackage/fbAntares documentation built on June 1, 2022, 6:20 p.m.