createFBTS: Creation of time series of typical days for Antares studies

Description Usage Arguments Examples

View source: R/createFBTS.R

Description

This function defines for each studied day in an Antares study the most representative typical flow-based day, and finally creates daily time series. To establish this correlation, the inputs of the function must include a probability matrix (calculated for each set of typical days with the package flowBasedClustering) and the path to the Antares study to provide flow-based domains with. The probability matrix will be used to compute a weighted draw among the possible typical days.

Usage

1
2
3
createFBTS(opts, probabilityMatrix, multiplier, interSeasonBegin,
  interSeasonEnd, firstDay, seed = 4052017, silent = FALSE,
  outputPath = getwd())

Arguments

opts

list of simulation parameters returned by the function setSimulationPath. Link to the Antares study. By default, the value is antaresRead::simOptions()

probabilityMatrix

list, correlation between climatic factors and flow-based typical days, such as returned by flowBasedClustering::getProbability. The columns names must be renamed to match Antares' inputs, use the function setNamesProbabilityMatrix. Initial format is : area_variable (Ex: fr_load, de_solar ...)

multiplier

data.frame enabling to convert load factors or normalised values into production/consumption in MW. Two columns:

  • variable : Name of variable (ex: "fr@wind")

  • coef : mutiplier coefficient, for example the installed capacity.

interSeasonBegin

character or date, date or vector of dates, YYYY-MM-DD, begin of interseason

interSeasonEnd

character or date, date or vector of dates, YYYY-MM-DD, end of interseason

firstDay

numeric Type of the first day of the study (between 1 and 7). For example, if the first day is a Wednesday, you must specify firstDay = 3. The first day can be directly calculated by the function identifyFirstDay.

seed

numeric fixed random seed, used for the weighted draw of the typical days. By default, the value is 04052017.

silent

boolean, non display of a progress bar. By default, the value is FALSE.

outputPath

character, path of the folder where the time series of typical flow-based output file (ts.txt) will be written. The current directory is chosen by default.

Examples

 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
## Not run: 
library(antaresRead)
library(flowBasedClustering)
library(data.table)

# load climate daily time series
climate <- fread(system.file("dataset/climate_example.txt",package = "flowBasedClustering"))

# load clustering results (or build them with clusteringTypicalDays function())
clusterTD <- readRDS(system.file("dataset/cluster_example.RDS",package = "flowBasedClustering"))

levelsProba <- list(summerWd = list(FR_load = c(0.5), DE_wind = c(1/3, 2/3), DE_solar = .5),
                    summerWe = list(FR_load = c(0.5, 0.7), DE_wind = c(.5)),
                    interSeasonWd = list(FR_load = c(0.5, 0.6),
                                         DE_wind = c(1/3, 2/3),
                                         DE_solar = 0.3), 
                    
                    interSeasonWe = list(FR_load = c(0.5, 0.6),
                                         DE_wind = c(1/3, 2/3),
                                         DE_solar = 0.3))
matProb <- getProbability(climate, clusterTD,
 levelsProba = levelsProba, extrapolationNA = TRUE)


# Set the probabilityMatrix names and coefficients
matProb <- setNamesProbabilityMatrix(matProb, c("FR_load", "DE_wind", "DE_solar"),
                                   c("fr@load", "de@wind", "de@solar"))

multiplier <- data.frame(variable = c("fr@load", "de@wind", "de@solar"),
                         coef = c(1, 352250, 246403))

# Set the path to Antares study inputs 
opts <- antaresRead::setSimulationPath("D:/Users/titorobe/Desktop/antaresStudy", 1)

# calendar
# first day identified based on the input data of the 
# Antares study designated by opts
firstDay <- identifyFirstDay(opts) 
interSeasonBegin <- as.Date(c("2017-09-03", "2018-02-02"))
interSeasonEnd <- as.Date(c("2020-10-04", "2018-05-02"))

# Generate flow-based time series
ts <- createFBTS(opts = opts, probabilityMatrix = matProb, multiplier = multiplier,
                 interSeasonBegin = interSeasonBegin,
                 interSeasonEnd = interSeasonEnd, firstDay = firstDay, outputPath = getwd())

## End(Not run)
                 

rte-antares-rpackage/antaresFlowbased documentation built on Oct. 19, 2020, 11:23 a.m.