ShowWakePenalizers {wflo} | R Documentation |
Visualizes the points causing/'suffering' from wake effects.
Description
After optimization, this function draws a reduced 'field' and shows which points cause wake penalties on which points. 'Causers' are displayed in grey, 'sufferers', i.e. points that are in (possibly multiple) wakes of (several) causers are displayed in gold.
Usage
ShowWakePenalizers(Result, Cones = TRUE, All = FALSE, VectorField = TRUE,
ImposeMST = FALSE, NS = FALSE, NSOnly = FALSE, Exaggerate = TRUE,
DoubleLine = TRUE, Frames = 100, Alpha = 0.5, MaxContrast = TRUE, Soften = TRUE)
Arguments
Result |
must be an optimization result as returned by an optimizer such as |
Cones |
triggers whether the Jensen cones are to be displayed as well. Defaults to |
All |
triggers whether all Jensen cones are to be displayed, instead of just causers and sufferers. Defaults to |
VectorField |
controls whether or not to impose the wind directions vector field (arrows). Defaults to |
ImposeMST |
if |
NS |
if |
NSOnly |
if |
Exaggerate |
if |
DoubleLine |
applies only if |
Frames |
number of frames to pre-compute for the Navier-Stokes simulation. 100 is a good value. Less makes the computation faster, but more inaccurate. More than 100 in only necessary for very low wind speeds. Thus, defaults to |
Alpha |
The Navier-Stokes wake simulation is imposed semi-transparent over the usual image. This controls the transparency. Alpha = 0 means transparent, Alpha = 1 means opaque. Defaults to |
MaxContrast |
increases the contrast to maximum (this is equivalent to histogram stretching). Defaults to |
Soften |
applies a Gaussian soften filter to the Navier-Stokes image to have a more homogeneous visualization. Defaults to |
Details
Enables the researcher to inspect the optimization result in an a-posteriori analysis of Jensen's wake model. Parts of the Navier-Stokes code are inspired by Stam (2003).
Value
ShowWakePenalizers
invisibly returns a square matrix (dimension: 'number of turbines') of wake penalty pairs: Columns are sufferers, rows are causers. For each row/column pair unequal to one, the turbine in row i sheds wake on the turbine in column j. The actual numbers are those returned by JensenFactor
.
Author(s)
Carsten Croonenbroeck
References
Stam, S. (2003). Real-Time Fluid Dynamics for Games. https://www.researchgate.net/publication/2560062_Real-Time_Fluid_Dynamics_for_Games, 1-17
See Also
Use PlotResult
to visualize the optimization result.
Examples
## Not run:
#Will show that turbine 1 sheds wake on turbine 5.
NumTurbines <- 8
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))
ShowWakePenalizers(Result)
###############
#This may take some time. A progress bar is displayed.
Result = list(par = e$FarmVars$BenchmarkSolution)
ShowWakePenalizers(Result, All = TRUE, NS = TRUE, VectorField = FALSE, Alpha = 0.7)
###############
#Generates a few frames of an animation.
Result <- list(par = e$FarmVars$BenchmarkSolution)
MakeFrames <- function(Frames)
{
for (i in 100:(100 + Frames - 1))
{
bmp(file = paste(i, ".bmp", sep = ""))
ShowWakePenalizers(Result, All = TRUE, NS = TRUE, Frames = i)
dev.off()
}
}
system.time(MakeFrames(30)) #May take an hour.
## End(Not run)