Code Monkey home page Code Monkey logo

antaresxpansion's Introduction

Travis-CI Build Status AppVeyor Build Status Coverage Status

antares-rpackageXpansion

This package works along with RTE's adequacy software ANTARES : https://antares.rte-france.com/

antaresXpansion is the package which optimizes the installed capacities of an ANTARES study. Typical uses of the package are for:

  • long-term scenario building: build an economically consistent long-term generation mix
  • transmission expansion planning : compute the network developement which maximizes social welfare

The investment decisions are optimized by running ANTARES' simulations iteratively. At each iteration, the installed capacity of the investments are updated, and the simulations are repeated until the total costs have converged to a minimum. The total cost evaluated in this problem are the sum of the expected operation cost during one year and the investment annuity.

antaresXpansion is currently under development. Feel free to submit any issue.

Definition of investment candidates

Concept

The user of the package defines investiment candidates. Each investment candidate is characterized with the following properties:

  • name: name of the investment candidate
  • link: link whose capacity will be invested
  • annual cost per MW: investment cost, per year and per MW
  • unit size: size, in MW, of an investment unit (e.g. one group of 300 MW)
  • maximum units: maximum number of units which can be built

Concretely, the investiment decision will affect only the capacity of the ANTARES' links. Investing in interconnections can be made directly with the package, while investing in generation capacity or storage capacity can be made using the so-called concept of "virtual nodes" with ANTARES.

The definition of all the investment candidates is given in a new input file, located in the user folder of the study: ./user/expansion/candidates.ini. The syntax used within this file is illustrated in the example below.

Example

An example with two investments candidates, one in semi-base generation and one in network capacity, is given below.

The invested semi-base generation in area 1 is shifted in the "virtual node" invest_semibase. Within the optimization process, the capacity of the link between area 1 and invest_semibase will be updated with the new invested capacity.

The candidates.ini file for this example will be the following one. This file has to be saved in the folder user/expansion/

[1]
name = semibase
link = area1 - invest_semibase
annual-cost-per-mw = 126000
unit-size = 200
max-units = 5

[2]
name = grid
link = area1 - area2
annual-cost-per-mw = 3000
unit-size = 500
max-units = 4

Distributed generation

For the case of distributed generation and storage, the investment variables can be continuous, without steps of several MW. In that case, the properties unit-sizeand max-unitscan be replaced by the property max-investment, and the invested capacity will be able to take any real value between 0 and max-investment (in MW).

Capacity profile

By default, the investment candidates offer a "perfect capacity". That is to say, when 1 MW is invested, this 1 MW will be fully available for all the hours of the year. However, by adding the property link-profile, one can define a time series (with an hourly time step) of the ratio between the invested capacity and the capacity which is actually available at a given hour. This feature can be used to model investments in (e.g.) intermittent generation or thermal generation with seasonalized maintenance shutdowns.

The property link-profile can be used as below :

[1]
name = solar_power
link = area1 - pv1
annual-cost-per-mw = 100000
max-investment = 10000
link-profile = pv1.txt

Where pv1.txt is a text file, located in the user/expansion/capa/ folder of the study, and which contains the load factor time series of the candidate (one column of 8760 values between 0 and 1). When x MW of the candidate solar_power will be invested, the actual time series of available power will be equal to the product of x and the time series pv1.txt.

Method and settings

Benders decomposition

The method used to perform the optimal expansion is a benders decomposition in which:

  • The slave problem is an ANTARES simulation, where the installed capacities of the investment candidates are fixed,
  • The master problem is a MILP, in which the decision variables are the installed capacities of each investment candidate.

The objective function which is minimized, is the sum of the expected annual operation cost (column OV. COST + column HURDLE COST of the outputs of ANTARES ) and the investment annuity (as defined in the candidates.ini file).

Concretely, the package will run ANTARES iteratively. Depending on the number of candidates, the convergence to the optimal solution can be quite long (several hundreds iterations, and so several hundreds ANTARES' simulations). Some algorithmic settings are however available and propose different tradeoffs between the accuracy of the solution and the computation time.

Settings

The different settings can be modified by the user of the package. All the settings are saved in a file settings.ini located in the folder user/expansion/.

  • optimality_gap: The optimality gap can take any numeric value. The optimality gap is the maximum possible distance (in euros) between the solution returned by the method and the optimal solution.

  • master: Can take two values, relaxed or integer. Defines whether or not should integer variables be used for the master problem.

  • uc-type: The UC (Unit Commitment) type can take two different values, expansion_fast or expansion_accurate. It defines which mode will be used in ANTARES. expansion_fast correponds to the fast mode of ANTARES in which the minimum up/down and minimum stable power constraints are relaxed whereas expansion_accurate takes into account the technical constraints of the thermal power plants as well as their start-up costs.

An example of a settings.ini file with the appropriate syntax is given below.

uc_type = expansion_fast
master = integer
optimality_gap = 0

Note that the optimality gap can also be given relatively to be best found solution by entering a % after the numeric value of the setting. In that case, the optimality is between 0%and 100% and the decimal separator is a point (.).

Which settings should I use for my expansion problem ?

1. If I have to run several expansion optimizations of different variants of a study and compare them

In that case, if the optimal solutions are not returned by the package, the comparison of several variants can be tricky as the imprecision of the method might be in the same order of magnitude as the changes brought by the input variations.

It is therefore advised to be as closed as possile from the optimum of the expansion problem. To do so, the two following conditions should necessarily be fulfilled:

  • set the optimality_gap to zero.

[Remark : even with the conditions mentionned above, the reslult might be slighty different from the optimum due to numeric approximations, this can be partly solved by putting to optimality gap to -Inf]

2. If I'm building one consistent generation/transmission scenario

As the optimal solution is not more realistic than an approximate solution of the modelled expansion problem. The settings can be less constraining with :

  • an optimality_gap of a few million euros

How to use the package ?

Load the package

library(antaresXpansion)

Select an ANTARES study using antaresRead package. As no outputs are needed, the simulation argument should be put to zero.

setSimulationPath("study_path", simulation = 0)

Create the candidate.ini and settings.ini files as explained above and store them in the directory study_path/user/expansion.

Enter the path of the ANTARES solver (for example).

path_solver <- "C:/Program Files/RTE/Antares/6.0.0/bin/antares-6.0-solver.exe"

Run the benders function.

benders(path_solver, display = TRUE, report = TRUE)

The expansion optimization can be quite long, intermediary results can be written in the console using display = TRUE. Moreover, if report = TRUE, the results of the function will be summarized in a html report saved in the directory study_path/user/expansion/report.

License Information:

Copyright 2015-2016 RTE (France)

antaresxpansion's People

Contributors

baptsegu avatar jalazawa avatar klorel avatar mathildefranconrte avatar sandbort avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

antaresxpansion's Issues

Add Tags (and Release) for each version

Currently tags and release stopped at version 0.9
https://github.com/rte-antares-rpackage/antaresXpansion/tags
https://github.com/rte-antares-rpackage/antaresXpansion/releases

Last version is 0.13

The tags are useful to get stable version quickly even is not deployed in a CRAN repo.
This would be required too for internal deployement.

I don't think I have the right to do myself.

Info:

Running Benders on Test_Case on 0.13.0

I have run the benders command on the test case provided with AntaresXpansion as follows

solv <- "C:\Program Files\RTE\Antares\7.0.1\bin\antares-7.0-solver.exe"
SSS <- "C:\Users\Administrator\Documents\R\win-library\3.6\antaresXpansion\testdata\test_case"
setSimulationPath(SSS,simulation = 0)
benders(solv, display = TRUE, report = TRUE, clean = TRUE,
parallel = TRUE, recovery_mode = FALSE, ampl_path = NULL,
opts = antaresRead::simOptions())

I get the following error:

--- ITERATION 1 (complete iteration, 156 simulated weeks) ---
ANTARES simulation running ... [done]
Solve master problem ... [done]
Error in read.table(paste0(tmp_folder, "/out_underestimator.txt"), header = FALSE) :
no lines available in input

In addition: Warning message:
In system(cmd, intern = intern, wait = wait | intern, show.output.on.console = wait, :
running command 'C:\WINDOWS\system32\cmd.exe /c C: & cd "C:/Users/Administrator/Documents/R/win-library/3.6/antaresXpansion/testdata/test_case/user/expansion/temp" & ampl "C:/Users/Administrator/Documents/R/win-library/3.6/antaresXpansion/testdata/test_case/user/expansion/temp/master_run.ampl" ' had status 1

Travis CI est actif mais pas configuré

Pour info, Travis CI est activé quand on fait des pull requests, mais il n'y a pas encore de test dans le dépot et surtout pas de .travis.yml donc c'est non configuré.

Tags for stable release must be coherent with version in DESCRIPTION

In the purpose of trying a new internal deployment process at RTE, we need the tag to be

  • with a version as in DESCRIPTION
  • of the form <version> or v<version>

last tag as example:

This should be v0.9.0.

So for last version, related to #28, there should be a v0.13.0 tag

Version: 0.13.0

Can we make the change for next version ?

Erreur Antares

Lorsqu'on a une erreur dans la compilation Antares, il se peut que ça soit dans la compilation du problème Antares (se lit dans le fichier log)

Majuscule liens

Le fichier candidates considère que le fichier Antares a le nom des liens en minuscule

On récupère une erreur sur l'existence des liens dans le fichier links

It it possible to modify the number of MC years during a run ?

I would like to compare two studies one with 1000 MC years and the other one using the antaresXpansion package. Is it possible to launch a study from the package and reopen the study, manually adapting the MC years parameters and relaunch an other one ?

The other solution is to save an other study to condutct the study.

Thanks,

Charles

Correction de détails sur la documentation

  • Il manque un "d" à "folder" dans le premier paragraphe de settings.
  • Est-ce qu'il est possible d'être plus précis sur la nomenclature de l'optimality gap en pourcentage (. ou ,) (valeur entre 0 et 1 ou entre 0 et 100)

Merci et sinon la doc est bien précise et très utile

Problème chargement du package 'plotly'

Message d'erreur lors de l'écriture du rapport car le package 'plotly' n'avait pas était chargé auparavant manuellement.
"
Quitting from lines 11-18 (report.Rmd)
Error in library(plotly) : there is no package called 'plotly'
"

merci à vous : )

Nombre maximum d'itérations

Bonjour,

Est-ce qu'il est possible de fixer le nombre d'iterations de la BI autrement que par l'optimality gap ?

Merci,

A+
Charles

Problème de réecriture des inputs et mémoire

Lorsqu'on réécrit les valeurs des capacités des lignes après une itération il se peut que la mémoire disponible soit trop faible pour rentrer les nouvelles capacités des lignes, dans ce cas la réécriture s'arrête et on a un fichier d'inputs incomplets qui, même si on supprime des éléments pour récuperer de l'espace mémoire, ne peut pas compiler et nous oblige à corriger "à la main" les valeurs des capacités

Retirer le mc-ind dans itérations précédentes

Bonjour,

Est-ce qu'il serait possible que le package supprime les mc-ind des itérations précdentes ?
J'ai peur qu'avec 100 itérations de 100 années on arrive vite à 600 Go par simulation du BP et que ca bloque la boucle.
Merci,

A+

Charles

Meilleure itération est-elle la dernière ?

Bonjour,

Est-ce que la meilleure itération du problème est toujours la dernière ?
Ou il faut aller chercher dans le rapport le numéro de la meilleure pour la trouver ?

Merci,

A+

Charles

Initialisation des liens dans l'étude

Lors de la création des liens entre le noeud virtuel et le noeud "pays" dans lequel investir, quels sont les paramètres par défaut à fournir aux liens ?
Hurdle cost ?
Use transmission capacities ?
Transfert capacity ?

Merci,

Charles

Indisponibilités des groupes

  • Est-ce que les indisponibilités des groupes de production sont prises en compte dans la BI étant donné qu'elle se fait sur le lien ?
    Pour l'instant je ne mets pas d'indisponibilité sur les groupes.

  • Est-ce qu'il y a un intérêt à découper le cluster thermique dans le noeud virtuel par unité standard du type nx500 MW pour les ccg ? n étant grand pour être strictement supérieur à la capacité maximale dans laquelle investir ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.