Learn R Programming

windfarmGA (version 2.3.0)

get_dist_angles: Calculate distances and angles of possibly influencing turbines

Description

Calculate distances and angles for a turbine and all it's potentially influencing turbines.

Usage

get_dist_angles(t, o, wkl, distanz, polYgon, plotAngles)

Arguments

t

A matrix of the current individual with x and y coordinates

o

A numeric value indicating the index of the current turbine

wkl

A numeric value indicating the angle, at which no wake influences are considered. Default is 20 degrees.

distanz

A numeric value indicating the distance, after which the wake effects are considered to be eliminated. Default is 100km.

polYgon

A shapefile representing the considered area

plotAngles

A logical variable, which is used to plot the distances and angles. Default is FALSE

Value

Returns a matrix with the distances and angles of potentially influencing turbines

See Also

Other Wind Energy Calculation Functions: barometric_height(), calculate_energy(), turbine_influences()

Examples

Run this code
# NOT RUN {
library(sp)
library(raster)

## Exemplary input Polygon with 2km x 2km:
polYgon <- Polygon(rbind(c(0, 0), c(0, 2000), c(2000, 2000), c(2000, 0)))
polYgon <- Polygons(list(polYgon),1)
polYgon <- SpatialPolygons(list(polYgon))
Projection <- "+init=epsg:3035"
proj4string(polYgon) <- CRS(Projection); plot(polYgon, axes = TRUE)

## Create a random windfarm with 10 turbines
t <- as.matrix(cbind(x = runif(10, 0, raster::extent(polYgon)[2]),
     y = runif(10, 0, raster::extent(polYgon)[4])))
wnkl <- 20
distanz <- 100000

## Evaluate and plot for every turbine all other potentially influencing turbines
potInfTur <- list()
for (i in 1:(length(t[,1]))) {
  potInfTur[[i]] <- get_dist_angles(t = t, o = i, wkl = wnkl,
                   distanz = distanz, polYgon = polYgon, plotAngles = TRUE)
}
potInfTur

# }

Run the code above in your browser using DataLab