frequency: Calculation of frequency and mean wind speed

Description Usage Arguments Details Value Optional graphical parameters for plotting Author(s) References See Also Examples

View source: R/frequency.R

Description

Calculates the frequency of occurrence and mean wind speed per wind direction sector.

Usage

1
2
3
4
frequency(mast, v.set, dir.set, num.sectors=12, 
  bins=c(5, 10, 15, 20), subset, digits=3, print=TRUE)
freq(mast, v.set, dir.set, num.sectors=12, 
  bins=c(5, 10, 15, 20), subset, digits=3, print=TRUE)

Arguments

mast

Met mast object created by mast.

v.set

Set used for wind speed, specified as set number or set name (optional, if dir.set is given).

dir.set

Set used for wind direction, specified as set number or set name (optional, if v.set is given).

num.sectors

Number of wind direction sectors as integer value greater 1. Default is 12.

bins

Wind speed bins as numeric vector or NULL if no classification is desired. Default is c(5, 10, 15, 20).

subset

Optional start and end time stamp for a data subset, as string vector c(start, end). The time stamps format shall follow the rules of ISO 8601 international standard, e.g. "2012-08-08 22:55:00".

digits

Number of decimal places to be used for results as numeric value. Default is 3.

print

If TRUE (the default), results are printed directly.

Details

The directional frequency of occurrence is an important factor for the design of a wind project. The influence is clear for the arrangement of turbines in a wind farm, that should be perpendicular to the most frequent wind direction. But also single turbines are affected, e.g. by fatigue tower loads in most frequent directions or in directions with highest wind speeds.

Value

Returns a data frame containing:

wind.speed

Mean wind speed per direction sector.

total

Frequency per direction sector.

...

Frequencies per direction sector, for each given wind speed bin.

Optional graphical parameters for plotting

The following graphical parameters can optionally be added to customize the plot:

Author(s)

Christian Graul

References

Brower, M., Marcus, M., Taylor, M., Bernadett, D., Filippelli, M., Beaucage, P., Hale, E., Elsholz, K., Doane, J., Eberhard, M., Tensen, J., Ryan, D. (2010) Wind Resource Assessment Handbook. http://www.renewablenrgsystems.com/TechSupport/~/media/Files/PDFs/wind_resource_handbook.ashx

See Also

mast

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
## Not run: 
## load and prepare data
data("winddata", package="bReeze")
set40 <- set(height=40, v.avg=winddata[,2], dir.avg=winddata[,14])
set30 <- set(height=30, v.avg=winddata[,6], dir.avg=winddata[,16])
set20 <- set(height=20, v.avg=winddata[,10])
ts <- timestamp(timestamp=winddata[,1])
neubuerg <- mast(timestamp=ts, set40, set30, set20)
neubuerg <- clean(mast=neubuerg)

## calculate frequency
frequency(mast=neubuerg, v.set=1)

# if only one of v.set and dir.set is given, 
# the dataset is assigned to both
frequency(mast=neubuerg, v.set=1)
frequency(mast=neubuerg, dir.set=1)

# use different datasets for wind speed and direction
frequency(mast=neubuerg, v.set=3)	# no direction in dataset
frequency(mast=neubuerg, v.set=3, dir.set=2)
frequency(mast=neubuerg, v.set="set3", dir.set="set2")	# same as above

# change number of direction sectors 
frequency(mast=neubuerg, v.set=1, num.sectors=4)
frequency(mast=neubuerg, v.set=1, num.sectors=16)

# calculate frequency for 1 m/s speed bins and without binning
frequency(mast=neubuerg, v.set=1, bins=1:25)
frequency(mast=neubuerg, v.set=1, bins=0:25)	# same as above
frequency(mast=neubuerg, v.set=1, bins=NULL)

# data subsets
frequency(mast=neubuerg, v.set=1, 
  subset=c("2009-12-01 00:00:00", "2009-12-31 23:50:00"))
frequency(mast=neubuerg, v.set=1, 
  subset=c("2010-01-01 00:00:00", NA)) # just 'start' time stamp
frequency(mast=neubuerg, v.set=1, 
  subset=c(NA, "2009-12-31 23:50:00")) # just 'end' time stamp

# change number of digits and hide results
frequency(mast=neubuerg, v.set=1, digits=2)
neubuerg.freq <- frequency(mast=neubuerg, v.set=1, print=FALSE)
neubuerg.freq

## plot frequency objects
plot(neubuerg.freq)  # default
plot(neubuerg.freq, col=gray(5:0 / 5.5), cex=0.8)  # change colours/text sizes
plot(neubuerg.freq, circles=c(10, 30, 10))  # manual definition of circles
plot(neubuerg.freq, fg=TRUE)  # plot sectors in foreground
plot(neubuerg.freq, pos.axis=135) # change axis label position
plot(neubuerg.freq, width.leg=0)  # no legend

# freaky
plot(neubuerg.freq, border.leg=heat.colors(5), bty.leg="o", 
  cex.axis=0.5, cex.lab=2, cex.leg=0.5, circles=c(5, 30, 5), 
  col=rainbow(5), col.axis="green", col.border="orange", 
  col.circle="purple", col.cross="yellow", col.lab="pink", 
  col.leg="lightblue", fg=TRUE, lwd.border=2, lwd.circle=3, lwd.cross=3, 
  lty.circle="12345678", lty.cross="87654321", sec.space=0.6, 
  title.leg="* WiNd SpEeD *", x.intersp=2, y.intersp=5)

## End(Not run)

bReeze documentation built on May 2, 2019, 3:32 p.m.