Title: | Edit an 'Antares' Simulation |
---|---|
Description: | Edit an 'Antares' simulation before running it : create new areas, links, thermal clusters or binding constraints or edit existing ones. Update 'Antares' general & optimization settings. 'Antares' is an open source power system generator, more information available here : <https://antares-simulator.org/>. |
Authors: | Tatiana Vargas [aut, cre], Frederic Breant [ctb], Victor Perrier [ctb], Baptiste Seguinot [ctb], Benoit Thieurmel [ctb], Titouan Robert [ctb], Jalal-Edine Zawam [ctb], Etienne Sanchez [ctb], Janus De Bondt [ctb], Assil Mansouri [ctb], Abdallah Mahoudi [ctb], Clement Berthet [ctb], Kamel Kemiha [ctb], Nicolas Boitard [ctb], RTE [cph] |
Maintainer: | Tatiana Vargas <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.9.0 |
Built: | 2025-02-17 10:26:46 UTC |
Source: | https://github.com/rte-antares-rpackage/antareseditobject |
Edit area's parameters in API mode.
.api_command_execute_edit_area(name, new_values, type, opts)
.api_command_execute_edit_area(name, new_values, type, opts)
name |
Name of the area to edit. |
new_values |
Values of the parameters to edit. |
type |
Type of edition. |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
Format a value to a suitable format to rhs in an .ini file.
.format_ini_rhs(value)
.format_ini_rhs(value)
value |
The value to format. |
the formatted value
Generate playlist_year_weight section in the appropriate format.
.format_playlist_weights(weights, api_mode)
.format_playlist_weights(weights, api_mode)
weights |
data.table, 2 columns : mcYears and weights. Only with after antares V8 |
api_mode |
Boolean to identify an api study |
The playlist_year_weight section formatted.
Initialize links data for a new area. For disk mode only.
.initializeLinksArea(name, overwrite, opts)
.initializeLinksArea(name, overwrite, opts)
name |
Name of the area as a character, without punctuation except - and _. |
overwrite |
Overwrite the area if already exists. |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
Initialize renewables data for a new area. For disk mode only.
.initializeRenewablesArea(name, overwrite, opts)
.initializeRenewablesArea(name, overwrite, opts)
name |
Name of the area as a character, without punctuation except - and _. |
overwrite |
Overwrite the area if already exists. |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
Initialize thermal data for a new area. For disk mode only.
.initializeThermalArea(name, overwrite, economic_options, opts)
.initializeThermalArea(name, overwrite, economic_options, opts)
name |
Name of the area as a character, without punctuation except - and _. |
overwrite |
Overwrite the area if already exists. |
economic_options |
Economic options. |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
Split list nodalOptimization by target file.
.split_nodalOptimization_by_target(nodalOptimization)
.split_nodalOptimization_by_target(nodalOptimization)
nodalOptimization |
Nodal optimization parameters, see |
Helper to activate Renewables Energy Sources. This will
update renewable.generation.modelling
parameter and create
appropriate structure for RES clusters.
activateRES(opts = antaresRead::simOptions(), quietly = !interactive())
activateRES(opts = antaresRead::simOptions(), quietly = !interactive())
opts |
List of simulation parameters returned by the function
|
quietly |
Display or not a message to the user if success. |
An updated list containing various information about the simulation.
## Not run: library(antaresEditObject) tmp <- tempfile() createStudy(path = tmp) opts <- antaresRead::setSimulationPath(tmp) activateRES() # then you can use createClusterRES()... ## End(Not run)
## Not run: library(antaresEditObject) tmp <- tempfile() createStudy(path = tmp) opts <- antaresRead::setSimulationPath(tmp) activateRES() # then you can use createClusterRES()... ## End(Not run)
Activate st-storage in an Antares study
activateST(opts = antaresRead::simOptions(), quietly = !interactive())
activateST(opts = antaresRead::simOptions(), quietly = !interactive())
opts |
List of simulation parameters returned by the function
|
quietly |
Display or not a message to the user if success. |
An updated list containing various information about the simulation.
## Not run: library(antaresEditObject) tmp <- tempfile() createStudy(path = tmp) opts <- antaresRead::setSimulationPath(tmp) activateST() # then you can use createClusterST()... ## End(Not run)
## Not run: library(antaresEditObject) tmp <- tempfile() createStudy(path = tmp) opts <- antaresRead::setSimulationPath(tmp) activateST() # then you can use createClusterST()... ## End(Not run)
If timeId column exists, add a week number column. A week is 168 consecutive hours (= 24 * 7).
add_week_number_column_to_ts(xts)
add_week_number_column_to_ts(xts)
xts |
a data.table of time series type. |
the data.table xts with a new column week.
Adequacy patch parameters for creating an area
adequacyOptions(adequacy_patch_mode = "outside")
adequacyOptions(adequacy_patch_mode = "outside")
adequacy_patch_mode |
character, default to "outside" |
a named list
adequacyOptions()
adequacyOptions()
API methods
api_patch(opts, endpoint, ..., default_endpoint = "v1/studies")
api_patch(opts, endpoint, ..., default_endpoint = "v1/studies")
opts |
Antares simulation options or a |
endpoint |
API endpoint to interrogate, it will be added after |
... |
Additional arguments passed to API method ( |
default_endpoint |
Default endpoint to use. |
Response from the API.
## Not run: # Simple example to update st-storages properties # read existing study opts <- setSimulationPath("path_to_the_study", "input") # make list of properties prop <- list(efficiency = 0.5, reservoircapacity = 350, initialleveloptim = TRUE) # convert to JSON body <- jsonlite::toJSON(prop, auto_unbox = TRUE) # send to server (see /apidoc) api_patch(opts = opts, endpoint = file.path(opts$study_id, "areas", area, "storages", cluster_name), body = body, encode = "raw") ## End(Not run)
## Not run: # Simple example to update st-storages properties # read existing study opts <- setSimulationPath("path_to_the_study", "input") # make list of properties prop <- list(efficiency = 0.5, reservoircapacity = 350, initialleveloptim = TRUE) # convert to JSON body <- jsonlite::toJSON(prop, auto_unbox = TRUE) # send to server (see /apidoc) api_patch(opts = opts, endpoint = file.path(opts$study_id, "areas", area, "storages", cluster_name), body = body, encode = "raw") ## End(Not run)
Save an Antares Study or only inputs in a .tar.gz
or .zip
file
backupStudy( backupfile, what = "study", opts = antaresRead::simOptions(), extension = ".zip" )
backupStudy( backupfile, what = "study", opts = antaresRead::simOptions(), extension = ".zip" )
backupfile |
Name of the backup, without extension. If missing,
either the name of the study or 'input' according argument |
what |
Which folder to save, |
opts |
List of simulation parameters returned by the function
|
extension |
Defaut is |
The path of the backup
## Not run: backupStudy() ## End(Not run)
## Not run: backupStudy() ## End(Not run)
For a given area, check consistency between reservoir and reservoir capacity values
check_consistency_reservoir_values(area, new_data, prev_data)
check_consistency_reservoir_values(area, new_data, prev_data)
area |
The area where to run the check. |
new_data |
The new list of parameters. |
prev_data |
The previous data found in hydro.ini. |
At each weekly/monthly/annual time step, mingen must be less or equal than hydro storage.
check_mingen_vs_hydro_storage(area, opts = antaresRead::simOptions())
check_mingen_vs_hydro_storage(area, opts = antaresRead::simOptions())
area |
The area where to check the data. |
opts |
List of simulation parameters returned by the function
|
a list containing the boolean if the check is ok and the message to display.
Function called only for an Antares version >= 860.
At each hourly time step, mingen must be less or equal than generatingMaxPower.
check_mingen_vs_maxpower(area, opts = antaresRead::simOptions())
check_mingen_vs_maxpower(area, opts = antaresRead::simOptions())
area |
The area where to check the data. |
opts |
List of simulation parameters returned by the function
|
a list containing the boolean if the check is ok and the message to display.
Function called only for an Antares version >= 860.
Is study an Antares v7 study ?
is_antares_v7(opts = antaresRead::simOptions()) is_antares_v820(opts = antaresRead::simOptions())
is_antares_v7(opts = antaresRead::simOptions()) is_antares_v820(opts = antaresRead::simOptions())
opts |
List of simulation parameters returned by the function
|
a logical, TRUE
if study is v7 or above, FALSE
otherwise.
## Not run: # setSimulationPath is_antares_v7() ## End(Not run)
## Not run: # setSimulationPath is_antares_v7() ## End(Not run)
Check if it remains trace of a deleted area in the input folder
checkRemovedArea(area, all_files = TRUE, opts = antaresRead::simOptions())
checkRemovedArea(area, all_files = TRUE, opts = antaresRead::simOptions())
area |
An area |
all_files |
Check files in study directory. |
opts |
List of simulation parameters returned by the function
|
a named list with two elements
## Not run: checkRemovedArea("myarea") ## End(Not run)
## Not run: checkRemovedArea("myarea") ## End(Not run)
Clean up output based on geographic trimming
cleanUpOutput(areas = NULL, opts = simOptions())
cleanUpOutput(areas = NULL, opts = simOptions())
areas |
Character. vector of areas (folders). Links will also be cleaned based on getLinks() results |
opts |
List. simulation options |
Compute daily, weekly, monthly and annual mc-ind from hourly data multiyear. (new)
computeOtherFromHourlyMulti( opts = simOptions(), areas = "all", type = c("areas", "links", "clusters"), timeStep = c("daily", "monthly", "annual", "weekly"), mcYears = simOptions()$mcYears, writeOutput = FALSE, nbcl = 8, verbose = FALSE )
computeOtherFromHourlyMulti( opts = simOptions(), areas = "all", type = c("areas", "links", "clusters"), timeStep = c("daily", "monthly", "annual", "weekly"), mcYears = simOptions()$mcYears, writeOutput = FALSE, nbcl = 8, verbose = FALSE )
opts |
study opts |
areas |
vector of areas |
type |
type of aggregation |
timeStep |
timestep of aggregation (daily, monthly and annual, NO weekly) |
mcYears |
vector of years to compute |
writeOutput |
boolean to write data in mc-ind folder |
nbcl |
number of cpu cores for parallelization |
verbose |
logical for printing output |
Recommended only with studies spanning on two years.
Compute daily, weekly, monthly and annual mc-ind from hourly data for one year. (new)
computeOtherFromHourlyYear( mcYear, type, areas = "all", opts = simOptions(), timeStep = c("daily", "monthly", "annual", "weekly"), writeOutput = FALSE )
computeOtherFromHourlyYear( mcYear, type, areas = "all", opts = simOptions(), timeStep = c("daily", "monthly", "annual", "weekly"), writeOutput = FALSE )
mcYear |
vector of years to compute |
type |
type of data (areas, links, clusters, clustersRes) |
areas |
vector of areas. links type will use getLinks() to get data. |
opts |
study opts |
timeStep |
timestep of aggregation (daily, monthly and annual, NO weekly) |
writeOutput |
boolean to write data in mc-ind folder |
Recommended only with studies spanning on two years.
Compute daily, weekly, monthly and annual mc-ind from hourly data.
computeTimeStampFromHourly( opts, mcYears = "all", nbcl = 8, verbose = 1, type = c("areas", "links", "clusters") )
computeTimeStampFromHourly( opts, mcYears = "all", nbcl = 8, verbose = 1, type = c("areas", "links", "clusters") )
opts |
opts simulation path. |
mcYears |
mcYears to compute. |
nbcl |
number of thread for parallel computing. |
verbose |
verbose for execution. |
type |
type of file to compute. |
Deprecated on studies v8 or higher.
## Not run: library(antaresEditObject) opts <- setSimulationPath("my_study") computeTimeStampFromHourly(opts) ## End(Not run)
## Not run: library(antaresEditObject) opts <- setSimulationPath("my_study") computeTimeStampFromHourly(opts) ## End(Not run)
Use this function to load config.yml used in older Antares versions for adequacy patch. Areas in config will be updated to be included in adequacy patch perimeter.
convertConfigToAdq(opts = simOptions(), path = "default")
convertConfigToAdq(opts = simOptions(), path = "default")
opts |
List. study options. |
path |
Character. path to config.yml. Default points to "/user/adequacypatch/" in study |
Copy of the output files of an Antares study.
copyOutput(opts, extname, mcYears = "all")
copyOutput(opts, extname, mcYears = "all")
opts |
List of simulation parameters returned by the function
|
extname |
Extension to be added to the name of the study, to be used as a name for the newly created folder. |
mcYears |
mcYears to copy. Can be |
## Not run: library(antaresRead) # Set simulation path opts = setSimulationPath(path = "PATH/TO/SIMULATION", simulation = "input") # Create a new area copyOutput(opts, "_adq") ## End(Not run)
## Not run: library(antaresRead) # Set simulation path opts = setSimulationPath(path = "PATH/TO/SIMULATION", simulation = "input") # Create a new area copyOutput(opts, "_adq") ## End(Not run)
Copy study from an existing workspace into a managed study. NOTE : The study must be present in a workspace (DRD, PPSE..) not just locally.
copyStudyWeb( opts = antaresRead::simOptions(), host, token, outputs = T, groups = NULL, suffix = "managedCopy" )
copyStudyWeb( opts = antaresRead::simOptions(), host, token, outputs = T, groups = NULL, suffix = "managedCopy" )
opts |
List of simulation parameters returned by the function |
host |
Host of AntaREST server API. |
token |
API personnal access token. |
outputs |
Logical. Determine if outputs are copied too. |
groups |
Character. Add study to groups of Antares Web. |
suffix |
Character. default is "managedCopy" By default the new study will be : studyname_managedCopy |
New managed study ID
Create the correspondence data frame between the symbol and the type in scenario builder
create_scb_referential_series_type()
create_scb_referential_series_type()
a data.frame
.
Create study on disk or with AntaREST server through the API.
createStudy(path, study_name = "my_study", antares_version = "8.2.0") createStudyAPI( host, token = NULL, study_name = "my_study", antares_version = "8.2.0", ... )
createStudy(path, study_name = "my_study", antares_version = "8.2.0") createStudyAPI( host, token = NULL, study_name = "my_study", antares_version = "8.2.0", ... )
path |
Path where to create study, it should be an empty directory, if it doesn't exist, it'll be created. |
study_name |
Name of the study. |
antares_version |
Antares number version. |
host |
Host of AntaREST server API. |
token |
API personnal access token. |
... |
Other query parameters passed to POST request. |
Result of antaresRead::setSimulationPath()
or antaresRead::setSimulationPathAPI()
accordingly.
From Antares version 9.0 onwards, versioning is only done with one number for the major version number and a two-digit number for the minor version number (e.g. 9.0, 9.12, 10.58, ...).
## Not run: # with default values createStudy("path/to/simulation", study_name = "my_study", antares_version = "8.2.0") # with Antares study version >= 9 (max 2 digits, ex : "9.15") createStudy("path/to/simulation", study_name = "my_study", antares_version = "9.15") ## End(Not run)
## Not run: # with default values createStudy("path/to/simulation", study_name = "my_study", antares_version = "8.2.0") # with Antares study version >= 9 (max 2 digits, ex : "9.15") createStudy("path/to/simulation", study_name = "my_study", antares_version = "9.15") ## End(Not run)
Create a new area in an Antares study.
createArea( name, color = grDevices::rgb(230, 108, 44, max = 255), localization = c(0, 0), nodalOptimization = nodalOptimizationOptions(), filtering = filteringOptions(), adequacy = adequacyOptions(), overwrite = FALSE, opts = antaresRead::simOptions() )
createArea( name, color = grDevices::rgb(230, 108, 44, max = 255), localization = c(0, 0), nodalOptimization = nodalOptimizationOptions(), filtering = filteringOptions(), adequacy = adequacyOptions(), overwrite = FALSE, opts = antaresRead::simOptions() )
name |
Name of the area as a character, without punctuation except - and _. |
color |
Color of the node |
localization |
Localization on the map |
nodalOptimization |
Nodal optimization parameters, see |
filtering |
Filtering parameters, see |
adequacy |
Adequacy parameters, see |
overwrite |
Overwrite the area if already exist. |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
## Not run: library(antaresRead) # Set simulation path setSimulationPath(path = "PATH/TO/SIMULATION", simulation = "input") # Create a new area createArea("fictive_area") ## End(Not run)
## Not run: library(antaresRead) # Set simulation path setSimulationPath(path = "PATH/TO/SIMULATION", simulation = "input") # Create a new area createArea("fictive_area") ## End(Not run)
Create a new binding constraint in an Antares study.
createBindingConstraint( name, id = tolower(name), values = NULL, enabled = TRUE, timeStep = c("hourly", "daily", "weekly"), operator = c("both", "equal", "greater", "less"), filter_year_by_year = "hourly, daily, weekly, monthly, annual", filter_synthesis = "hourly, daily, weekly, monthly, annual", coefficients = NULL, group = NULL, overwrite = FALSE, opts = antaresRead::simOptions() )
createBindingConstraint( name, id = tolower(name), values = NULL, enabled = TRUE, timeStep = c("hourly", "daily", "weekly"), operator = c("both", "equal", "greater", "less"), filter_year_by_year = "hourly, daily, weekly, monthly, annual", filter_synthesis = "hourly, daily, weekly, monthly, annual", coefficients = NULL, group = NULL, overwrite = FALSE, opts = antaresRead::simOptions() )
name |
The name for the binding constraint. |
id |
An id, default is to use the name. |
values |
Values used by the constraint. It contains one line per time step and three columns "less", "greater" and "equal" (see documentation below if you're using version study >= v8.7.0) |
enabled |
Logical, is the constraint enabled ? |
timeStep |
Time step the constraint applies to : |
operator |
Type of constraint: equality, inequality on one side or both sides. |
filter_year_by_year |
Marginal price granularity for year by year |
filter_synthesis |
Marginal price granularity for synthesis |
coefficients |
A named list containing the coefficients used by the constraint, the coefficients have to be alphabetically ordered see examples below for entering weight or weight with offset. |
group |
"character" group of the constraint, default value : "default group" |
overwrite |
If the constraint already exist, overwrite the previous value. |
opts |
List of simulation parameters returned by the function
|
According to Antares version, usage may vary :
< v8.7.0 : For each constraint name, a .txt file containing 3 time series "less", "greater", "equal"
>= v8.7.0 : For each constraint name, one file .txt containing <id>_lt.txt, <id>_gt.txt, <id>_eq.txt
Parameter values
must be named list
("lt", "gt", "eq") containing data.frame
scenarized.
see example section below.
An updated list containing various information about the simulation.
Other binding constraints functions:
createBindingConstraintBulk()
,
editBindingConstraint()
,
removeBindingConstraint()
## Not run: # < v8.7.0 : # Create constraints with multi coeffs (only weight) createBindingConstraint( name = "myconstraint", values = matrix(data = rep(0, 8760 * 3), ncol = 3), enabled = FALSE, timeStep = "hourly", operator = "both", coefficients = list("area1%area2" = 1, "area1%area3" = 2) ) # Create constraints with multi coeffs + offset createBindingConstraint( name = "myconstraint", values = matrix(data = rep(0, 8760 * 3), ncol = 3), enabled = FALSE, timeStep = "hourly", operator = "both", coefficients = list("area1%area2" = "1%1", "area1%area3" = "2%3") ) # >= v8.7.0 : # values are now named list containing `data.frame` according to # `operator` parameter (for "less", build a list with at least "lt" floor in list) # data values (hourly) df <- matrix(data = rep(0, 8760 * 3), ncol = 3) values_data <- list(lt=df) # create bc with minimum value createBindingConstraint(name = "bc_example", operator = "less", values = values_data, overwrite = TRUE) # or you can provide list data with all value values_data <- list(lt=df, gt= df, eq= df) createBindingConstraint(name = "bc_example", operator = "less", values = values_data, overwrite = TRUE) ## End(Not run)
## Not run: # < v8.7.0 : # Create constraints with multi coeffs (only weight) createBindingConstraint( name = "myconstraint", values = matrix(data = rep(0, 8760 * 3), ncol = 3), enabled = FALSE, timeStep = "hourly", operator = "both", coefficients = list("area1%area2" = 1, "area1%area3" = 2) ) # Create constraints with multi coeffs + offset createBindingConstraint( name = "myconstraint", values = matrix(data = rep(0, 8760 * 3), ncol = 3), enabled = FALSE, timeStep = "hourly", operator = "both", coefficients = list("area1%area2" = "1%1", "area1%area3" = "2%3") ) # >= v8.7.0 : # values are now named list containing `data.frame` according to # `operator` parameter (for "less", build a list with at least "lt" floor in list) # data values (hourly) df <- matrix(data = rep(0, 8760 * 3), ncol = 3) values_data <- list(lt=df) # create bc with minimum value createBindingConstraint(name = "bc_example", operator = "less", values = values_data, overwrite = TRUE) # or you can provide list data with all value values_data <- list(lt=df, gt= df, eq= df) createBindingConstraint(name = "bc_example", operator = "less", values = values_data, overwrite = TRUE) ## End(Not run)
createBindingConstraintBulk(constraints, opts = antaresRead::simOptions())
createBindingConstraintBulk(constraints, opts = antaresRead::simOptions())
constraints |
A |
opts |
List of simulation parameters returned by the function
|
According to Antares version, usage may vary :
>= v8.7.0 :
For each constraint name, one file .txt containing <id>_lt.txt, <id>_gt.txt, <id>_eq.txt
.
Parameter values
must be named list
("lt", "gt", "eq") containing data.frame
scenarized.
Add parameter group
in input list constraints
see example section below.
An updated list containing various information about the simulation.
Other binding constraints functions:
createBindingConstraint()
,
editBindingConstraint()
,
removeBindingConstraint()
## Not run: # For Study version < v8.7.0 # Create multiple constraints # Prepare data for constraints bindings_constraints <- lapply( X = seq_len(100), FUN = function(i) { # use arguments of createBindingConstraint() # all arguments must be provided ! list( name = paste0("constraints", i), id = paste0("constraints", i), values = matrix(data = rep(0, 8760 * 3), ncol = 3), enabled = FALSE, timeStep = "hourly", operator = "both", coefficients = list("area1%area2" = 1), overwrite = TRUE ) } ) # create all constraints createBindingConstraintBulk(bindings_constraints) # For Study version >= v8.7.0 (add parameter `group`) # data values (hourly) df <- matrix(data = rep(0, 8760 * 3), ncol = 3) values_data <- list(lt=df, gt= df) # create multiple constraints bindings_constraints <- lapply( X = seq_len(10), FUN = function(i) { # use arguments of createBindingConstraint() # all arguments must be provided ! list( name = paste0("constraints_bulk", i), id = paste0("constraints_bulk", i), values = values_data, enabled = FALSE, timeStep = "hourly", operator = "both", coefficients = list("at%fr" = 1), group= "group_bulk", overwrite = TRUE ) } ) createBindingConstraintBulk(bindings_constraints) ## End(Not run)
## Not run: # For Study version < v8.7.0 # Create multiple constraints # Prepare data for constraints bindings_constraints <- lapply( X = seq_len(100), FUN = function(i) { # use arguments of createBindingConstraint() # all arguments must be provided ! list( name = paste0("constraints", i), id = paste0("constraints", i), values = matrix(data = rep(0, 8760 * 3), ncol = 3), enabled = FALSE, timeStep = "hourly", operator = "both", coefficients = list("area1%area2" = 1), overwrite = TRUE ) } ) # create all constraints createBindingConstraintBulk(bindings_constraints) # For Study version >= v8.7.0 (add parameter `group`) # data values (hourly) df <- matrix(data = rep(0, 8760 * 3), ncol = 3) values_data <- list(lt=df, gt= df) # create multiple constraints bindings_constraints <- lapply( X = seq_len(10), FUN = function(i) { # use arguments of createBindingConstraint() # all arguments must be provided ! list( name = paste0("constraints_bulk", i), id = paste0("constraints_bulk", i), values = values_data, enabled = FALSE, timeStep = "hourly", operator = "both", coefficients = list("at%fr" = 1), group= "group_bulk", overwrite = TRUE ) } ) createBindingConstraintBulk(bindings_constraints) ## End(Not run)
(thermal clusters only)
Create a new thermal or RES (renewable energy source) cluster.
createCluster( area, cluster_name, group = "Other", ..., list_pollutants = NULL, time_series = NULL, prepro_data = NULL, prepro_modulation = NULL, add_prefix = TRUE, overwrite = FALSE, opts = antaresRead::simOptions() ) createClusterRES( area, cluster_name, group = "Other RES 1", ..., time_series = NULL, add_prefix = TRUE, overwrite = FALSE, opts = antaresRead::simOptions() )
createCluster( area, cluster_name, group = "Other", ..., list_pollutants = NULL, time_series = NULL, prepro_data = NULL, prepro_modulation = NULL, add_prefix = TRUE, overwrite = FALSE, opts = antaresRead::simOptions() ) createClusterRES( area, cluster_name, group = "Other RES 1", ..., time_series = NULL, add_prefix = TRUE, overwrite = FALSE, opts = antaresRead::simOptions() )
area |
The area where to create the cluster. |
cluster_name |
Name for the cluster, it will prefixed by area name, unless you set |
group |
Group of the cluster, depends on cluster type:
|
... |
Parameters to write in the Ini file. Careful!
Some parameters must be set as |
list_pollutants |
|
time_series |
the "ready-made" 8760-hour time-series available for simulation purposes. |
prepro_data |
Pre-process data, a |
prepro_modulation |
Pre-process modulation, a |
add_prefix |
If |
overwrite |
Logical, overwrite the cluster or not. |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
Parameter list_pollutants
is only available for Antares studies >= v8.6.0.
You must provide named list
(numerical values or NULL ) :
list( "nh3"= 0.25, "nox"= 0.45, "pm2_5"= 0.25, "pm5"= 0.25, "pm10"= 0.25, "nmvoc"= 0.25, "so2"= 0.25, "op1"= 0.25, "op2"= 0.25, "op3"= 0.25, "op4"= 0.25, "op5"= NULL, "co2"= NULL)
editCluster()
or editClusterRES()
to edit existing clusters, removeCluster()
or removeClusterRES()
to remove clusters.
## Not run: library(antaresRead) library(antaresEditObject) # Create a cluster : createCluster( area = "fr", cluster_name = "my_cluster", group = "other", unitcount = 1L, # or as.integer(1) marginal_cost = 50 ) # by default, cluster name is prefixed # by the area name levels(readClusterDesc()$cluster) # > "fr_my_cluster" # To prevent this, use `add_prefix` createCluster( area = "fr", cluster_name = "my_cluster", add_prefix = FALSE, group = "other", marginal_cost = 50 ) levels(readClusterDesc()$cluster) # > "my_cluster" # Create a RES cluster : createClusterRES( area = "fr", cluster_name = "my_cluster_res", group = "other", unitcount = 1L, # or as.integer(1) nominalcapacity = 50, ts_interpretation = "power-generation" ) # You can also specify that the Time-Series of the RES cluster are # production factors : createClusterRES( area = "fr", cluster_name = "my_cluster_res", group = "other", unitcount = 1L, # or as.integer(1) nominalcapacity = 50, ts_interpretation = "production-factor" ) # Pre-process data : # this is the default data : createCluster( area = "fr", cluster_name = "my_cluster", prepro_data = matrix( data = c(rep(1, times = 365 * 2), rep(0, times = 365 * 4)), ncol = 6 ) ) # with a data.frame createCluster( area = "fr", cluster_name = "my_cluster", prepro_data = data.frame( v1 = rep(7, 365), # column name does not matter v2 = rep(27, 365), v3 = rep(0.05, 365), v4 = rep(0.12, 365), v5 = rep(0, 365), v6 = rep(1, 365) ) ) # Pre-process modulation : # this is the default data createCluster( area = "fr", cluster_name = "my_cluster", prepro_modulation = matrix( data = c(rep(1, times = 365 * 24 * 3), rep(0, times = 365 * 24 * 1)), ncol = 4 ) ) # with a data.frame createCluster( area = "fr", cluster_name = "my_cluster", prepro_modulation = data.frame( var1 = rep(0, 8760), # column name does not matter var2 = rep(1, 8760), var3 = rep(0, 8760), var4 = rep(1, 8760) ) ) ## End(Not run)
## Not run: library(antaresRead) library(antaresEditObject) # Create a cluster : createCluster( area = "fr", cluster_name = "my_cluster", group = "other", unitcount = 1L, # or as.integer(1) marginal_cost = 50 ) # by default, cluster name is prefixed # by the area name levels(readClusterDesc()$cluster) # > "fr_my_cluster" # To prevent this, use `add_prefix` createCluster( area = "fr", cluster_name = "my_cluster", add_prefix = FALSE, group = "other", marginal_cost = 50 ) levels(readClusterDesc()$cluster) # > "my_cluster" # Create a RES cluster : createClusterRES( area = "fr", cluster_name = "my_cluster_res", group = "other", unitcount = 1L, # or as.integer(1) nominalcapacity = 50, ts_interpretation = "power-generation" ) # You can also specify that the Time-Series of the RES cluster are # production factors : createClusterRES( area = "fr", cluster_name = "my_cluster_res", group = "other", unitcount = 1L, # or as.integer(1) nominalcapacity = 50, ts_interpretation = "production-factor" ) # Pre-process data : # this is the default data : createCluster( area = "fr", cluster_name = "my_cluster", prepro_data = matrix( data = c(rep(1, times = 365 * 2), rep(0, times = 365 * 4)), ncol = 6 ) ) # with a data.frame createCluster( area = "fr", cluster_name = "my_cluster", prepro_data = data.frame( v1 = rep(7, 365), # column name does not matter v2 = rep(27, 365), v3 = rep(0.05, 365), v4 = rep(0.12, 365), v5 = rep(0, 365), v6 = rep(1, 365) ) ) # Pre-process modulation : # this is the default data createCluster( area = "fr", cluster_name = "my_cluster", prepro_modulation = matrix( data = c(rep(1, times = 365 * 24 * 3), rep(0, times = 365 * 24 * 1)), ncol = 4 ) ) # with a data.frame createCluster( area = "fr", cluster_name = "my_cluster", prepro_modulation = data.frame( var1 = rep(0, 8760), # column name does not matter var2 = rep(1, 8760), var3 = rep(0, 8760), var4 = rep(1, 8760) ) ) ## End(Not run)
For each area, the thermal cluster data are generated :
Writing .ini
files
Writing time_series files
Writing prepro_data files
Writing prepro_modulation files
createClusterBulk( cluster_object, area_zone, add_prefix = TRUE, opts = antaresRead::simOptions() )
createClusterBulk( cluster_object, area_zone, add_prefix = TRUE, opts = antaresRead::simOptions() )
cluster_object |
|
area_zone |
|
add_prefix |
|
opts |
List of simulation parameters returned by the function
|
see the example to write a cluster object,
see the original function createCluster()
Structure of cluster_object
:
The list must be structured with named items
parameter
: list
of paramaters to write in .ini file
overwrite
: logical
to choose to overwrite an existing cluster (if not present, set to FALSE
)
time_series
: matrix
or data.frame
the "ready-made" 8760-hour time-series
prepro_data
: matrix
or data.frame
Pre-process data
prepro_modulation
: matrix
or data.frame
Pre-process modulation
Details for sublist cluster_object[["parameter"]]
:
name
: Name for the cluster,
it will prefixed by area name, unless you set add_prefix = FALSE
group
: Group of the cluster, depends on cluster type
...
: Parameters to write in the Ini file
An updated list containing various information about the simulation.
list
containing meta information about the simulation
## Not run: # /!\/!\/!\ use or create a study /!\/!\/!\ # data preparation for sutructures ts <- matrix(rep(c(0, 8000), each = 24*364), ncol = 2) df_pd <- matrix(rep(c(1, 1, 1, 0), each = 24*365), ncol = 4) df_pm <- matrix(data = c(rep(1, times = 365 * 24 * 3), rep(0, times = 365 * 24 * 1)), ncol = 4) # Example cluster object zone_test_1 <- list( `CCGT old 1`= list( parameter= list( name= "CCGT old 1", group = "Other", unitcount= 10L, nominalcapacity= 100, enabled= "true", `min-stable-power`= 80L, `min-up-time`= 20L, `min-down_time`= 30L), overwrite= TRUE, time_series = ts_8760, prepro_data = df_pd, prepro_modulation = df_pm)) # overwrite existing cluster zone_test_2 <- list( `PEAK`= list(parameter= list( name= "PEAK", group = "Other"), overwrite= TRUE, time_series = ts, prepro_data = df_pd, prepro_modulation = df_pm)) # Create multiple areas with multiple clusters list_areas <- antaresRead::getAreas()[1:5] lapply(list_areas, createClusterBulk, cluster_object = c(zone_test_1, zone_test_2), add_prefix = TRUE) ## End(Not run)
## Not run: # /!\/!\/!\ use or create a study /!\/!\/!\ # data preparation for sutructures ts <- matrix(rep(c(0, 8000), each = 24*364), ncol = 2) df_pd <- matrix(rep(c(1, 1, 1, 0), each = 24*365), ncol = 4) df_pm <- matrix(data = c(rep(1, times = 365 * 24 * 3), rep(0, times = 365 * 24 * 1)), ncol = 4) # Example cluster object zone_test_1 <- list( `CCGT old 1`= list( parameter= list( name= "CCGT old 1", group = "Other", unitcount= 10L, nominalcapacity= 100, enabled= "true", `min-stable-power`= 80L, `min-up-time`= 20L, `min-down_time`= 30L), overwrite= TRUE, time_series = ts_8760, prepro_data = df_pd, prepro_modulation = df_pm)) # overwrite existing cluster zone_test_2 <- list( `PEAK`= list(parameter= list( name= "PEAK", group = "Other"), overwrite= TRUE, time_series = ts, prepro_data = df_pd, prepro_modulation = df_pm)) # Create multiple areas with multiple clusters list_areas <- antaresRead::getAreas()[1:5] lapply(list_areas, createClusterBulk, cluster_object = c(zone_test_1, zone_test_2), add_prefix = TRUE) ## End(Not run)
Create a new ST-storage cluster for >= v8.6.0 Antares studies.
createClusterST( area, cluster_name, group = "Other1", storage_parameters = storage_values_default(), PMAX_injection = NULL, PMAX_withdrawal = NULL, inflows = NULL, lower_rule_curve = NULL, upper_rule_curve = NULL, add_prefix = TRUE, overwrite = FALSE, opts = antaresRead::simOptions() )
createClusterST( area, cluster_name, group = "Other1", storage_parameters = storage_values_default(), PMAX_injection = NULL, PMAX_withdrawal = NULL, inflows = NULL, lower_rule_curve = NULL, upper_rule_curve = NULL, add_prefix = TRUE, overwrite = FALSE, opts = antaresRead::simOptions() )
area |
The area where to create the cluster. |
cluster_name |
Name for the cluster, it will prefixed by area name, unless you set |
group |
Group of the cluster, one of : "PSP_open", "PSP_closed", "Pondage", "Battery", "Other". It corresponds to the type of stockage. |
storage_parameters |
|
PMAX_injection |
Modulation of charging capacity on an 8760-hour basis. |
PMAX_withdrawal |
Modulation of discharging capacity on an 8760-hour basis. |
inflows |
Algebraic deviation of the state of charge of the storage, which does not induce any power
generation or consumption on the system |
lower_rule_curve |
This is the lower limit for filling the stock imposed each hour. |
upper_rule_curve |
This is the upper limit for filling the stock imposed each hour. |
add_prefix |
If |
overwrite |
Logical, overwrite the cluster or not. |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
To write parameters to the list.ini
file. You have function storage_values_default()
who is called by default.
This function return list
containing properties according study version for cluster st-storage
.
Study version >= "8.6.0" :
efficiency = 1 (numeric
{0;1})
reservoircapacity = 0 (integer
>= 0)
initiallevel = 0 (numeric
{0;1})
withdrawalnominalcapacity = 0 (integer
>= 0)
injectionnominalcapacity = 0 (integer
>= 0)
initialleveloptim = FALSE (logical
TRUE/FALSE)
Study version >= "8.8.0" (update + new parameter) :
initiallevel = 0.5 (numeric
{0;1})
enabled = TRUE (logical
TRUE/FALSE)
By default, these values don't allow you to have an active cluster (See example section.)
All the functions needed to manage a storage cluster,
antaresRead::readClusterSTDesc()
, editClusterST()
, removeClusterST()
.
## Not run: # list for cluster parameters : storage_values_default() # create a cluster by default (with default parameters values + default data values): createClusterST(area = "my_area", "my_cluster") # Read cluster in study # by default, cluster name is prefixed # by the area name levels(readClusterSTDesc()$cluster) # > "my_area_my_cluster" # create cluster with custom parameter and data # use the function to create your own list of parameters (no Antares optim) # if you want optim (my_parameters$initialleveloptim <- TRUE) my_parameters <- storage_values_default() my_parameters$efficiency <- 0.5 my_parameters$initiallevel <- 10 my_parameters$withdrawalnominalcapacity <- 100 my_parameters$injectionnominalcapacity <- 1000 my_parameters$reservoircapacity <- 10000 # time series inflow_data <- matrix(3, 8760) ratio_data <- matrix(0.7, 8760) createClusterST(area = "my_area", "my_cluster", storage_parameters = my_parameters, PMAX_withdrawal = ratio_data, inflows = inflow_data, PMAX_injection = ratio_data, lower_rule_curve = ratio_data, upper_rule_curve = ratio_data) ## End(Not run)
## Not run: # list for cluster parameters : storage_values_default() # create a cluster by default (with default parameters values + default data values): createClusterST(area = "my_area", "my_cluster") # Read cluster in study # by default, cluster name is prefixed # by the area name levels(readClusterSTDesc()$cluster) # > "my_area_my_cluster" # create cluster with custom parameter and data # use the function to create your own list of parameters (no Antares optim) # if you want optim (my_parameters$initialleveloptim <- TRUE) my_parameters <- storage_values_default() my_parameters$efficiency <- 0.5 my_parameters$initiallevel <- 10 my_parameters$withdrawalnominalcapacity <- 100 my_parameters$injectionnominalcapacity <- 1000 my_parameters$reservoircapacity <- 10000 # time series inflow_data <- matrix(3, 8760) ratio_data <- matrix(0.7, 8760) createClusterST(area = "my_area", "my_cluster", storage_parameters = my_parameters, PMAX_withdrawal = ratio_data, inflows = inflow_data, PMAX_injection = ratio_data, lower_rule_curve = ratio_data, upper_rule_curve = ratio_data) ## End(Not run)
Allows selecting a set of areas so as to bundle them together in a "district".
createDistrict( name, caption = NULL, comments = NULL, apply_filter = c("none", "add-all", "remove-all"), add_area = NULL, remove_area = NULL, output = FALSE, overwrite = FALSE, opts = antaresRead::simOptions() )
createDistrict( name, caption = NULL, comments = NULL, apply_filter = c("none", "add-all", "remove-all"), add_area = NULL, remove_area = NULL, output = FALSE, overwrite = FALSE, opts = antaresRead::simOptions() )
name |
District's name. |
caption |
Caption for the district. |
comments |
Comments for the district. |
apply_filter |
Possible values are |
add_area |
Character vector of area(s) to add to the district. |
remove_area |
Character vector of area(s) to remove from the district. |
output |
Logical, compute the results for the district or not? |
overwrite |
Logical, should the district be overwritten if already exist? |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
## Not run: createDistrict( name = "mydistrict", apply_filter = "add-all", remove_area = c("fr", "be") ) ## End(Not run)
## Not run: createDistrict( name = "mydistrict", apply_filter = "add-all", remove_area = c("fr", "be") ) ## End(Not run)
Create a Demand Side Response (DSR)
createDSR( areasAndDSRParam = NULL, spinning = 2, overwrite = FALSE, opts = antaresRead::simOptions() ) getCapacityDSR(area = NULL, opts = antaresRead::simOptions()) editDSR( area = NULL, unit = NULL, nominalCapacity = NULL, marginalCost = NULL, spinning = NULL, opts = antaresRead::simOptions() )
createDSR( areasAndDSRParam = NULL, spinning = 2, overwrite = FALSE, opts = antaresRead::simOptions() ) getCapacityDSR(area = NULL, opts = antaresRead::simOptions()) editDSR( area = NULL, unit = NULL, nominalCapacity = NULL, marginalCost = NULL, spinning = NULL, opts = antaresRead::simOptions() )
areasAndDSRParam |
A |
spinning |
DSR spinning |
overwrite |
Overwrite the DSR plant if already exist. This will overwrite the previous area and links. |
opts |
List of simulation parameters returned by the function
|
area |
an area where to edit the DSR |
unit |
DSR unit number |
nominalCapacity |
DSR nominalCapacity |
marginalCost |
DSR marginalCost |
An updated list containing various information about the simulation.
getCapacityDSR()
returns DSR capacity (unit * nominalCapacity of virtual cluster) of the area
## Not run: library(antaresEditObject) path <- pathToYourStudy opts <- setSimulationPath(path, simulation = "input") # area, unit, nominalCapacity and marginalCost dsrData <- data.frame(area = c("a", "b"), unit = c(10,20), nominalCapacity = c(100, 120), marginalCost = c(52, 65), hour = c(3, 7)) createDSR(dsrData) createDSR(dsrData, spinning = 3, overwrite = TRUE) getAreas() ## End(Not run) ## Not run: getCapacityDSR("a") editDSR("a", unit = 50, nominalCapacity = 8000) getCapacityDSR("a") ## End(Not run) ## Not run: getCapacityDSR("a") editDSR("a", unit = 50, nominalCapacity = 8000, marginalCost = 45, hour = 9) getCapacityDSR("a") ## End(Not run)
## Not run: library(antaresEditObject) path <- pathToYourStudy opts <- setSimulationPath(path, simulation = "input") # area, unit, nominalCapacity and marginalCost dsrData <- data.frame(area = c("a", "b"), unit = c(10,20), nominalCapacity = c(100, 120), marginalCost = c(52, 65), hour = c(3, 7)) createDSR(dsrData) createDSR(dsrData, spinning = 3, overwrite = TRUE) getAreas() ## End(Not run) ## Not run: getCapacityDSR("a") editDSR("a", unit = 50, nominalCapacity = 8000) getCapacityDSR("a") ## End(Not run) ## Not run: getCapacityDSR("a") editDSR("a", unit = 50, nominalCapacity = 8000, marginalCost = 45, hour = 9) getCapacityDSR("a") ## End(Not run)
Create a new link between two areas in an Antares study.
createLink( from, to, propertiesLink = propertiesLinkOptions(), dataLink = NULL, tsLink = NULL, overwrite = FALSE, opts = antaresRead::simOptions() )
createLink( from, to, propertiesLink = propertiesLinkOptions(), dataLink = NULL, tsLink = NULL, overwrite = FALSE, opts = antaresRead::simOptions() )
from , to
|
The two areas linked together. |
propertiesLink |
a named list containing the link properties, e.g. hurdles-cost
or transmission-capacities for example. See |
dataLink |
See Details section below. |
tsLink |
Transmission capacities time series. First N columns are direct TS, following N are indirect ones. |
overwrite |
Logical, overwrite the previous between the two areas if exist |
opts |
List of simulation parameters returned by the function
|
The eight potential times-series are:
NTC direct : the upstream-to-downstream capacity, in MW. Default to 1
.
NTC indirect : the downstream-to-upstream capacity, in MW. Default to 1
.
Hurdle cost direct : an upstream-to-downstream transmission fee, in euro/MWh. Default to 0
.
Hurdle cost indirect : a downstream-to-upstream transmission fee, in euro/MWh. Default to 0
.
Impedances : virtual impedances that are used in economy simulations to give a physical meaning to raw outputs,
when no binding constraints have been defined to enforce Kirchhoff's laws. Default to 0
.
Loop flow : amount of power flowing circularly though the grid when all "nodes" are perfectly balanced (no import and no export). Default to 0
.
PST min : lower bound of phase-shifting that can be reached by a PST installed on the link, if any. Default to 0
.
PST max : upper bound of phase-shifting that can be reached by a PST installed on the link, if any. Default to 0
.
According to Antares version, usage may vary :
< v7.0.0 : 5 first columns are used in the following order: NTC direct, NTC indirect, Impedances, Hurdle cost direct, Hurdle cost indirect.
>= v7.0.0 : 8 columns in order above are expected.
>= v8.2.0 : there's 2 cases :
8 columns are provided: 2 first are used in tsLink
, other 6 are used for link data
6 columns are provided: you must provide NTC data in tsLink
argument.
An updated list containing various information about the simulation.
In Antares, areas are sorted in alphabetical order to establish links between.
For example, link between "fr" and "be" will appear under "be".
So the areas are sorted before creating the link between them, and dataLink
is
rearranged to match the new order.
## Not run: library(antaresRead) # Set simulation path setSimulationPath(path = "PATH/TO/SIMULATION", simulation = "input") # Create a link between two areas createLink(from = "first_area", to = "second_area") ## End(Not run)
## Not run: library(antaresRead) # Set simulation path setSimulationPath(path = "PATH/TO/SIMULATION", simulation = "input") # Create a link between two areas createLink(from = "first_area", to = "second_area") ## End(Not run)
Create a Pumped Storage Power plant (PSP)
createPSP( areasAndCapacities = NULL, namePumping = "Psp_In", nameTurbining = "Psp_Out", hurdleCost = 5e-04, timeStepBindConstraint = "weekly", efficiency = NULL, overwrite = FALSE, opts = antaresRead::simOptions() ) getCapacityPSP( area = NULL, nameTurbining = "Psp_Out", timeStepBindConstraint = "weekly", opts = antaresRead::simOptions() ) editPSP( area = NULL, capacity = NULL, namePumping = "Psp_In", nameTurbining = "Psp_Out", timeStepBindConstraint = "weekly", hurdleCost = 5e-04, opts = antaresRead::simOptions() )
createPSP( areasAndCapacities = NULL, namePumping = "Psp_In", nameTurbining = "Psp_Out", hurdleCost = 5e-04, timeStepBindConstraint = "weekly", efficiency = NULL, overwrite = FALSE, opts = antaresRead::simOptions() ) getCapacityPSP( area = NULL, nameTurbining = "Psp_Out", timeStepBindConstraint = "weekly", opts = antaresRead::simOptions() ) editPSP( area = NULL, capacity = NULL, namePumping = "Psp_In", nameTurbining = "Psp_Out", timeStepBindConstraint = "weekly", hurdleCost = 5e-04, opts = antaresRead::simOptions() )
areasAndCapacities |
A data.frame with 2 columns |
namePumping |
The name of the pumping area |
nameTurbining |
The name of the turbining area |
hurdleCost |
The cost of the PSP |
timeStepBindConstraint |
Time step for the binding constraint : |
efficiency |
The efficiency of the PSP |
overwrite |
Overwrite the Pumped Storage Power plant if already exist. This will overwrite the previous area and links. |
opts |
List of simulation parameters returned by the function
|
area |
an area name |
capacity |
PSP capacity for the area |
An updated list containing various information about the simulation.
getCapacityPSP()
returns PSP capacity of the area
## Not run: library(antaresEditObject) path<-pathToYourStudy opts<-setSimulationPath(path, simulation = "input") pspData<-data.frame(area=c("a", "b"), installedCapacity=c(800,900)) createPSP(pspData, efficiency = 0.8) createPSP(pspData, efficiency = 0.66, overwrite = TRUE) createPSP(pspData, efficiency = 0.98, timeStepBindConstraint = "daily") getAreas() ## End(Not run) ## Not run: getCapacityPSP("a") editPSP("a", capacity = 8000, hurdleCost = 0.1) getCapacityPSP("a") areaName<-"suisse" createArea(areaName, overwrite = TRUE) pspData<-data.frame(area=c(areaName), installedCapacity=c(9856)) createPSP(pspData, efficiency = 0.5, overwrite = TRUE, timeStepBindConstraint = "daily") getCapacityPSP(areaName, timeStepBindConstraint = "daily") ## End(Not run)
## Not run: library(antaresEditObject) path<-pathToYourStudy opts<-setSimulationPath(path, simulation = "input") pspData<-data.frame(area=c("a", "b"), installedCapacity=c(800,900)) createPSP(pspData, efficiency = 0.8) createPSP(pspData, efficiency = 0.66, overwrite = TRUE) createPSP(pspData, efficiency = 0.98, timeStepBindConstraint = "daily") getAreas() ## End(Not run) ## Not run: getCapacityPSP("a") editPSP("a", capacity = 8000, hurdleCost = 0.1) getCapacityPSP("a") areaName<-"suisse" createArea(areaName, overwrite = TRUE) pspData<-data.frame(area=c(areaName), installedCapacity=c(9856)) createPSP(pspData, efficiency = 0.5, overwrite = TRUE, timeStepBindConstraint = "daily") getCapacityPSP(areaName, timeStepBindConstraint = "daily") ## End(Not run)
Delete a study or a simulation
deleteStudy(opts = simOptions(), prompt_validation = FALSE, simulation = NULL)
deleteStudy(opts = simOptions(), prompt_validation = FALSE, simulation = NULL)
opts |
List. study options |
prompt_validation |
|
simulation |
simulation to be deleted (default |
Detect a pattern in a binding constraint coefficient
detect_pattern_in_binding_constraint(pattern, opts = antaresRead::simOptions())
detect_pattern_in_binding_constraint(pattern, opts = antaresRead::simOptions())
pattern |
The pattern to detect. |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
the names of the binding constraints containing the pattern
updateAdequacySettings
and actual Antares parameters.Correspondence between arguments of updateAdequacySettings
and actual Antares parameters.
dicoAdequacySettings(arg)
dicoAdequacySettings(arg)
arg |
An argument from function |
The corresponding Antares general parameter.
updateGeneralSettings
and actual Antares parameters.Correspondence between arguments of updateGeneralSettings
and actual Antares parameters.
dicoGeneralSettings(arg)
dicoGeneralSettings(arg)
arg |
An argument from function |
The corresponding Antares general parameter.
dicoGeneralSettings("year.by.year") # "year-by-year"
dicoGeneralSettings("year.by.year") # "year-by-year"
updateOptimizationSettings
and actual Antares parameters.Correspondence between arguments of updateOptimizationSettings
and actual Antares parameters.
dicoOptimizationSettings(arg)
dicoOptimizationSettings(arg)
arg |
An argument from function |
The corresponding Antares general parameter.
dicoGeneralSettings("year.by.year") # "year-by-year"
dicoGeneralSettings("year.by.year") # "year-by-year"
updateOutputSettings
and actual Antares parameters.Correspondence between arguments of updateOutputSettings
and actual Antares parameters.
dicoOutputSettings(arg)
dicoOutputSettings(arg)
arg |
An argument from function |
The corresponding Antares general parameter.
dicoOutputSettings("result.format") # "result-format"
dicoOutputSettings("result.format") # "result-format"
Edit an existing area in an Antares study.
editArea( name, color = NULL, localization = NULL, nodalOptimization = NULL, filtering = NULL, adequacy = NULL, opts = antaresRead::simOptions() )
editArea( name, color = NULL, localization = NULL, nodalOptimization = NULL, filtering = NULL, adequacy = NULL, opts = antaresRead::simOptions() )
name |
Name of the area as a character, without punctuation except - and _. |
color |
Color of the node |
localization |
Localization on the map |
nodalOptimization |
Nodal optimization parameters, see |
filtering |
Filtering parameters, see |
adequacy |
Adequacy parameters, see |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
## Not run: library(antaresRead) # Set simulation path setSimulationPath(path = "PATH/TO/SIMULATION", simulation = "input") # Edit an existing area editArea("area", color = grDevices::rgb(230, 108, 44, max = 255), localization = c(1, 1), opts = antaresRead::simOptions()) editArea("de", nodalOptimization = list("spilledenergycost" = list(fr = 30)), opts = antaresRead::simOptions()) editArea("de", nodalOptimization = nodalOptimizationOptions(), opts = antaresRead::simOptions()) editArea( "de", filtering = list("filter_synthesis"=paste(c("hourly","daily"),collapse = ", ")) ) ## End(Not run)
## Not run: library(antaresRead) # Set simulation path setSimulationPath(path = "PATH/TO/SIMULATION", simulation = "input") # Edit an existing area editArea("area", color = grDevices::rgb(230, 108, 44, max = 255), localization = c(1, 1), opts = antaresRead::simOptions()) editArea("de", nodalOptimization = list("spilledenergycost" = list(fr = 30)), opts = antaresRead::simOptions()) editArea("de", nodalOptimization = nodalOptimizationOptions(), opts = antaresRead::simOptions()) editArea( "de", filtering = list("filter_synthesis"=paste(c("hourly","daily"),collapse = ", ")) ) ## End(Not run)
Update an existing binding constraint in an Antares study.
The key search value of the constraint is the id
field
editBindingConstraint( name, id = tolower(name), values = NULL, enabled = NULL, timeStep = NULL, operator = NULL, filter_year_by_year = NULL, filter_synthesis = NULL, coefficients = NULL, group = NULL, opts = antaresRead::simOptions() )
editBindingConstraint( name, id = tolower(name), values = NULL, enabled = NULL, timeStep = NULL, operator = NULL, filter_year_by_year = NULL, filter_synthesis = NULL, coefficients = NULL, group = NULL, opts = antaresRead::simOptions() )
name |
The name for the binding constraint. |
id |
An id, default is to use the name. |
values |
Values used by the constraint. It contains one line per time step and three columns "less", "greater" and "equal" (see documentation below if you're using version study >= v8.7.0) |
enabled |
Logical, is the constraint enabled ? |
timeStep |
Time step the constraint applies to : |
operator |
Type of constraint: equality, inequality on one side or both sides. |
filter_year_by_year |
Marginal price granularity for year by year |
filter_synthesis |
Marginal price granularity for synthesis |
coefficients |
A named list containing the coefficients used by the constraint, the coefficients have to be alphabetically ordered see examples below for entering weight or weight with offset. |
group |
"character" group of the constraint, default value : "default" |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
Put values with rights dimensions :
hourly : 8784
daily = 366
>= v8.7.0 : For each constraint name, one file .txt containing <id>_lt.txt, <id>_gt.txt, <id>_eq.txt
Parameter values
must be named list
("lt", "gt", "eq") containing data.frame
scenarized.
see example section below.
Other binding constraints functions:
createBindingConstraintBulk()
,
createBindingConstraint()
,
removeBindingConstraint()
## Not run: # < v8.7.0 : editBindingConstraint( name = "myconstraint", values = matrix(data = rep(0, 8784 * 3), ncol = 3), enabled = FALSE, timeStep = "hourly", operator = "both", coefficients = list("fr%de" = 1) ) # update binding constraint with weight + offset editBindingConstraint( name = "myconstraint", values = matrix(data = rep(0, 8784 * 3), ncol = 3), enabled = FALSE, timeStep = "hourly", operator = "both", coefficients = list("fr%de" = "1%-5") ) # >= v8.7.0 : # data values scenarized (hourly) df <- matrix(data = rep(0, 8784 * 3), ncol = 3) # you can provide list data with all value # or just according with 'operator' (ex : 'lt' for 'less) values_data <- list(lt=df, gt= df, eq= df) editBindingConstraint(name = "myconstraint", values = values_data, enabled = TRUE, timeStep = "hourly", operator = "both", filter_year_by_year = "hourly", filter_synthesis = "hourly", coefficients = list("fr%de" = 1), group = "myconstraint_group") ## End(Not run)
## Not run: # < v8.7.0 : editBindingConstraint( name = "myconstraint", values = matrix(data = rep(0, 8784 * 3), ncol = 3), enabled = FALSE, timeStep = "hourly", operator = "both", coefficients = list("fr%de" = 1) ) # update binding constraint with weight + offset editBindingConstraint( name = "myconstraint", values = matrix(data = rep(0, 8784 * 3), ncol = 3), enabled = FALSE, timeStep = "hourly", operator = "both", coefficients = list("fr%de" = "1%-5") ) # >= v8.7.0 : # data values scenarized (hourly) df <- matrix(data = rep(0, 8784 * 3), ncol = 3) # you can provide list data with all value # or just according with 'operator' (ex : 'lt' for 'less) values_data <- list(lt=df, gt= df, eq= df) editBindingConstraint(name = "myconstraint", values = values_data, enabled = TRUE, timeStep = "hourly", operator = "both", filter_year_by_year = "hourly", filter_synthesis = "hourly", coefficients = list("fr%de" = 1), group = "myconstraint_group") ## End(Not run)
(thermal clusters only)
Edit parameters, pre-process data and time series of an existing cluster, thermal or RES (renewable energy source).
editCluster( area, cluster_name, ..., list_pollutants = NULL, time_series = NULL, prepro_data = NULL, prepro_modulation = NULL, add_prefix = TRUE, opts = antaresRead::simOptions() ) editClusterRES( area, cluster_name, ..., time_series = NULL, add_prefix = TRUE, opts = antaresRead::simOptions() )
editCluster( area, cluster_name, ..., list_pollutants = NULL, time_series = NULL, prepro_data = NULL, prepro_modulation = NULL, add_prefix = TRUE, opts = antaresRead::simOptions() ) editClusterRES( area, cluster_name, ..., time_series = NULL, add_prefix = TRUE, opts = antaresRead::simOptions() )
area |
The area where to create the cluster. |
cluster_name |
Name for the cluster, it will prefixed by area name, unless you set |
... |
Parameters to write in the Ini file. Careful!
Some parameters must be set as |
list_pollutants |
|
time_series |
the "ready-made" 8760-hour time-series available for simulation purposes. |
prepro_data |
Pre-process data, a |
prepro_modulation |
Pre-process modulation, a |
add_prefix |
If |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
Parameter list_pollutants
is only available for Antares studies >= v8.6.0.
You must provide named list
(numerical values or NULL ) :
list( "nh3"= 0.25, "nox"= 0.45, "pm2_5"= 0.25, "pm5"= 0.25, "pm10"= 0.25, "nmvoc"= 0.25, "so2"= 0.25, "op1"= 0.25, "op2"= 0.25, "op3"= 0.25, "op4"= 0.25, "op5"= NULL, "co2"= NULL)
createCluster()
or createClusterRES()
to create new clusters, removeCluster()
or removeClusterRES()
to remove clusters.
## Not run: # Update only nominalCapacity for an existing cluster editCluster( area = "myarea", cluster_name = "mycluster", nominalcapacity = 10600.000 ) ## End(Not run)
## Not run: # Update only nominalCapacity for an existing cluster editCluster( area = "myarea", cluster_name = "mycluster", nominalcapacity = 10600.000 ) ## End(Not run)
Edit parameters and time series of an existing st-storage
cluster (Antares studies >= v8.6.0).
editClusterST( area, cluster_name, group = NULL, storage_parameters = NULL, PMAX_injection = NULL, PMAX_withdrawal = NULL, inflows = NULL, lower_rule_curve = NULL, upper_rule_curve = NULL, add_prefix = TRUE, opts = antaresRead::simOptions() )
editClusterST( area, cluster_name, group = NULL, storage_parameters = NULL, PMAX_injection = NULL, PMAX_withdrawal = NULL, inflows = NULL, lower_rule_curve = NULL, upper_rule_curve = NULL, add_prefix = TRUE, opts = antaresRead::simOptions() )
area |
The area where to create the cluster. |
cluster_name |
Name for the cluster, it will prefixed by area name, unless you set |
group |
Group of the cluster, one of : "PSP_open", "PSP_closed", "Pondage", "Battery", "Other". It corresponds to the type of stockage. |
storage_parameters |
Parameters to write in the Ini file. |
PMAX_injection |
modulation of charging capacity on an 8760-hour basis. The values are float between 0 and 1. |
PMAX_withdrawal |
modulation of discharging capacity on an 8760-hour basis. The values are float between 0 and 1. |
inflows |
imposed withdrawals from the stock for other uses, The values are integer. |
lower_rule_curve |
This is the lower limit for filling the stock imposed each hour. The values are float between 0 and 1. |
upper_rule_curve |
This is the upper limit for filling the stock imposed each hour. The values are float between 0 and 1. |
add_prefix |
If |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
createClusterST()
to edit existing clusters, removeClusterST()
to remove clusters.
Edit a link between two areas in an Antares study.
editLink( from, to, hurdles_cost = NULL, transmission_capacities = NULL, asset_type = NULL, display_comments = NULL, filter_synthesis = NULL, filter_year_by_year = NULL, dataLink = NULL, tsLink = NULL, opts = antaresRead::simOptions() )
editLink( from, to, hurdles_cost = NULL, transmission_capacities = NULL, asset_type = NULL, display_comments = NULL, filter_synthesis = NULL, filter_year_by_year = NULL, dataLink = NULL, tsLink = NULL, opts = antaresRead::simOptions() )
from , to
|
The two areas linked together. |
hurdles_cost |
Logical, which is used to state whether (linear) transmission fees should be taken into account or not in economy and adequacy simulations |
transmission_capacities |
Character, one of |
asset_type |
Character, one of |
display_comments |
Logical, display comments or not. |
filter_synthesis |
Character, vector of time steps used in the output synthesis, among |
filter_year_by_year |
Character, vector of time steps used in the output year-by-year, among |
dataLink |
See Details section below. |
tsLink |
Transmission capacities time series. First N columns are direct TS, following N are indirect ones. |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
See createLink()
for more documentation
## Not run: editLink( from = "area1", to = "area2", transmission_capacities = "infinite", filter_synthesis = c("hourly","daily"), filter_year_by_year = c("weekly","monthly") ) ## End(Not run)
## Not run: editLink( from = "area1", to = "area2", transmission_capacities = "infinite", filter_synthesis = c("hourly","daily"), filter_year_by_year = c("weekly","monthly") ) ## End(Not run)
For a given area, if the data is empty, pick value from default values for use heuristic
, follow load
and reservoir
sections.
fill_empty_hydro_ini_file(area, opts = antaresRead::simOptions())
fill_empty_hydro_ini_file(area, opts = antaresRead::simOptions())
area |
The area where to write the value, i.e. lhs in the section. |
opts |
List of simulation parameters returned by the function
|
mingen.txt
or/and mod.txt
is emptyWrite default input time series if mingen.txt
or/and mod.txt
is empty
fill_empty_hydro_ts_file(area, opts = antaresRead::simOptions())
fill_empty_hydro_ts_file(area, opts = antaresRead::simOptions())
area |
The area where to write the input time series. |
opts |
List of simulation parameters returned by the function
|
Output profile options for creating an area
filteringOptions( filter_synthesis = c("hourly", "daily", "weekly", "monthly", "annual"), filter_year_by_year = c("hourly", "daily", "weekly", "monthly", "annual") )
filteringOptions( filter_synthesis = c("hourly", "daily", "weekly", "monthly", "annual"), filter_year_by_year = c("hourly", "daily", "weekly", "monthly", "annual") )
filter_synthesis |
Character, vector of time steps used in the output synthesis, among |
filter_year_by_year |
Character, vector of time steps used in the output year-by-year, among |
a named list
filteringOptions( filter_synthesis=c("hourly","daily"), filter_year_by_year=c("weekly","monthly") )
filteringOptions( filter_synthesis=c("hourly","daily"), filter_year_by_year=c("weekly","monthly") )
Get default hydro.ini values
get_default_hydro_ini_values()
get_default_hydro_ini_values()
Get the type of control to execute using the 3 necessary booleans
get_type_check_mingen_vs_hydrostorage(hydro_params)
get_type_check_mingen_vs_hydrostorage(hydro_params)
hydro_params |
a list of 3 booleans to compute the type of control to make. |
a character containing the type of control to execute.
Compute the type of control to make between :
input/hydro/series/<area>/mingen.txt
input/hydro/series/<area>/mod.txt
This control is implemented in Antares too.
get_type_check_mingen_vs_hydrostorage_to_trigger( area, opts = antaresRead::simOptions() )
get_type_check_mingen_vs_hydrostorage_to_trigger( area, opts = antaresRead::simOptions() )
area |
The area where the type of control must be computed. |
opts |
List of simulation parameters returned by the function
|
a character containing the type of control to execute.
Function called only for an Antares version >= 860.
Compute the type of control to make between :
input/hydro/series/<area>/mingen.txt
input/hydro/common/capacity/maxpower_<area>.txt
This control is implemented in Antares too.
No control to execute if reservoir
section in hydro.ini for the area is set to TRUE.
get_type_check_mingen_vs_maxpower_to_trigger( area, opts = antaresRead::simOptions() )
get_type_check_mingen_vs_maxpower_to_trigger( area, opts = antaresRead::simOptions() )
area |
The area where the type of control must be computed. |
opts |
List of simulation parameters returned by the function
|
a character containing the type of control to execute.
Function called only for an Antares version >= 860.
Retrieve job log from API
getJobLogs(job_id, opts = antaresRead::simOptions())
getJobLogs(job_id, opts = antaresRead::simOptions())
job_id |
The job identifier. |
opts |
List of simulation parameters returned by the function
|
Logs as character string.
## Not run: antaresRead::setSimulationPathAPI( host = "http://localhost:8080", study_id = "39c604fc-687f-46c4-9fa6-59b57ff9c8d1", token = NULL, simulation = "input" ) job <- runSimulation() getJobLogs(job) ## End(Not run)
## Not run: antaresRead::setSimulationPathAPI( host = "http://localhost:8080", study_id = "39c604fc-687f-46c4-9fa6-59b57ff9c8d1", token = NULL, simulation = "input" ) job <- runSimulation() getJobLogs(job) ## End(Not run)
Retrieve API jobs
getJobs(job_id = NULL, opts = antaresRead::simOptions())
getJobs(job_id = NULL, opts = antaresRead::simOptions())
job_id |
The job identifier, if |
opts |
List of simulation parameters returned by the function
|
A data.table
with information about jobs.
## Not run: getJobs() ## End(Not run)
## Not run: getJobs() ## End(Not run)
Import a local study to Antares Web
importZipStudyWeb( host, token, zipfile_name, delete_zipfile = TRUE, folder_destination = NULL, opts = antaresRead::simOptions() )
importZipStudyWeb( host, token, zipfile_name, delete_zipfile = TRUE, folder_destination = NULL, opts = antaresRead::simOptions() )
host |
Host of AntaREST server API. |
token |
API personnal access token. |
zipfile_name |
Name of the zipfile of the study. |
delete_zipfile |
Should the zipfile be deleted after upload. |
folder_destination |
Folder of the study in Antares Web. |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
Output pollutants list for thermal clusters
list_pollutants_values(multi_values = NULL)
list_pollutants_values(multi_values = NULL)
multi_values |
put values to init list values, default as |
a named list
list_pollutants_values()
list_pollutants_values()
Use this to generate command without an active API connection, it allow to use function to edit a study to later on get API commands.
mockSimulationAPI(force = FALSE, antares_version = "8.2.0")
mockSimulationAPI(force = FALSE, antares_version = "8.2.0")
force |
Logical, force mocking simulation even if antaresRead::setSimulationPathAPI has already been called. |
antares_version |
Antares version number. |
An updated list containing various information about the simulation.
## Not run: # Mock simulation API mockSimulationAPI() # Create an area createArea("new area") # Get commands getVariantCommands() ## End(Not run)
## Not run: # Mock simulation API mockSimulationAPI() # Create an area createArea("new area") # Get commands getVariantCommands() ## End(Not run)
Nodal optimization parameters for creating an area
nodalOptimizationOptions( non_dispatchable_power = TRUE, dispatchable_hydro_power = TRUE, other_dispatchable_power = TRUE, spread_unsupplied_energy_cost = 0, spread_spilled_energy_cost = 0, average_unsupplied_energy_cost = 0, average_spilled_energy_cost = 0 )
nodalOptimizationOptions( non_dispatchable_power = TRUE, dispatchable_hydro_power = TRUE, other_dispatchable_power = TRUE, spread_unsupplied_energy_cost = 0, spread_spilled_energy_cost = 0, average_unsupplied_energy_cost = 0, average_spilled_energy_cost = 0 )
non_dispatchable_power |
logical, default to FALSE |
dispatchable_hydro_power |
logical, default to FALSE |
other_dispatchable_power |
logical, default to FALSE |
spread_unsupplied_energy_cost |
numeric, default to 0 |
spread_spilled_energy_cost |
numeric, default to 0 |
average_unsupplied_energy_cost |
numeric, default to 0 |
average_spilled_energy_cost |
numeric, default to 0 |
a named list
nodalOptimizationOptions()
nodalOptimizationOptions()
getPlaylist
gives the identifier of the MC years which
will be simulated in the Antares study, taking into account the potential use of a
playlist which can skip some MC years
setPlaylist
is a function which modifies the input file of an ANTARES
study and set the playlist in order to simulate only the MC years given in input
getPlaylist(opts = antaresRead::simOptions()) setPlaylist(playlist, weights = NULL, opts = antaresRead::simOptions())
getPlaylist(opts = antaresRead::simOptions()) setPlaylist(playlist, weights = NULL, opts = antaresRead::simOptions())
opts |
List of simulation parameters returned by the function
|
playlist |
vector of MC years identifier to be simulated can be a list (V8 compatibility) but not recommended |
weights |
data.table, 2 columns : mcYears and weights. Only with after antares V8 |
getPlaylist
returns a vector of the identifier of the simulated MC year.
setPlaylist
does not return anything. It is used to modify the input of an Antares study.
## Not run: setSimulationPath("PATH/TO/STUDY/") # or setSimulationPathAPI( host = "http://localhost:8080", study_id = "6f98a393-155d-450f-a581-8668dc355235", token = NULL, simulation = "input" ) # augment number of MC years updateGeneralSettings(nbyears = 10) # Get the actual playlist getPlaylist() # [1] 2 4 6 # set a new playlist setPlaylist(c(3, 5, 7)) ## End(Not run)
## Not run: setSimulationPath("PATH/TO/STUDY/") # or setSimulationPathAPI( host = "http://localhost:8080", study_id = "6f98a393-155d-450f-a581-8668dc355235", token = NULL, simulation = "input" ) # augment number of MC years updateGeneralSettings(nbyears = 10) # Get the actual playlist getPlaylist() # [1] 2 4 6 # set a new playlist setPlaylist(c(3, 5, 7)) ## End(Not run)
Properties for creating a link
propertiesLinkOptions( hurdles_cost = FALSE, transmission_capacities = "enabled", asset_type = "ac", display_comments = TRUE, filter_synthesis = c("hourly", "daily", "weekly", "monthly", "annual"), filter_year_by_year = c("hourly", "daily", "weekly", "monthly", "annual") )
propertiesLinkOptions( hurdles_cost = FALSE, transmission_capacities = "enabled", asset_type = "ac", display_comments = TRUE, filter_synthesis = c("hourly", "daily", "weekly", "monthly", "annual"), filter_year_by_year = c("hourly", "daily", "weekly", "monthly", "annual") )
hurdles_cost |
Logical, which is used to state whether (linear) transmission fees should be taken into account or not in economy and adequacy simulations |
transmission_capacities |
Character, one of |
asset_type |
Character, one of |
display_comments |
Logical, display comments or not. |
filter_synthesis |
Character, vector of time steps used in the output synthesis, among |
filter_year_by_year |
Character, vector of time steps used in the output year-by-year, among |
A named list that can be used in createLink()
.
## Not run: propertiesLinkOptions( hurdles_cost = TRUE, filter_synthesis=c("hourly","daily"), filter_year_by_year=c("weekly","monthly") ) ## End(Not run)
## Not run: propertiesLinkOptions( hurdles_cost = TRUE, filter_synthesis=c("hourly","daily"), filter_year_by_year=c("weekly","monthly") ) ## End(Not run)
Remove an area in an Antares study.
removeArea(name, opts = antaresRead::simOptions())
removeArea(name, opts = antaresRead::simOptions())
name |
An area name. |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
## Not run: removeArea("fictive_area") ## End(Not run)
## Not run: removeArea("fictive_area") ## End(Not run)
Remove a binding constraint in an Antares study.
removeBindingConstraint( name = NULL, group = NULL, opts = antaresRead::simOptions() )
removeBindingConstraint( name = NULL, group = NULL, opts = antaresRead::simOptions() )
name |
Name(s) of the binding constraint(s) to remove. |
group |
|
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
Starting with version v8.7.0, you can delete binding constraints by name or by group.
Other binding constraints functions:
createBindingConstraintBulk()
,
createBindingConstraint()
,
editBindingConstraint()
## Not run: # < v8.7.0 : removeBindingConstraint(name = "mybindingconstraint") # >= v8.7.0 (delete by names group) : # read bc <- readBindingConstraints() # select all groups group_to_delete <- sapply(bc, function(x){ x$properties$group }) # delete all groups removeBindingConstraint(group = group_to_delete) ## End(Not run)
## Not run: # < v8.7.0 : removeBindingConstraint(name = "mybindingconstraint") # >= v8.7.0 (delete by names group) : # read bc <- readBindingConstraints() # select all groups group_to_delete <- sapply(bc, function(x){ x$properties$group }) # delete all groups removeBindingConstraint(group = group_to_delete) ## End(Not run)
Delete cluster(s), thermal, renewable (renewable energy source) or short-term storage, along with all its data (properties + TS).
removeCluster( area, cluster_name, add_prefix = TRUE, opts = antaresRead::simOptions() ) removeClusterRES( area, cluster_name, add_prefix = TRUE, opts = antaresRead::simOptions() ) removeClusterST( area, cluster_name, add_prefix = TRUE, opts = antaresRead::simOptions() )
removeCluster( area, cluster_name, add_prefix = TRUE, opts = antaresRead::simOptions() ) removeClusterRES( area, cluster_name, add_prefix = TRUE, opts = antaresRead::simOptions() ) removeClusterST( area, cluster_name, add_prefix = TRUE, opts = antaresRead::simOptions() )
area |
The area where to create the cluster. |
cluster_name |
Name for the cluster, it will prefixed by area name, unless you set |
add_prefix |
If |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
createCluster()
, createClusterRES()
or createClusterST()
to create new clusters,
editCluster()
or editClusterRES()
or editClusterST()
to edit existing clusters.
## Not run: createCluster( area = "fr", cluster_name = "fr_gas", group = "other", `marginal-cost` = 50 ) removeCluster(area = "fr", cluster_name = "fr_gas") ## End(Not run)
## Not run: createCluster( area = "fr", cluster_name = "fr_gas", group = "other", `marginal-cost` = 50 ) removeCluster(area = "fr", cluster_name = "fr_gas") ## End(Not run)
Remove a link between two areas in an Antares study.
removeLink(from, to, opts = antaresRead::simOptions())
removeLink(from, to, opts = antaresRead::simOptions())
from , to
|
The two areas linked together. |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
## Not run: createLink(from = "myarea", to = "myarea2") removeLink(from = "myarea", to = "myarea2") ## End(Not run)
## Not run: createLink(from = "myarea", to = "myarea2") removeLink(from = "myarea", to = "myarea2") ## End(Not run)
Replicate a data.table as many times as needed to get the same number of time series between 2 data.tables
replicate_missing_ts(xts, yts)
replicate_missing_ts(xts, yts)
xts |
a data.table of time series type to replicate if necessary. |
yts |
a data.table of time series type to use as reference to match its number of time series. |
the data.table x replicated to match the number of time series of y.
Rollback the data to previous one if the check is KO. For a given area, check if the data is consistent and rollback to previous data if the check is KO.
rollback_to_previous_data( area, prev_data, rollback_type, opts = antaresRead::simOptions() )
rollback_to_previous_data( area, prev_data, rollback_type, opts = antaresRead::simOptions() )
area |
The area where to execute the control and rollback the data. |
prev_data |
The original data to restore if necessary. |
rollback_type |
The file to restore and the control(s) to execute. |
opts |
List of simulation parameters returned by the function
|
Function called only for an Antares version >= 860.
Run an ANTARES study
runSimulation( name, mode = "economy", path_solver = getOption("antares.solver"), wait = TRUE, show_output_on_console = FALSE, parallel = TRUE, ..., opts = antaresRead::simOptions() )
runSimulation( name, mode = "economy", path_solver = getOption("antares.solver"), wait = TRUE, show_output_on_console = FALSE, parallel = TRUE, ..., opts = antaresRead::simOptions() )
name |
Name of the simulation. In API mode, |
mode |
Simulation mode, can take value "economy", "adequacy" or "draft". |
path_solver |
Character containing the Antares Solver path |
wait |
Logical, indicating whether the R interpreter should wait for the simulation to finish, or run it asynchronously. |
show_output_on_console |
Logical, indicating whether to capture the ANTARES log and show it on the R console. |
parallel |
Logical. If |
... |
Additional arguments (API only), such as |
opts |
List of simulation parameters returned by the function
|
In API mode it return a list
with either the job id in case of success of
the command or details about the error produce.
In non-API mode the function does not return anything, it is used to launch an
ANTARES simulation.
runTsGenerator( path_solver = getOption("antares.solver"), wait = TRUE, show_output_on_console = FALSE, opts = antaresRead::simOptions() )
runTsGenerator( path_solver = getOption("antares.solver"), wait = TRUE, show_output_on_console = FALSE, opts = antaresRead::simOptions() )
path_solver |
Character containing the Antares Solver path. |
wait |
Logical, indicating whether the R interpreter should wait for the simulation to finish, or run it asynchronously. |
show_output_on_console |
Logical, indicating whether to capture the ANTARES log and show it on the R console. |
opts |
List of simulation parameters returned by the function
|
## Not run: library(antaresRead) setSimulationPath(path = "path/to/study") library(antaresEditObject) runTsGenerator( path_solver = "path/to/antares-6.0-solver.exe", show_output_on_console = TRUE ) ## End(Not run)
## Not run: library(antaresRead) setSimulationPath(path = "path/to/study") library(antaresEditObject) runTsGenerator( path_solver = "path/to/antares-6.0-solver.exe", show_output_on_console = TRUE ) ## End(Not run)
Read, create, update & deduplicate scenario builder.
scenarioBuilder( n_scenario = 1, n_mc = NULL, areas = NULL, areas_rand = NULL, group_bc = NULL, group_bc_rand = NULL, coef_hydro_levels = NULL, mode = NULL, opts = antaresRead::simOptions() ) readScenarioBuilder( ruleset = "Default Ruleset", as_matrix = TRUE, opts = antaresRead::simOptions() ) updateScenarioBuilder( ldata, ruleset = "Default Ruleset", series = NULL, clusters_areas = NULL, links = NULL, opts = antaresRead::simOptions() ) clearScenarioBuilder( ruleset = "Default Ruleset", opts = antaresRead::simOptions() ) deduplicateScenarioBuilder( ruleset = "Default Ruleset", opts = antaresRead::simOptions() )
scenarioBuilder( n_scenario = 1, n_mc = NULL, areas = NULL, areas_rand = NULL, group_bc = NULL, group_bc_rand = NULL, coef_hydro_levels = NULL, mode = NULL, opts = antaresRead::simOptions() ) readScenarioBuilder( ruleset = "Default Ruleset", as_matrix = TRUE, opts = antaresRead::simOptions() ) updateScenarioBuilder( ldata, ruleset = "Default Ruleset", series = NULL, clusters_areas = NULL, links = NULL, opts = antaresRead::simOptions() ) clearScenarioBuilder( ruleset = "Default Ruleset", opts = antaresRead::simOptions() ) deduplicateScenarioBuilder( ruleset = "Default Ruleset", opts = antaresRead::simOptions() )
n_scenario |
Number of scenario. |
n_mc |
Number of Monte-Carlo years. |
areas |
Areas to use in scenario builder, if |
areas_rand |
Areas for which to use |
group_bc |
|
group_bc_rand |
|
coef_hydro_levels |
Hydro levels coefficients. |
mode |
|
opts |
List of simulation parameters returned by the function
|
ruleset |
Ruleset to read. |
as_matrix |
If |
ldata |
A |
series |
Name(s) of the serie(s) to update if |
clusters_areas |
A |
links |
Links to use if series is |
scenarioBuilder
: a matrix
readScenarioBuilder
: a list
of matrix
or list
according to as_matrix
parameters.
series = "ntc"
is only available with Antares >= 8.2.0.
For series = "hl"
, each value must be between 0 and 1.
User must enable/disable custom-scenario
property in settings/generaldata.ini
by himself.
series = "bc"
is only available with Antares >= 8.7.0.
For a single matrix, value of series can be :
h or hydro
hl or hydrolevels
l or load
ntc
r or renewables
s or solar
t or thermal
w or wind
## Not run: library(antaresRead) library(antaresEditObject) # simulation path setSimulationPath( path = "pat/to/simulation", simulation = "input" ) # Create a scenario builder matrix sbuilder <- scenarioBuilder( n_scenario = 51, n_mc = 2040, areas_rand = c("fr", "be") ) sbuilder[, 1:6] dim(sbuilder) # Create a scenario builder matrix for hydro levels (use case 1) sbuilder <- scenarioBuilder( n_mc = opts$parameters$general$nbyears, areas = c("fr", "be"), coef_hydro_levels = c(0.1, 0.9) ) # Create a scenario builder matrix for hydro levels (use case 2) sbuilder <- scenarioBuilder( n_mc = opts$parameters$general$nbyears, areas = c("fr", "be"), coef_hydro_levels = c(runif(opts$parameters$general$nbyears) , runif(opts$parameters$general$nbyears) ) ) # Create a scenario builder matrix with # bindings constraints groups (study version >= 8.7.0) # Use parameter "mode" with "bc" sbuilder <- scenarioBuilder( n_scenario = 51, n_mc = 2040, group_bc = c("my_bc_1", "my_bc_2"), group_bc_rand = "my_bc_2", mode = "bc" ) # Read previous scenario builder # in a matrix format prev_sb <- readScenarioBuilder() # Update scenario builder # Single matrix for load serie updateScenarioBuilder(ldata = sbuilder, series = "load") # can be l instead of load # equivalent as updateScenarioBuilder(ldata = list(l = sbuilder)) # for binding constraints (study version >= 8.7.0) updateScenarioBuilder(ldata = sbuilder, series = "bc") # update several series # same input sbuilder updateScenarioBuilder( ldata = sbuilder, series = c("load", "hydro", "solar") ) # List of matrix updateScenarioBuilder(ldata = list( l = load_sb, h = hydro_sb, s = solar_sb )) # Deduplicate scenario builder deduplicateScenarioBuilder() ## End(Not run)
## Not run: library(antaresRead) library(antaresEditObject) # simulation path setSimulationPath( path = "pat/to/simulation", simulation = "input" ) # Create a scenario builder matrix sbuilder <- scenarioBuilder( n_scenario = 51, n_mc = 2040, areas_rand = c("fr", "be") ) sbuilder[, 1:6] dim(sbuilder) # Create a scenario builder matrix for hydro levels (use case 1) sbuilder <- scenarioBuilder( n_mc = opts$parameters$general$nbyears, areas = c("fr", "be"), coef_hydro_levels = c(0.1, 0.9) ) # Create a scenario builder matrix for hydro levels (use case 2) sbuilder <- scenarioBuilder( n_mc = opts$parameters$general$nbyears, areas = c("fr", "be"), coef_hydro_levels = c(runif(opts$parameters$general$nbyears) , runif(opts$parameters$general$nbyears) ) ) # Create a scenario builder matrix with # bindings constraints groups (study version >= 8.7.0) # Use parameter "mode" with "bc" sbuilder <- scenarioBuilder( n_scenario = 51, n_mc = 2040, group_bc = c("my_bc_1", "my_bc_2"), group_bc_rand = "my_bc_2", mode = "bc" ) # Read previous scenario builder # in a matrix format prev_sb <- readScenarioBuilder() # Update scenario builder # Single matrix for load serie updateScenarioBuilder(ldata = sbuilder, series = "load") # can be l instead of load # equivalent as updateScenarioBuilder(ldata = list(l = sbuilder)) # for binding constraints (study version >= 8.7.0) updateScenarioBuilder(ldata = sbuilder, series = "bc") # update several series # same input sbuilder updateScenarioBuilder( ldata = sbuilder, series = c("load", "hydro", "solar") ) # List of matrix updateScenarioBuilder(ldata = list( l = load_sb, h = hydro_sb, s = solar_sb )) # Deduplicate scenario builder deduplicateScenarioBuilder() ## End(Not run)
Search study in AntaREST
searchStudy( workspace = NULL, folder = NULL, name = NULL, ..., host = NULL, token = NULL )
searchStudy( workspace = NULL, folder = NULL, name = NULL, ..., host = NULL, token = NULL )
workspace |
Space in which to search for a study. |
folder |
Folder in which to search for a study. |
name |
Name for the study. |
... |
Other query parameters. |
host |
Host of AntaREST server API. |
token |
API personnal access token. |
a data.table
with informations about studies on the server.
## Not run: searchStudies(host = "http://localhost:8080") ## End(Not run)
## Not run: searchStudies(host = "http://localhost:8080") ## End(Not run)
Two modes are available when using the API:
async: record all API calls, but nothing is sent to the server
sync: send query to the API each time a function is used
setAPImode(mode = c("sync", "async"), opts = antaresRead::simOptions())
setAPImode(mode = c("sync", "async"), opts = antaresRead::simOptions())
mode |
The mode you want to use. |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
## Not run: # See vignette for complete documentation vignette("api-variant-management") # Usage : setAPImode("sync") ## End(Not run)
## Not run: # See vignette for complete documentation vignette("api-variant-management") # Usage : setAPImode("sync") ## End(Not run)
Set path to Antares Solver
setSolverPath(path)
setSolverPath(path)
path |
(optional) Path to the solver (e.g. |
## Not run: setSolverPath(path = "C:/antares/bin/antares-6.0-solver.exe") ## End(Not run)
## Not run: setSolverPath(path = "C:/antares/bin/antares-6.0-solver.exe") ## End(Not run)
Default values are returned according to study version
storage_values_default(opts = simOptions())
storage_values_default(opts = simOptions())
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
a named list
## Not run: storage_values_default() ## End(Not run)
## Not run: storage_values_default() ## End(Not run)
Update a specific section in generaldata.ini file
update_generaldata_by_section(opts, section, new_params)
update_generaldata_by_section(opts, section, new_params)
opts |
List of simulation parameters returned by the function
|
section |
The section to update. |
new_params |
The values to write in the section. |
An updated list containing various information about the simulation.
Update adequacy parameters of an Antares study
updateAdequacySettings( include_adq_patch = NULL, set_to_null_ntc_from_physical_out_to_physical_in_for_first_step = NULL, set_to_null_ntc_between_physical_out_for_first_step = NULL, include_hurdle_cost_csr = NULL, check_csr_cost_function = NULL, enable_first_step = NULL, price_taking_order = NULL, threshold_initiate_curtailment_sharing_rule = NULL, threshold_display_local_matching_rule_violations = NULL, threshold_csr_variable_bounds_relaxation = NULL, opts = antaresRead::simOptions() )
updateAdequacySettings( include_adq_patch = NULL, set_to_null_ntc_from_physical_out_to_physical_in_for_first_step = NULL, set_to_null_ntc_between_physical_out_for_first_step = NULL, include_hurdle_cost_csr = NULL, check_csr_cost_function = NULL, enable_first_step = NULL, price_taking_order = NULL, threshold_initiate_curtailment_sharing_rule = NULL, threshold_display_local_matching_rule_violations = NULL, threshold_csr_variable_bounds_relaxation = NULL, opts = antaresRead::simOptions() )
include_adq_patch |
Logical. If TRUE, will run Adequacy Patch |
set_to_null_ntc_from_physical_out_to_physical_in_for_first_step |
Logical. default to TRUE |
set_to_null_ntc_between_physical_out_for_first_step |
Logical. default to TRUE |
include_hurdle_cost_csr |
Logical. default to FALSE |
check_csr_cost_function |
Logical. default to FALSE |
enable_first_step |
Logical. default to TRUE |
price_taking_order |
Character. can take values DENS (default value) and Load. |
threshold_initiate_curtailment_sharing_rule |
Double. default to 0.0 |
threshold_display_local_matching_rule_violations |
Double. default to 0.0 |
threshold_csr_variable_bounds_relaxation |
Integer. default to 3 |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
## Not run: updateAdequacySettings( include_adq_patch = TRUE, set_to_null_ntc_from_physical_out_to_physical_in_for_first_step = TRUE, set_to_null_ntc_between_physical_out_for_first_step = TRUE ) ## End(Not run)
## Not run: updateAdequacySettings( include_adq_patch = TRUE, set_to_null_ntc_from_physical_out_to_physical_in_for_first_step = TRUE, set_to_null_ntc_between_physical_out_for_first_step = TRUE ) ## End(Not run)
Update general parameters of an Antares study
updateGeneralSettings( mode = NULL, horizon = NULL, nbyears = NULL, simulation.start = NULL, simulation.end = NULL, january.1st = NULL, first.month.in.year = NULL, first.weekday = NULL, leapyear = NULL, year.by.year = NULL, derated = NULL, custom.scenario = NULL, custom.ts.numbers = deprecated(), user.playlist = NULL, filtering = NULL, active.rules.scenario = NULL, generate = NULL, nbtimeseriesload = NULL, nbtimeserieshydro = NULL, nbtimeserieswind = NULL, nbtimeseriesthermal = NULL, nbtimeseriessolar = NULL, refreshtimeseries = NULL, intra.modal = NULL, inter.modal = NULL, refreshintervalload = NULL, refreshintervalhydro = NULL, refreshintervalwind = NULL, refreshintervalthermal = NULL, refreshintervalsolar = NULL, readonly = NULL, geographic.trimming = NULL, thematic.trimming = NULL, opts = antaresRead::simOptions() )
updateGeneralSettings( mode = NULL, horizon = NULL, nbyears = NULL, simulation.start = NULL, simulation.end = NULL, january.1st = NULL, first.month.in.year = NULL, first.weekday = NULL, leapyear = NULL, year.by.year = NULL, derated = NULL, custom.scenario = NULL, custom.ts.numbers = deprecated(), user.playlist = NULL, filtering = NULL, active.rules.scenario = NULL, generate = NULL, nbtimeseriesload = NULL, nbtimeserieshydro = NULL, nbtimeserieswind = NULL, nbtimeseriesthermal = NULL, nbtimeseriessolar = NULL, refreshtimeseries = NULL, intra.modal = NULL, inter.modal = NULL, refreshintervalload = NULL, refreshintervalhydro = NULL, refreshintervalwind = NULL, refreshintervalthermal = NULL, refreshintervalsolar = NULL, readonly = NULL, geographic.trimming = NULL, thematic.trimming = NULL, opts = antaresRead::simOptions() )
mode |
Economy, Adequacy, Draft. |
horizon |
Reference year (static tag, not used in the calculations) |
nbyears |
Number of Monte-Carlo years that should be prepared for the simulation (not always the same as the Number of MC years actually simulated, see 'selection mode' below). |
simulation.start |
First day of the simulation (e.g. 8 for a simulation beginning on the second week of the first month of the year) |
simulation.end |
Last day of the simulation (e.g. 28 for a simulation ending on the fourth week of the first month of the year) |
january.1st |
First day of the year (Mon, Tue, etc.). |
first.month.in.year |
Actual month by which the Time-series begin (Jan to Dec, Oct to Sep, etc.) |
first.weekday |
In economy or adequacy simulations, indicates the frame (Mon- Sun, Sat-Fri, etc.) to use for the edition of weekly results. |
leapyear |
(TRUE/FALSE) indicates whether February has 28 or 29 days. |
year.by.year |
(False) No individual results will be printed out, (True) For each simulated year, detailed results will be printed out in an individual directory7 : Study_name/OUTPUT/simu_tag/Economy /mc-i-number |
derated |
See Antares General Reference Guide. |
custom.scenario |
See Antares General Reference Guide (see link below). Replace custom.ts.numbers. |
custom.ts.numbers |
See Antares General Reference Guide (see link below). Replaced by custom.scenario. |
user.playlist |
See Antares General Reference Guide (see link below). |
filtering |
See Antares General Reference Guide (see link below). |
active.rules.scenario |
See Antares General Reference Guide (see link below). |
generate |
See Antares General Reference Guide (see link below). |
nbtimeseriesload |
See Antares General Reference Guide (see link below). |
nbtimeserieshydro |
See Antares General Reference Guide (see link below). |
nbtimeserieswind |
See Antares General Reference Guide (see link below). |
nbtimeseriesthermal |
See Antares General Reference Guide (see link below). |
nbtimeseriessolar |
See Antares General Reference Guide (see link below). |
refreshtimeseries |
See Antares General Reference Guide (see link below). |
intra.modal |
See Antares General Reference Guide (see link below). |
inter.modal |
See Antares General Reference Guide (see link below). |
refreshintervalload |
See Antares General Reference Guide (see link below). |
refreshintervalhydro |
See Antares General Reference Guide (see link below). |
refreshintervalwind |
See Antares General Reference Guide (see link below). |
refreshintervalthermal |
See Antares General Reference Guide (see link below). |
refreshintervalsolar |
See Antares General Reference Guide (see link below). |
readonly |
See Antares General Reference Guide (see link below). |
geographic.trimming |
|
thematic.trimming |
See Antares General Reference Guide (see link below). |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
Antares General Reference Guide
## Not run: # Update number of Monte-Carlo years updateGeneralSettings(nbyears = 42) # Use a vector to update a parameter that # can take multiple values updateGeneralSettings(generate = c("thermal", "hydro")) ## End(Not run)
## Not run: # Update number of Monte-Carlo years updateGeneralSettings(nbyears = 42) # Use a vector to update a parameter that # can take multiple values updateGeneralSettings(generate = c("thermal", "hydro")) ## End(Not run)
Update input parameters of an Antares study
updateInputSettings(import, opts = antaresRead::simOptions())
updateInputSettings(import, opts = antaresRead::simOptions())
import |
Series to import. |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
## Not run: updateInputSettings(import = c("thermal")) updateInputSettings(import = c("hydro", "thermal")) ## End(Not run)
## Not run: updateInputSettings(import = c("thermal")) updateInputSettings(import = c("hydro", "thermal")) ## End(Not run)
Update optimization parameters and other preferences of an Antares study
updateOptimizationSettings( simplex.range = NULL, transmission.capacities = NULL, include.constraints = NULL, include.hurdlecosts = NULL, include.tc.min.stable.power = NULL, include.tc.min.up.down.time = NULL, include.dayahead = NULL, include.strategicreserve = NULL, include.spinningreserve = NULL, include.primaryreserve = NULL, include.exportmps = NULL, solver.log = NULL, power.fluctuations = NULL, shedding.strategy = NULL, shedding.policy = NULL, unit.commitment.mode = NULL, number.of.cores.mode = NULL, renewable.generation.modelling = NULL, day.ahead.reserve.management = NULL, opts = antaresRead::simOptions() )
updateOptimizationSettings( simplex.range = NULL, transmission.capacities = NULL, include.constraints = NULL, include.hurdlecosts = NULL, include.tc.min.stable.power = NULL, include.tc.min.up.down.time = NULL, include.dayahead = NULL, include.strategicreserve = NULL, include.spinningreserve = NULL, include.primaryreserve = NULL, include.exportmps = NULL, solver.log = NULL, power.fluctuations = NULL, shedding.strategy = NULL, shedding.policy = NULL, unit.commitment.mode = NULL, number.of.cores.mode = NULL, renewable.generation.modelling = NULL, day.ahead.reserve.management = NULL, opts = antaresRead::simOptions() )
simplex.range |
week or day |
transmission.capacities |
true, false or infinite (since v8.4 can also take : local-values, null-for-all-links, infinite-for-all-links, null-for-physical-links, infinite-for-physical-links) |
include.constraints |
true or false |
include.hurdlecosts |
true or false |
include.tc.min.stable.power |
true or false |
include.tc.min.up.down.time |
true or false |
include.dayahead |
true or false |
include.strategicreserve |
true or false |
include.spinningreserve |
true or false |
include.primaryreserve |
true or false |
include.exportmps |
true or false (since v8.3.2 can take also : none, optim-1, optim-2, both-optims) |
solver.log |
true or false (available for version >= 8.8) |
power.fluctuations |
free modulations, minimize excursions or minimize ramping |
shedding.strategy |
share margins |
shedding.policy |
shave peaks or minimize duration |
unit.commitment.mode |
fast or accurate |
number.of.cores.mode |
minimum, low, medium, high or maximum |
renewable.generation.modelling |
aggregated or clusters |
day.ahead.reserve.management |
global |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
## Not run: updateOptimizationSettings( simplex.range = "week", power.fluctuations = "minimize ramping" ) ## End(Not run)
## Not run: updateOptimizationSettings( simplex.range = "week", power.fluctuations = "minimize ramping" ) ## End(Not run)
Update output parameters of an Antares study
updateOutputSettings( synthesis = NULL, storenewset = NULL, archives = NULL, result.format = NULL, opts = antaresRead::simOptions() )
updateOutputSettings( synthesis = NULL, storenewset = NULL, archives = NULL, result.format = NULL, opts = antaresRead::simOptions() )
synthesis |
Logical. If TRUE, synthetic results will be stored in a directory Study_name/OUTPUT/simu_tag/Economy/mc-all. If FALSE, No general synthesis will be printed out. See Antares General Reference Guide (see link below). |
storenewset |
Logical. See Antares General Reference Guide (see link below). |
archives |
Character vector. Series to archive. See Antares General Reference Guide (see link below). |
result.format |
Character. Output format (txt-files or zip). See Antares General Reference Guide (see link below). |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
Antares General Reference Guide
## Not run: updateOutputSettings( synthesis = TRUE, storenewset = FALSE, archives = c("load", "wind"), result.format = "zip" ) ## End(Not run)
## Not run: updateOutputSettings( synthesis = TRUE, storenewset = FALSE, archives = c("load", "wind"), result.format = "zip" ) ## End(Not run)
API: create a new variant for a given study or use a pre-existing one.
createVariant(name, opts = antaresRead::simOptions()) useVariant(name, variant_id = NULL, opts = antaresRead::simOptions())
createVariant(name, opts = antaresRead::simOptions()) useVariant(name, variant_id = NULL, opts = antaresRead::simOptions())
name |
Name for the variant to create or the name of an existent variant. |
opts |
List of simulation parameters returned by the function
|
variant_id |
ID of the variant to use, if specified |
An updated list containing various information about the simulation.
## Not run: # See vignette for complete documentation vignette("api-variant-management") ## End(Not run)
## Not run: # See vignette for complete documentation vignette("api-variant-management") ## End(Not run)
Get API commands generated
getVariantCommands( last = NULL, actions = NULL, opts = antaresRead::simOptions() ) writeVariantCommands( path, last = NULL, actions = NULL, ..., opts = antaresRead::simOptions() )
getVariantCommands( last = NULL, actions = NULL, opts = antaresRead::simOptions() ) writeVariantCommands( path, last = NULL, actions = NULL, ..., opts = antaresRead::simOptions() )
last |
Return the last command generated if |
actions |
A |
opts |
List of simulation parameters returned by the function
|
path |
Path to the JSON file to write on disk. |
... |
Additional arguments passed to |
a list of commands to edit a variant
Write configuration options in file or API
writeIni( listData, pathIni, opts = antaresRead::simOptions(), ..., default_ext = ".ini" ) writeIniFile(listData, pathIni, overwrite = FALSE) writeIniAPI(listData, pathIni, opts)
writeIni( listData, pathIni, opts = antaresRead::simOptions(), ..., default_ext = ".ini" ) writeIniFile(listData, pathIni, overwrite = FALSE) writeIniAPI(listData, pathIni, opts)
listData |
|
pathIni |
|
opts |
List of simulation parameters returned by the function
|
... |
Additional arguments. |
default_ext |
Default extension used for config files. |
overwrite |
logical, should file be overwritten if already exist? |
## Not run: pathIni <- "D:/exemple_test/settings/generaldata.ini" generalSetting <- readIniFile(pathIni) generalSetting$output$synthesis <- FALSE writeIni(generalSetting, pathIni) ## End(Not run)
## Not run: pathIni <- "D:/exemple_test/settings/generaldata.ini" generalSetting <- readIniFile(pathIni) generalSetting$output$synthesis <- FALSE writeIni(generalSetting, pathIni) ## End(Not run)
This function allows to create or edit economic options. Areas/options present in the input dataframe are edited, while all other values are left unchanged.
writeEconomicOptions(x, opts = antaresRead::simOptions())
writeEconomicOptions(x, opts = antaresRead::simOptions())
x |
A dataframe. Must contain an |
opts |
List of simulation parameters returned by the function
|
## Not run: library(antaresRead) # Set simulation path setSimulationPath(path = "PATH/TO/SIMULATION", simulation = "input") # Write some economic options for areas a, b and c writeEconomicOptions(data.frame( area = c("a", "b", "c"), dispatchable_hydro_power = c(TRUE, FALSE, FALSE), spread_unsupplied_energy_cost = c(0.03, 0.024, 0.01), average_spilled_energy_cost = c(10, 8, 8), stringsAsFactors = FALSE )) ## End(Not run)
## Not run: library(antaresRead) # Set simulation path setSimulationPath(path = "PATH/TO/SIMULATION", simulation = "input") # Write some economic options for areas a, b and c writeEconomicOptions(data.frame( area = c("a", "b", "c"), dispatchable_hydro_power = c(TRUE, FALSE, FALSE), spread_unsupplied_energy_cost = c(0.03, 0.024, 0.01), average_spilled_energy_cost = c(10, 8, 8), stringsAsFactors = FALSE )) ## End(Not run)
Write waterValues, reservoirLevels, maxpower, inflowPattern and creditModulations data for a given area.
writeHydroValues( area, type, data, overwrite = TRUE, opts = antaresRead::simOptions() )
writeHydroValues( area, type, data, overwrite = TRUE, opts = antaresRead::simOptions() )
area |
The area where to add the values. |
type |
Type of hydro file, it can be "waterValues", "reservoir", "maxpower", "inflowPattern" or "creditmodulations". |
data |
The data must have specific dimension depending on the type of file :
|
overwrite |
Logical. Overwrite the values if a file already exists. |
opts |
List of simulation parameters returned by the function
|
For an Antares version >= 860, control of data consistency between mingen.txt
and maxpower_<area>.txt
can be executed.
This control depends on the values you find in hydro.ini
file.
## Not run: writeHydroValues("fictive_area", type = "inflowPattern", data = matrix(rep(0, 365*1), nrow = 365)) ## End(Not run)
## Not run: writeHydroValues("fictive_area", type = "inflowPattern", data = matrix(rep(0, 365*1), nrow = 365)) ## End(Not run)
For a given area, write its data in the hydro.ini file.
writeIniHydro(area, params, mode = "other", opts = antaresRead::simOptions())
writeIniHydro(area, params, mode = "other", opts = antaresRead::simOptions())
area |
The area where to edit the values. |
params |
The list data must have specific names and specific types :
|
mode |
Execution mode. Useful when you create a new area or remove an existing area to avoid control on hydro data. |
opts |
List of simulation parameters returned by the function
|
For an Antares version >= 860, control of data consistency between mingen.txt
and mod.txt
can be executed.
For an Antares version >= 860, control of data consistency between mingen.txt
and maxpower_<area>.txt
can be executed.
These controls depend on the values you find in hydro.ini
file.
## Not run: opts <- setSimulationPath(studypath, simulation = "input") createArea("fictive_area") writeIniHydro(area = "fictive_area" , params = list("leeway low" = 2.5, "leeway up" = 25)) ## End(Not run)
## Not run: opts <- setSimulationPath(studypath, simulation = "input") createArea("fictive_area") writeIniHydro(area = "fictive_area" , params = list("leeway low" = 2.5, "leeway up" = 25)) ## End(Not run)
This function writes input time series in an Antares project.
writeInputTS( data, type = c("load", "hydroROR", "hydroSTOR", "mingen", "wind", "solar", "tsLink"), area = NULL, link = NULL, overwrite = TRUE, opts = antaresRead::simOptions() )
writeInputTS( data, type = c("load", "hydroROR", "hydroSTOR", "mingen", "wind", "solar", "tsLink"), area = NULL, link = NULL, overwrite = TRUE, opts = antaresRead::simOptions() )
data |
A 8760*N matrix of hourly time series, except when |
type |
Serie to write: If type == |
area |
The area where to write the input time series. |
link |
Link for which writing transmission capacities time series,
must like |
overwrite |
Logical. Overwrite the values if a file already exists. |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
You cannot use area
and link
arguments at the same time.
For an Antares version >= 860, control of data consistency between mingen.txt
and mod.txt
can be executed.
These controls depend on the values you find in hydro.ini
file.
For an Antares version >= 860, the mingen.txt
file is created.
The mingen.txt
file can be created under two conditions:
The number of columns must be equal to either 1
or the number in mod.txt
If the mod.txt
file is empty or has one column, then there is no dimension constraint
## Not run: # Write solar time series writeInputTS( area = "fictive_area", type = "solar", data = matrix(rep(4, 8760*2), nrow = 8760) ) ## End(Not run)
## Not run: # Write solar time series writeInputTS( area = "fictive_area", type = "solar", data = matrix(rep(4, 8760*2), nrow = 8760) ) ## End(Not run)
writeMiscGen(data, area, opts = antaresRead::simOptions())
writeMiscGen(data, area, opts = antaresRead::simOptions())
data |
Data to write. |
area |
Name of the area for which to write data. |
opts |
List of simulation parameters returned by the function
|
An updated list containing various information about the simulation.
## Not run: writeMiscGen(matrix(data = c(rep(0, 8760 * 7), rep(-100000, 8760)), ncol = 8), "area1") ## End(Not run)
## Not run: writeMiscGen(matrix(data = c(rep(0, 8760 * 7), rep(-100000, 8760)), ncol = 8), "area1") ## End(Not run)
This function write all output values for an Antares study.
writeOutputValues(data, opts = NULL)
writeOutputValues(data, opts = NULL)
data |
obtain with readAntares |
opts |
List of simulation parameters returned by the function
|
## Not run: library(antaresRead) library(data.table) opts <- setSimulationPath("my_study") data <- readAntares(links = "all", areas = "all", clusters = "all") writeOutputValues(data) ## End(Not run)
## Not run: library(antaresRead) library(data.table) opts <- setSimulationPath("my_study") data <- readAntares(links = "all", areas = "all", clusters = "all") writeOutputValues(data) ## End(Not run)
This function allows to write load, wind and solar prepro data. Using
character(0)
allows to erase data (cf Examples).
writeSeriesPrepro( area, type = c("load", "wind", "solar"), coefficients = NULL, daily_profile = NULL, translation = NULL, conversion = NULL, overwrite = TRUE, opts = antaresRead::simOptions() )
writeSeriesPrepro( area, type = c("load", "wind", "solar"), coefficients = NULL, daily_profile = NULL, translation = NULL, conversion = NULL, overwrite = TRUE, opts = antaresRead::simOptions() )
area |
The area where to write prepro data. |
type |
Type of data to write : |
coefficients |
A 12*6 matrix of monthly values for the primary parameters alpha, beta, gamma, delta, theta and mu. |
daily_profile |
A 24*12 matrix of hourly / monthly coefficients K(hm) that are used to modulate the values of the stationary stochastic process by which the actual process is approximated. |
translation |
A vector of length 8760 (or 8760*1 matrix) to add to the time-series generated, prior or after scaling. |
conversion |
A 2*N matrix (with 1<=N<=50) that is used to turn the initial time-series produced by the generators into final data. See Antares General Reference Guide. |
overwrite |
Logical. Overwrite the values if a file already exists. |
opts |
List of simulation parameters returned by the function
|
## Not run: writeSeriesPrepro("fictive_area", type = "solar", daily_profile = matrix(rep(1, 24*12), nrow = 24)) # Erase daily profile data: writeSeriesPrepro("fictive_area", type = "solar", daily_profile = character(0)) ## End(Not run)
## Not run: writeSeriesPrepro("fictive_area", type = "solar", daily_profile = matrix(rep(1, 24*12), nrow = 24)) # Erase daily profile data: writeSeriesPrepro("fictive_area", type = "solar", daily_profile = character(0)) ## End(Not run)
Write water values for a given area.
writeWaterValues( area, data = NULL, overwrite = TRUE, opts = antaresRead::simOptions() )
writeWaterValues( area, data = NULL, overwrite = TRUE, opts = antaresRead::simOptions() )
area |
The area where to add the water values. |
data |
A 365x101 numeric matrix: table of marginal values for the stored energy, which depends on the date (365 days) and on the reservoir level (101 round percentage values ranging from 0% to 100%). OR a 3-column matrix with 365x101 rows. In this latter case the 3 columns must be 'date', 'level' and 'value' (in this order), and the rows must be sorted by: ascending day, ascending level. |
overwrite |
Logical. Overwrite the values if a file already exists. |
opts |
List of simulation parameters returned by the function
|
## Not run: writeWaterValues("fictive_area", data = matrix(rep(0, 365*101), nrow = 365)) ## End(Not run)
## Not run: writeWaterValues("fictive_area", data = matrix(rep(0, 365*101), nrow = 365)) ## End(Not run)