# 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


draw_series(data_fr, "LOAD", mcYears = 1)


Prévision utilisateur CNES


Wind Production


draw_series(data_fr, "WIND")


51 Forecast scenarios Meteologica


Solar Production


draw_series(data_fr, "SOLAR")


51 Forecast scenarios Meteologica


Results : margins analysis


Initial Remaining Capacity - FR


#Analyse sur le graphique marge_pays_seul


draw_upward_margin(
  upward_margin = marge_seul_fr_e, 
  area = "fr",
  type = "seul",
  nb_MC = ncol(marge_seul_fr_e) - 1, 
  num_week = week
)



Table of quantiles :

marg <- margins_quantiles(marge_seul_fr_e)
ft_margins_quantiles(marg, layout = "horizontal", language = "en")


Final Remaining Capacity - FR


#Analyse sur le graphique marge_pays_interconnecté


draw_upward_margin(
  upward_margin = marge_inter_fr, 
  area = "fr",
  type = "inter",
  nb_MC = ncol(marge_inter_fr) - 1, 
  num_week = week
)



Table of quantiles :

marg_i <- margins_quantiles(marge_inter_fr)
ft_margins_quantiles(marg_i, layout = "horizontal", language = "en")


Remaining Capacity Analysis - FR


#Analyse sur le graphique probabilité de défaillance


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


draw_mono(mono_data$mono_france, main = paste0("Monotone des flux imports/exports pour France ", date_study))



Flux FR -> CWE


draw_mono(mono_data$mono_cwe)



Example of scenario r year_mc


Analysis scenario r year_mc – Flows


antaresViz::exchangesStack(data_all$links, area = "fr", interactive = FALSE)#$widgets[[1]]$widget[[1]]


#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>



Analysis scenario r year_mc – Production


draw_prod_MC(data_fr, date_i = date_debut, mc_year = year_mc) #$widgets[[1]]$widget[[1]]


#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>



Analysis scenario r year_mc – Map


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


rte-antares-rpackage/antaresWeeklyMargin documentation built on July 25, 2019, 8:23 p.m.