computeFB: Conversion of flow-based domains into an Antares model with...

View source: R/computeFB.R

computeFBR Documentation

Conversion of flow-based domains into an Antares model with fixed PTDF

Description

This function follows two steps: based on the list of flow-based domains given in input, it will calculate a standard shape (selection of sides, CAH or kmeans method depending on the sizeof the input) and will then project the real domains on this standard shape. The projection is computed using an optimisation algorithm aiming at minimising the volumetric error between the real domain and its projection. The function will then write in an output directory the standard shape (weights.txt), the projection result for each domain (second_member.txt) and an RDS object storing information on the projection and the errors. Reports can be written represening the real and modelled domains and the volumetric error between them.

Usage

computeFB(
  PTDF = system.file("testdata/2019-07-18ptdfraw.csv", package = "fbAntares"),
  outputName = paste0(getwd(), "/antaresInput"),
  reports = TRUE,
  areaName = "cwe_at",
  dayType = "All",
  hour = "All",
  clusteringDayType = "All",
  clusteringHours = "All",
  nbFaces = 75,
  verbose = 1,
  nbLines = 1e+05,
  maxiter = 15,
  thresholdIndic = 95,
  quad = F,
  hubDrop = list(NL = c("BE", "DE", "FR", "AT")),
  fixFaces = NULL,
  virtualFBarea = F,
  useVertices = T,
  seed = 123456,
  draw_range = c(-15000, 15000),
  other_ranges = NULL,
  uniform_volume_draw = FALSE
)

Arguments

PTDF

character, path leading to the flow-based domains (PTDF description) list. By default, this leads to an example file ("PTDF.csv", saved in the package). This must be a csv file containing the following columns (and column names):

  • Id_day : numeric, name of each day. Default in example id_day between 1 and 12.

  • Date : The date of the typical day

  • Period : numeric, hour of the day. Default in example period between 1 and 24 (1 is then between 00:00 and 01:00).

  • ptdfBE : numeric, PTDF coefficient of Belgium.

  • ptdfDE : numeric, PTDF coefficient of Germany.

  • ptdfFR : numeric, PTDF coefficient of France.

  • ptdfNL : numeric, PTDF coefficient of the Netherlands.

  • ptdfAT : numeric, PTDF coefficient of the Austria.

  • more ptdf if needed

  • ram : numeric, remaining available capacity in the critical branch (MW).

  • Class : character, class of typical day (ex WinterSe) (not necessary)

  • idDayType : numeric, name of each day. Default in example id_day between 1 and 12.

outputName

character, path/name of the output directory. By default, the value is a created directory named "antaresInput" in the current directory

reports

boolean, if TRUE, the function will write html reports (one per typical day). By default, the value is TRUE. However, the report can only be launched on data containing domains for each hour of the day. Therefore, the value is automatically set to false if the parameter hour is different of "All" or 1:24.

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 modify the csv file of the package and use the examples to write how your area work. The actual csv file is in the folder areaName of the package if you want to modify it or understand how it is written.

dayType

numeric, by default, the value is All. (optional) Vector of id_days to compute.

hour

numeric, by default, the value is All. (optional) vector of hours/periods to compute.

clusteringDayType

numeric, by default, the value is All. (optional) Typical days you want to choose for the faces selection.

clusteringHours

numeric, by default, the value is All. (optional) Hours you want to choose for the faces selection.

nbFaces

numeric, standard shape parameters: number of sides to select. By default, the value is 75

verbose

numeric, shows the logs in console. By default, the value is 1.

  • 0 : No log

  • 1 : Short log

  • 2 : Medium log

nbLines

numeric, number of halflines drawn for the distance computation, default 100 000

maxiter

numeric, maximum number of iteration on the optimization problem, default 15

thresholdIndic

numeric, minimum value of the validation indicator to stop, default 95 the optimization problem

quad

logical, quadratic problem or linear, default FALSE

hubDrop

list, list of hubs in the ptdf, with the ones which should sustracted to the others as the names of the arrays which themself contain the ones which be sustracted

fixFaces

data.table data.table if you want to use fix faces for the creation of the flowbased models. If you want to do it, the data.table has the following form : data.table(func = c("min", "min", "max", "min"), zone = c("BE", "FR", "DE", "DE")). func is the direction of the fix faces and zone is the area of this direction. If you give for example min and DE, there will be a fix face at the minimum import value of Germany.

virtualFBarea

logical If you want to use the new area format or not default is FALSE

useVertices

boolean, states whether vertices should be computed to increase the accuracy of projection

seed

numeric, value of the seed, default 123456

draw_range

numeric Range within which volume assessment is performed to check the quality of projection

other_ranges

list Optional named list of specific draw_ranges for some dimensions. The names of the elements are the name of the dimensions, and each element contains a two-element vectors specifying the range.

uniform_volume_draw

boolean Should the volume evaluation be performed based on a uniform point draw?

Examples

## Not run: 
# Compute models for all days and hours of a PTDF file, with no reports 
# automatically generated at the same time
computeFB(PTDF = system.file("testdata/2019-07-18ptdfraw.csv", package = "fbAntares"), 
reports = FALSE, areaName = "cwe_at", hubDrop = list(NL = c("BE", "DE", "FR", "AT")))

# Example using more arguments like the fixFaces
computeFB(PTDF = system.file("testdata/2019-07-18ptdfraw.csv", package = "fbAntares"), 
reports = FALSE, areaName = "cwe_at", hubDrop = list(NL = c("BE", "DE", "FR", "AT")),
nbFaces = 75, dayType = 1, clusteringHours = c(7:10, 17:19), nbLines = 50000, 
maxiter = 20, thresholdIndic = 95, fixFaces = data.table(func = "min", zone = "BE"))

# Example with the virtualFBarea
computeFB(PTDF = system.file("testdata/2019-07-18ptdfraw.csv", package = "fbAntares"), 
reports = FALSE, areaName = "cwe_at", hubDrop = list(NL = c("BE", "DE", "FR", "AT")),
virtualFBarea = TRUE)


## End(Not run)

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