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

View source: R/createFBTS.R

createFBTSR Documentation

Creation of time series of typical days for Antares studies

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 fbClust) 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

createFBTS(
  opts,
  probabilityMatrix,
  multiplier,
  firstDay,
  seed = 123456,
  silent = FALSE,
  outputPath = getwd(),
  calendar = system.file("calendar/calendar.txt", package = "fbAntares")
)

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 fbClust::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.

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 123456

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.

calendar

character, path to a txt files with two columns, a column Date in the format month-day and a column class with the classes associated to the dates (summer, winter and interSeason).

Examples


## Not run: 
library(antaresRead)
library(data.table)

matProb <- readRDS(system.file("testdata/MatProb.rds", package = "fbAntares"))

# 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, 71900, 61900))

# Set the path to Antares study inputs 
# Change it for the path of a study you have on your computer
opts <- antaresRead::setSimulationPath("../../Pour Julien/blop/MT_base_nucM2_2023/", 
simulation = 17)

# calendar
# first day identified based on the input data of the 
# Antares study designated by opts
firstDay <- identifyFirstDay(opts) 
# calendar in a csv file with all dates of one year and their classes
calendar <- system.file("calendar/calendar.txt", package = "fbAntares")

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

## End(Not run)
                 

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