getBestPolyhedron: Adjust a polyhedron from a set of facets to approach a...

View source: R/getDist.R

getBestPolyhedronR Documentation

Adjust a polyhedron from a set of facets to approach a reference polyhedron

Description

This function takes in input two polyhedrons, the reference one and the moving one (or set of facets). It returns in output a really close polyhedron, to the reference one, with the set of facets. It runs a minimization program on a distance using the intersections of a set of lines and the two polyhedrons and validate the moving polyhedron with a volume indicator.

Usage

getBestPolyhedron(
  A,
  B,
  nbLines,
  maxiter,
  thresholdIndic,
  quad = F,
  verbose = 2,
  seed = 123456,
  fixFaces,
  VERTRawDetails,
  draw_range = c(-15000, 15000),
  other_ranges = NULL,
  remove_last_ptdf = T,
  uniform_volume_draw = FALSE
)

Arguments

A

data.table, fix polyhedron, data.table containing at least ram, Date, Period and two ptdf columns :

  • ptdfAT : autrichian ptdf

  • ptdfBE : belgium ptdf

  • ptdfDE : german ptdf

  • ptdfFR : french ptdf

  • ram : line limits

  • Date : date in format YYYY-MM-DD

  • Period : hour in the day, between 1 and 24

B

data.table, moving polyhedron, data.table containing at least ram, Date, Period and two ptdf columns :

  • ptdfAT : autrichian ptdf

  • ptdfBE : belgium ptdf

  • ptdfDE : german ptdf

  • ptdfFR : french ptdf

  • ram : line limits

  • Date : date in format YYYY-MM-DD

  • Period : hour in the day, between 1 and 24

nbLines

numeric, number of half-lines used to compute the distance between the two polyhedra.

maxiter

numeric, maximum number of iteration, it is one of the two stopping criteria of this function.

thresholdIndic

numeric, maximum number of iteration, it is one of the two stopping criteria of this function.

quad

logical, TRUE if you want to solve it with a quadratic optimization problem, FALSE if you want to use a linear (default is linear, which is faster)

verbose

numeric, shows the logs in console. By default, the value is 1.

  • 0 : No log

  • 1 : No log

  • 2 : Medium log

seed

numeric fixed random seed, used for the weighted draw of the typical days. By default, the value is 123456

fixFaces

data.table data.table if you want to use fix faces for the creation of the flowbased models. If you want to do it, the data.table has the following form : data.table(func = c("min", "min", "max", "min"), zone = c("BE", "FR", "DE", "DE")). func is the direction of the fix faces and zone is the area of this direction. If you give for example min and DE, there will be a fix face at the minimum import value of Germany.

VERTRawDetails

data.table, vertices of the polyhedron A

Examples

## Not run: 
library(data.table)
library(quadprog)
library(linprog)
polyhedra <- readRDS(system.file("testdata/polyhedra.rds", package = "fbAntares"))
A <- polyhedra[Date == "2019-02-14"]
B <- polyhedra[Date == "2019-02-15"]
nbLines <- 10000
maxiter <- 20
thresholdIndic <- 0.9
quad <- F

 getBestPolyhedron(
 A = A, B = B, nbLines = nbLines, maxiter = maxiter,
 thresholdIndic = thresholdIndic, quad = quad)

## End(Not run)


rte-antares-rpackage/fbAntares documentation built on June 1, 2022, 6:20 p.m.