From 279e9ce33ee44f2e0fd1abceb6aa1d6cc9ea6b00 Mon Sep 17 00:00:00 2001 From: aravena-rojas Date: Thu, 17 May 2018 11:04:26 +0200 Subject: [PATCH] ajout index_vf --- inst/index_vf.Rmd | 318 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 318 insertions(+) create mode 100644 inst/index_vf.Rmd diff --git a/inst/index_vf.Rmd b/inst/index_vf.Rmd new file mode 100644 index 0000000..698ad03 --- /dev/null +++ b/inst/index_vf.Rmd @@ -0,0 +1,318 @@ +--- +title: "
Semaine S09/2018

Rejeu : Calcul des marges hebdomadaires, CNES - R&D

CNES :
michel.driessens@rte-france.com
theo.darquennes@rte-france.com
R&D :
fabiola.aravena-rojas@rte-france.com
frederic.breant@rte-france.com
victor.perrier@rte-france.com
sebastien.finet@rte-france.com
" +author: "" +date: "" +output: + html_document: + toc: true + toc_float: true +--- + +```{r setup, include=FALSE} +# packages +library( antaresViz ) +library( antaresWeeklyMargin ) +library( data.table ) +library( dygraphs ) +library( magrittr ) + +# datas +marge_seul_fr <- readRDS(file = "datas/marge_fr_seule.rds") +marge_seul_fr_e <- marge_seul_fr[, c(1, sample.int(n = 2040, size = 200) + 1)] +data_fr <- readRDS("datas/data_fr.rds") +marge_inter_fr <- readRDS(file = "datas/marge_fr_inter.rds") +data_all <- readRDS(file = "datas/data_all_mc50.rds") +# Monotone data +mono_data <- readRDS(file = "datas/mono.rds") +load("datas/ml.rda") +week <- 9 +year_mc <- 50 +date_study <- "28-02-2018 10:00:00" +date_debut <- "2018-02-24" +n_scenario <- 2040 + +``` + + + +




+ + +# Hypothesis France + + +
+ +## Load + +
+ +```{r out.width='100%', fig.height=6, eval=require('dygraphs'), echo=FALSE} +draw_series(data_fr, "LOAD", mcYears = 1) +``` + +
+ +Prévision utilisateur CNES + + +
+ +## Wind Production + +
+ +```{r out.width='100%', fig.height=6, eval=require('dygraphs'), echo=FALSE} +draw_series(data_fr, "WIND") +``` + +
+ +51 Forecast scenarios Meteologica + + +
+ +## Solar Production + +
+ +```{r out.width='100%', fig.height=6, eval=require('dygraphs'), echo=FALSE} +draw_series(data_fr, "SOLAR") +``` + +
+ +51 Forecast scenarios Meteologica + + +
+ +# Results : margins analysis + + +
+ +### Initial Remaining Capacity - FR + +
+ +```{r, echo=FALSE} +#Analyse sur le graphique marge_pays_seul +``` + + +
+ +```{r out.width='100%', fig.height=6, eval=require('dygraphs'), echo=FALSE} +draw_upward_margin( + upward_margin = marge_seul_fr_e, + area = "fr", + type = "seul", + nb_MC = ncol(marge_seul_fr_e) - 1, + num_week = week +) +``` + * 1% of scenarii + * 4% of scenarii + * 10% of scenarii + * 50% of scenarii + * `r n_scenario` scenarii + +
+
+ +Table of quantiles : + +```{r, echo=FALSE} +marg <- margins_quantiles(marge_seul_fr_e) +ft_margins_quantiles(marg, layout = "horizontal", language = "en") +``` + + +
+ +### Final Remaining Capacity - FR + +
+ +```{r, echo=FALSE} +#Analyse sur le graphique marge_pays_interconnecté +``` + + +
+ + +```{r out.width='100%', fig.height=6, eval=require('dygraphs'), echo=FALSE} +draw_upward_margin( + upward_margin = marge_inter_fr, + area = "fr", + type = "inter", + nb_MC = ncol(marge_inter_fr) - 1, + num_week = week +) +``` + * 1% of scenarii + * 4% of scenarii + * 10% of scenarii + * 50% of scenarii + * `r n_scenario` scenarii + +
+
+ +Table of quantiles : + +```{r, echo=FALSE} +marg_i <- margins_quantiles(marge_inter_fr) +ft_margins_quantiles(marg_i, layout = "horizontal", language = "en") +``` + +
+ +### Remaining Capacity Analysis - FR + +
+ +```{r, echo=FALSE} +#Analyse sur le graphique probabilité de défaillance +``` + + +
+ + +```{r out.width='100%', fig.height=6, eval=require('dygraphs'), echo=FALSE} +draw_stack_hist(marge_seul_fr, marge_inter_fr, "fr") +``` + +available power in the country > needs - +imports are required - +power still available in the country, but final remaining capacity = 0 - +imports are required & final remaining capacity = 0 - +inadequacy + + +
+
+ + +# Detailed results : scenarii analysis + + + +
+
+ +### Imports / Exports + +
+ +```{r out.width='100%', fig.height=6, eval=require('dygraphs'), echo=FALSE} +draw_mono(mono_data$mono_france, main = paste0("Monotone des flux imports/exports pour France ", date_study)) +``` + + +
+
+ + +### Flux FR -> CWE + +
+ +```{r out.width='100%', fig.height=6, eval=require('dygraphs'), echo=FALSE} +draw_mono(mono_data$mono_cwe) +``` + + +
+
+ + +# Example of scenario `r year_mc` + + +
+ +### Analysis scenario `r year_mc` – Flows + + +
+ +```{r out.width='100%', fig.height=6, comment=NA, results='asis', eval=require('dygraphs'), echo=FALSE} +antaresViz::exchangesStack(data_all$links, area = "fr", interactive = FALSE)#$widgets[[1]]$widget[[1]] +``` + +
+ +```{r, echo=FALSE} +#Analyse sur le graphique exports/imports +# +``` + + + + + + +
+
+ +### Analysis scenario `r year_mc` – Production + + +
+ + +```{r out.width='100%', fig.height=6, eval=require('dygraphs'), echo=FALSE} +draw_prod_MC(data_fr, date_i = date_debut, mc_year = year_mc) #$widgets[[1]]$widget[[1]] +``` + +
+ +```{r, echo=FALSE} +#Analyse sur le graphique prod_mc +# +``` + +
+
+ +### Analysis scenario `r year_mc` – Map + +
+ +```{r out.width='100%', fig.height=6, eval=require('leaflet'), echo=FALSE} +plotMap( + x = data_all, mapLayout = ml, interactive = FALSE, + colLinkVar = "abs_loadFactor", sizeLinkVar = "FLOW LIN.", + colAreaVar = "marges_inter", labelAreaVar = "marges_inter", + options = plotMapOptions( + areaDefaultSize = 50, + areaColorScaleOpts = colorScaleOptions( + breaks = c(-3000, 0, 0.1, 70000), + colors = c("#ff0000", "#cd853f", "#008000", "#008000") + ), + linkColorScaleOpts = colorScaleOptions( + breaks = c(0, 0.25, 0.5, 0.75, 0.999, 1), + colors = c("#88cc8a","#a4ce3b","#ffff30", "#f49518", "#ff0000") + ) + ) +) +``` +