Skip to content

Commit

Permalink
ajout index_vf
Browse files Browse the repository at this point in the history
  • Loading branch information
FabiolaAravena committed May 17, 2018
1 parent 4d334f2 commit 279e9ce
Showing 1 changed file with 318 additions and 0 deletions.
318 changes: 318 additions & 0 deletions inst/index_vf.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,318 @@
---
title: "<img style='float:right;' src='imgs/RTE_logo.png'></img><h5>Semaine S09/2018</h5><h2>Rejeu : Calcul des marges hebdomadaires, CNES - R&D</h2><h5>CNES :<br/>[email protected]<br/>[email protected]<br/>R&D : <br/>[email protected]<br/>[email protected]<br/>[email protected]<br/>[email protected]<br/></h5>"
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
```

<style>
h1, h2, h3, h4 {
color: #00A7DE;
}
</style>

<br/><br/><br/><br/><br/>


# Hypothesis France


<br/>

## Load

<br/>

```{r out.width='100%', fig.height=6, eval=require('dygraphs'), echo=FALSE}
draw_series(data_fr, "LOAD", mcYears = 1)
```

<br/>

Prévision utilisateur CNES


<br/>

## Wind Production

<br/>

```{r out.width='100%', fig.height=6, eval=require('dygraphs'), echo=FALSE}
draw_series(data_fr, "WIND")
```

<br/>

51 Forecast scenarios Meteologica


<br/>

## Solar Production

<br/>

```{r out.width='100%', fig.height=6, eval=require('dygraphs'), echo=FALSE}
draw_series(data_fr, "SOLAR")
```

<br/>

51 Forecast scenarios Meteologica


<br/>

# Results : margins analysis


<br/>

### Initial Remaining Capacity - <span style="font-size: 80%;"><img src="imgs/fr.svg" width="28" height="21" style="vertical-align: 0px;"/> FR</span>

<br/>

```{r, echo=FALSE}
#Analyse sur le graphique marge_pays_seul
```


<br/>

```{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
)
```
* <span style="color: red;">1% of scenarii</span>
* <span style="color: orange;">4% of scenarii</span>
* <span style="color: blue;">10% of scenarii</span>
* <span style="color: green;">50% of scenarii</span>
* <span style="color: #A4A4A4">`r n_scenario` scenarii</span>

<br/>
<br/>

Table of quantiles :

```{r, echo=FALSE}
marg <- margins_quantiles(marge_seul_fr_e)
ft_margins_quantiles(marg, layout = "horizontal", language = "en")
```


<br/>

### Final Remaining Capacity - <span style="font-size: 80%;"><img src="imgs/fr.svg" width="28" height="21" style="vertical-align: 0px;"/> FR</span>

<br/>

```{r, echo=FALSE}
#Analyse sur le graphique marge_pays_interconnecté
```


<br/>


```{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
)
```
* <span style="color: red;">1% of scenarii</span>
* <span style="color: orange;">4% of scenarii</span>
* <span style="color: blue;">10% of scenarii</span>
* <span style="color: green;">50% of scenarii</span>
* <span style="color: #A4A4A4">`r n_scenario` scenarii</span>

<br/>
<br/>

Table of quantiles :

```{r, echo=FALSE}
marg_i <- margins_quantiles(marge_inter_fr)
ft_margins_quantiles(marg_i, layout = "horizontal", language = "en")
```

<br/>

### Remaining Capacity Analysis - <span style="font-size: 80%;"><img src="imgs/fr.svg" width="28" height="21" style="vertical-align: 0px;"/> FR</span>

<br/>

```{r, echo=FALSE}
#Analyse sur le graphique probabilité de défaillance
```


<br/>


```{r out.width='100%', fig.height=6, eval=require('dygraphs'), echo=FALSE}
draw_stack_hist(marge_seul_fr, marge_inter_fr, "fr")
```

<span style="color: #008000; font-size: 70%;">available power in the country > needs</span> -
<span style="color: #FFFF00; font-size: 70%;">imports are required</span> -
<span style="color: #FFA500; font-size: 70%;">power still available in the country, but final remaining capacity = 0</span> -
<span style="color: #CD853F; font-size: 70%;">imports are required & final remaining capacity = 0</span> -
<span style="color: #FF0000; font-size: 70%;">inadequacy</span>


<br/>
<br/>


# Detailed results : scenarii analysis



<br/>
<br/>

### Imports / Exports

<br/>

```{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))
```


<br/>
<br/>


### Flux FR -> CWE

<br/>

```{r out.width='100%', fig.height=6, eval=require('dygraphs'), echo=FALSE}
draw_mono(mono_data$mono_cwe)
```


<br/>
<br/>


# Example of scenario `r year_mc`


<br/>

### Analysis scenario `r year_mc` – Flows


<br/>

```{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]]
```

<br/>

```{r, echo=FALSE}
#Analyse sur le graphique exports/imports
#<ul>
#<li>France exports during the weekend.</li>
#<li>During the weekdays France is a net importer.</li>
#<li>During the day France exports to Belgium, except during hours of inadequacy as it was the case of 10 Nov 2016 17:00 UTC (no more flows between the 2 countries)</li>
#</ul>
```






<br/>
<br/>

### Analysis scenario `r year_mc` – Production


<br/>


```{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]]
```

<br/>

```{r, echo=FALSE}
#Analyse sur le graphique prod_mc
#<ul>
#<li>In France, thermal production is low because of unavailability of nuclear plants.</li>
#<li>Because of that, France is a net importer during the weekdays.</li>
#<li>We can also observe time steps where there are unsupplied energy.</li>
#<li>Water is pumped during off-peak hours but it is not enough to avoid inadequacy.</li>
#</ul>
```

<br/>
<br/>

### Analysis scenario `r year_mc` – Map

<br/>

```{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")
)
)
)
```

0 comments on commit 279e9ce

Please sign in to comment.