From b184012f80e5e8987e5e30dba972645bcb425ea5 Mon Sep 17 00:00:00 2001
From: kemihak You need to set the path to an Antares study in “input” mode: To update an existing time series and write it, you can use the following commands : Antares v8.0.3 allow to work with renewable energy sources, implemented in Antares as a new functionnality: renewables clusters. Here’s a quick start guide to use those new features. As always, setup the study you want to use: We can specify specific clusters with: For NTC serie (Antares >= 8.2.0), it writes the scenario for all links : Vargas T, Breant F, Perrier V (2023).
antaresEditObject: Edit an 'Antares' Simulation.
-R package version 0.6.0, https://github.com/rte-antares-rpackage/antaresEditObject.
+R package version 0.6.1, https://github.com/rte-antares-rpackage/antaresEditObject.
NEW FEATURES : BUGFIXES : Create the correspondence data frame between the symbol and the type in scenario builder a Antares new features v8.6.0
-
library(antaresEditObject)
+
# CRAN limite CPU usage
+data.table::setDTthreads(2)
+library(antaresEditObject)
#> Loading required package: antaresRead
#>
#> Attaching package: 'antaresEditObject'
diff --git a/docs/articles/antaresEditObject.html b/docs/articles/antaresEditObject.html
index 1ed36138..05d4a2a7 100644
--- a/docs/articles/antaresEditObject.html
+++ b/docs/articles/antaresEditObject.html
@@ -33,7 +33,7 @@
Prerequisites
-
+library(antaresEditObject)
# CRAN limite CPU usage
+data.table::setDTthreads(2)
+library(antaresEditObject)
antaresRead::setSimulationPath(path = "path/to/study", simulation = "input")
Run an Antares simulation path_solver = "C:/path/to/antares-solver.exe",
show_output_on_console = TRUE
)
+
+
Read a time series, update it and write it
+
+
+
# Filepath of the study, version >= 820
+my_study <- file.path("", "", "")
+opts <- setSimulationPath(my_study, simulation ="input")
+opts$timeIdMax <- 8760
+
+# Links, use only one link
+my_link <- as.character(getLinks()[1])
+ts_input <- readInputTS(linkCapacity = my_link, opts = opts)
+
+# Sort the data to ensure its reliability
+data.table::setorder(ts_input, cols = "tsId", "timeId")
+
+# Reshape to wide format : writeInputTS expects a 8760 * N matrix
+metrics <- c("transCapacityDirect", "transCapacityIndirect")
+ts_input_reformatted <- data.table::dcast(ts_input,
+ timeId ~ tsId,
+ value.var = metrics
+ )
+# Add a value my_param to your matrix
+my_param <- 123
+writeInputTS(data = ts_input_reformatted[,2:ncol(ts_input_reformatted)] + my_param,
+ type = "tsLink",
+ link = my_link,
+ overwrite = TRUE,
+ opts = opts
+ )
+
+
+# Thermal, use only one area and one cluster
+my_area <- "zone"
+my_cluster <- "mon_cluster"
+ts_input <- readInputTS(thermalAvailabilities = my_area, opts = opts)
+ts_input <- ts_input[cluster == paste0(my_area,"_",my_cluster)]
+
+# Sort the data to ensure its reliability
+data.table::setorder(ts_input, cols = "tsId", "timeId")
+
+# Reshape to wide format : writeInputTS expects a 8760 * N matrix
+metrics <- c("ThermalAvailabilities")
+ts_input_reformatted <- data.table::dcast(ts_input,
+ timeId ~ tsId,
+ value.var = metrics
+ )
+
+# Add a value my_param to your matrix
+my_param <- 1000
+editCluster(area = my_area,
+ cluster_name = my_cluster,
+ time_series = ts_input_reformatted[,2:ncol(ts_input_reformatted)] + my_param,
+ opts = opts
+ )
+
+
+# Run of River, use only one area
+my_area <- "zone"
+ts_input <- readInputTS(ror = my_area, opts = opts)
+
+# Sort the data to ensure its reliability
+data.table::setorder(ts_input, cols = "tsId", "timeId")
+
+# Reshape to wide format : writeInputTS expects a 8760 * N matrix
+metrics <- c("ror")
+ts_input_reformatted <- data.table::dcast(ts_input,
+ timeId ~ tsId,
+ value.var = metrics
+)
+
+# Add a value my_param to your matrix
+my_param <- 1000
+writeInputTS(area = my_area,
+ type = "hydroROR",
+ data = ts_input_reformatted[,2:ncol(ts_input_reformatted)] + my_param,
+ overwrite = TRUE,
+ opts = opts
+)
Variant management with API
-
library(antaresEditObject)
+
# CRAN limite CPU usage
+data.table::setDTthreads(2)
+library(antaresEditObject)
#> Loading required package: antaresRead
#>
#> Attaching package: 'antaresEditObject'
@@ -588,7 +590,7 @@
Scenario builder#> "action": "update_config",
#> "args": {
#> "target": "settings/scenariobuilder/Default Ruleset",
-#> "data": {"l,area01,0":1,"l,area01,1":2,"l,area01,2":3,"l,area01,3":1,"l,area01,4":2,"l,area01,5":3} [truncated]...
+#> "data": []
#> }
#> }
#> ]
Renewables Energy Sources
+ # CRAN limite CPU usage
+data.table::setDTthreads(2)
+library(antaresEditObject)
diff --git a/docs/articles/scenario-builder.html b/docs/articles/scenario-builder.html
index d0ea52b3..d3b1453e 100644
--- a/docs/articles/scenario-builder.html
+++ b/docs/articles/scenario-builder.html
@@ -33,7 +33,7 @@
Scenario Builder
-
library(antaresEditObject)
+
# CRAN limite CPU usage
+data.table::setDTthreads(2)
+library(antaresEditObject)
#> Loading required package: antaresRead
#>
#> Attaching package: 'antaresEditObject'
@@ -237,29 +239,19 @@
Scenario Builder
)
readScenarioBuilder()$t
-#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
-#> earth_africa 2 3 1 2 3 1 2 3 1 2
-#> earth_america 2 3 1 2 3 1 2 3 1 2
-#> earth_europe 2 3 1 2 3 1 2 3 1 2
-#> moon_serenety 3 1 2 3 1 2 3 1 2 3
-#> moon_tranquility 3 1 2 3 1 2 3 1 2 3
updateScenarioBuilder(
ldata = my_scenario,
series = "thermal",
- clusters_areas = data.table::data.table(
+ clusters_areas = data.table::data.table(
area = c("earth", "earth"),
cluster = c("africa", "europe")
)
)
readScenarioBuilder()$t
-#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
-#> earth_africa 2 3 1 2 3 1 2 3 1 2
-#> earth_america NA NA NA NA NA NA NA NA NA NA
-#> earth_europe 2 3 1 2 3 1 2 3 1 2
-#> moon_serenety NA NA NA NA NA NA NA NA NA NA
-#> moon_tranquility NA NA NA NA NA NA NA NA NA NA
updateScenarioBuilder(
diff --git a/docs/authors.html b/docs/authors.html
index 33f0b4c4..89865d03 100644
--- a/docs/authors.html
+++ b/docs/authors.html
@@ -17,7 +17,7 @@
Citation
@Manual{,
title = {antaresEditObject: Edit an 'Antares' Simulation},
author = {Tatiana Vargas and Frederic Breant and Victor Perrier},
year = {2023},
- note = {R package version 0.6.0},
+ note = {R package version 0.6.1},
url = {https://github.com/rte-antares-rpackage/antaresEditObject},
}
diff --git a/docs/index.html b/docs/index.html
index b662f1c1..da6cfcfc 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -35,7 +35,7 @@
diff --git a/docs/news/index.html b/docs/news/index.html
index bcf19122..bd97514c 100644
--- a/docs/news/index.html
+++ b/docs/news/index.html
@@ -17,7 +17,7 @@
@@ -69,6 +69,13 @@ Changelog
Source: NEWS.md
+ antaresEditObject 0.6.1
+Breaking changes
+writeInputTS()
allows the user to set a link with the separator ’ - ’ (ex: ‘area1 - area2’)antaresEditObject 0.6.0
Breaking c
enable-first-step
in adequacy patch
section in settings/generaldata.ini
deduplicateScenarioBuilder()
function to keep the last value if a key is duplicated in settings/scenariobuilder.dat
+writeIniHydro()
function to make easier the edition of the input/hydro/hydro.ini
filewriteIniHydro()
in createArea()
and removeArea()
+settings/scenariobuilder.dat
by using scenarioBuilder()
and updateScenarioBuilder()
+deduplicateScenarioBuilder()
function to keep the last value if a key is duplicated in settings/scenariobuilder.datwriteIniHydro()
function to make easier the edition of the input/hydro/hydro.ini filewriteIniHydro()
in createArea()
and removeArea()
+removeArea()
removes only expected files in links directoryBreaking changes
@@ -110,6 +127,8 @@ Breaking changesremoveLink() delete properly data for an Antares version >= 820
rollback_to_previous_data()
enable to rollback if original value is NULLwriteInputTS()
allows the user to set a link with the separator ’ - ’ (ex: ‘area1 - area2’)api_command_execute()
add timer to request apiSee also
Examples
-
+ if (FALSE) {
+
+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)
+ )
+)
+
+}
+
Create the correspondence data frame between the symbol and the type in scenario builder
+ Source: R/scenarioBuilder.R
+ create_referential_series_type.Rd
create_referential_series_type()
Value
+
+
+data.frame
.All functions
createPSP()
getCapacityPSP()
editPSP()
Create a Pumped Storage Power plant (PSP)
Create the correspondence data frame between the symbol and the type in scenario builder
Areas for which to use "rand"
.
Hydro levels coefficients.
List of simulation parameters returned by the function
antaresRead::setSimulationPath()
A matrix
obtained with scenarioBuilder
,
or a named list of matrices obtained with scenarioBuilder
, names must be
-'l', 'h', 'w', 's', 't', 'r' or 'ntc', depending on the series to update.
series = "ntc"
is only available with Antares >= 8.2.0.
series = "ntc"
is only available with Antares >= 8.2.0.
+series = "hl"
each value must be between 0 and 1.
if (FALSE) {
+
+updateOutputSettings(
+ synthesis = TRUE,
+ storenewset = FALSE,
+ archives = c("load", "wind"),
+ result.format = "zip"
+)
+
+}
+
+
Link for which writing transmission capacities time series,
-must like "area01%area02"
or c("area01", "area02")
.
"area01%area02"
or "area01 - area02"
or c("area01", "area02")
.