PlotResult: Visualizes the wind farm layout optimization result.

View source: R/Functions.R

PlotResultR Documentation

Visualizes the wind farm layout optimization result.

Description

This function draws the adjusted yields of the wind farm under investigation using image, superimposes a contour plot using contour and arrows for the wind directions using ImposeVectorField and then draws the points for the turbines' locations (aligned to their respective raster grid centers).

Usage

PlotResult(Result, ImageData = NULL, DoLabels = FALSE, Labels = "IDs")

Arguments

Result

must be an optimization result as returned by an optimizer such as optim. Usually, this will be a list at least containing '$par'. Most optimizers comply with this R standard. If your optimizer does not, wrap its result into a list containing an object '$par' containing the optimization result (i.e., a vector of points).

ImageData

a matrix containing the data for the background, processed via image. If not provided (or NULL), uses the data in FarmData[[1]] or, if present, e$FarmData[[1]]. Defaults to NULL.

DoLabels

a boolean that indicates whether labels should be plotted next to the points. Defaults to FALSE.

Labels

a vector of length n = N / 2, can be numeric values or strings. Defines the labels to be shown if DoLabels = TRUE. Defaults to "IDs", in which case the points are sequently numbered from 1:n. Labels is ignored if DoLabels = FALSE.

Details

For maximum convenience and compatibility with numeric optimizers of most kinds, this function expects nothing but the usual optimization result list. This, however, requires that the FarmData dataset as well as the FarmVars object is present defining additional settings.

Value

PlotResult returns nothing.

Author(s)

Carsten Croonenbroeck

See Also

Use Profit to obtain an optimization result.

Examples

#Will not provide a very good result
NumTurbines <- 4
set.seed(1357)
Result <- optim(par = runif(NumTurbines * 2), fn = Profit,
  method = "L-BFGS-B", lower = rep(0, NumTurbines * 2),
  upper = rep(1, NumTurbines * 2))
Result
PlotResult(Result)

wflo documentation built on Jan. 15, 2023, 5:10 p.m.

Related to PlotResult in wflo...