Learn R Programming

⚠️There's a newer version (0.9.2) of this package.Take me there.

antaresEditObject

Edit an Antares study before running simulation.

Overview

This package provide methods to create (and remove) area, links between them, thermal cluster and binding constraints. These steps maybe usefull before running an Antares simulation.

Install from CRAN:

install.packages("antaresEditObject")

Or install dev version from GitHub :

# with remotes
remotes::install_github("rte-antares-rpackage/antaresEditObject")

# or with install-github.me service (based on remotes) (Works well with RTE proxy)
source("https://install-github.me/rte-antares-rpackage/antaresEditObject")

# or with devtools
devtools::install_github("rte-antares-rpackage/antaresEditObject")

Prerequisites

You need to set the path to an Antares simulation in "input" mode :

antaresRead::setSimulationPath(path = "path/to/study", simulation = "input")

Or you can simply create a new study :

createStudy("path/to/study")

Save simulation

Before modifying your simulation, you can save it in an archive :

backupStudy(what = "input")

This will create a .tar.gz file in your simulation folder.

Create a new area

You can create a new area with :

library("antaresEditObject")

createArea(name = "myarea")

# The new area should appear here :
antaresRead::getAreas()

You can specify the localization of the area on the map, and also color.

There are two helper function for area parameters :

  • filteringOptions() for filtering options, like filter-year-by-year
  • nodalOptimizationOptions() for nodal optimizations options.

Create a new cluster

You can initialize a cluster with some parameters :

createCluster(
  area = "myarea", 
  cluster_name = "myareacluster",
  group = "other",
  unitcount = 1,
  nominalcapacity = 8400,
  `min-down-time` = 0,
  `marginal-cost` = 0.010000,
  `market-bid-cost` = 0.010000
)

You can edit the settings of an existing cluster :

editCluster(
  area = "myarea", 
  cluster_name = "myareacluster", 
  nominalcapacity = 10600.000
)

Create a new link

createLink(
  from = "area1", 
  to = "area2", 
  propertiesLink = propertiesLinkOptions(
    hurdles_cost = FALSE,
    transmission_capacities = "enabled"
  ), 
  dataLink = NULL
)

You can edit the settings of an existing link :

editLink(
  from = "area1",
  to = "area2",
  transmission_capacities = "infinite"
)

Create a binding constraint

createBindingConstraint(
  name = "myconstraint", 
  values = matrix(data = c(rep(c(19200, 0, 0), each = 366)), ncol = 3), 
  enabled = FALSE, 
  timeStep = "daily",
  operator = "both",
  coefficients = c("fr%myarea" = 1)
)

Create several Pumped Storage Power plant (PSP)

pspData <- data.frame(
  area = c("a", "b"), 
  installedCapacity = c(800,900)
)

createPSP(
  areasAndCapacities = pspData, 
  efficiency = 0.75
)

Create several Demand Side Response (DSR)

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)

Update general settings

For example, set the output of simulation year by year, and limit the number of Monte-Carlo years to 10 :

updateGeneralSettings(year.by.year = TRUE, nbyears = 10)

Remove methods

You can remove from input folder areas, links, clusters and binding constraints with remove* functions, e.g. :

removeArea("myarea")

Run Time-Series Generator

First, update general settings to activate time series to generate :

updateGeneralSettings(generate = "thermal")

Then run TS-generator:

runTsGenerator(
  path_solver = "C:/path/to/antares-solver.exe", 
  show_output_on_console = TRUE
)

Run an Antares simulation

Launch an Antares simulation from R :

runSimulation(
  name = "myAwesomeSimulation", 
  mode = "economy",
  path_solver = "C:/path/to/antares-solver.exe", 
  show_output_on_console = TRUE
)

Copy Link

Version

Install

install.packages('antaresEditObject')

Monthly Downloads

415

Version

0.1.6

License

GPL (>= 2) | file LICENSE

Maintainer

Frederic Breant

Last Published

May 13th, 2019

Functions in antaresEditObject (0.1.6)

createCluster

Create a thermal cluster
readIniFile

Read a INI file
writeIni

Write ini file from list obtain by antaresRead:::readIniFile and modify by user
createDSR

Create a Demand Side Response (DSR)
editLink

Edit a link between two areas
propertiesLinkOptions

Properties for creating a link
setPlaylist

Set the playlist of an Antares Study
scenario-builder

Read, create & update scenario builder
writeWaterValues

Write water values
removeArea

Remove An Area From inputs
createStudy

Create an empty Antares study
createPSP

Create a Pumped Storage Power plant (PSP)
removeBindingConstraint

Remove a Binding Constraint
updateInputSettings

Update input parameters of an Antares study
updateOptimizationSettings

Update optimization parameters of an Antares study
createDistrict

Create a district
createLink

Create a link between two areas
dicoGeneralSettings

Correspondence between arguments of updateGeneralSettings and actual Antares parameters.
nodalOptimizationOptions

Nodal optimization parameters for creating an area
removeCluster

Remove a cluster
createBindingConstraint

Create a Binding Constraint
createArea

Create An Area In An Antares Study
is_antares_v7

Is study an Antares v7 study ?
dicoOptimizationSettings

Correspondence between arguments of updateOptimizationSettings and actual Antares parameters.
runSimulation

Run an Antares Simulation
runTsGenerator

Run Time-Series Generator
backupStudy

Create a backup with an Antares Study
removeLink

Remove a link between two ares
checkRemovedArea

Seek for a removed area
filteringOptions

Output profile options for creating an area
getPlaylist

Get the playlist of an Antares study
updateGeneralSettings

Update general parameters of an Antares study
setSolverPath

Set path to Antares Solver
editCluster

Edit an existing cluster