Learn R Programming

windfarmGA (version 5.0.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, wnkl, dist, area, plot_angles = FALSE)

Value

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

Arguments

t

A data.frame of the current individual with X and Y coordinates

o

A numeric value indicating the index of the current turbine

wnkl

Wake opening angle in degrees. Turbines outside this cone are ignored.

dist

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

area

Site polygon

plot_angles

Plot distances and angles

See Also

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

Examples

Run this code
library(sf)

## Exemplary input Polygon with 2km x 2km:
area <- sf::st_as_sf(sf::st_sfc(
  sf::st_polygon(list(cbind(
    c(4498482, 4498482, 4499991, 4499991, 4498482),
    c(2668272, 2669343, 2669343, 2668272, 2668272)
  ))),
  crs = 3035
))

## Create a random windfarm with 10 turbines
t <- st_coordinates(st_sample(area, 10))
t <- cbind(t, "Z" = 1)
wnkl <- 20
dist <- 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, wnkl = wnkl,
    dist = dist, area = area, plot_angles = TRUE
  )
}
potInfTur

Run the code above in your browser using DataLab