knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
This is a Vignettes of R package, WindCurves
. The package WindCurves
is a tool used to fit the wind turbine power curves. It can be useful for researchers, data analysts/scientist, practitioners, statistians and students working on wind turbine power curves. The salient features of WindCurves
package are:
WindCurves
package from a discrete samples of wind turbine power curves provided by turbine manufacurers as:library(WindCurves) data(pcurves) s <- pcurves$Speed p <- pcurves$`Nordex N90` da <- data.frame(s,p) x <- fitcurve(da) x validate.curve(x) plot(x)
User can utilize WindCurves
package as a testbench so that a new curve fitting technique can be compared with above mentioned existing environment.
random()
) should be saved in .R format and it should return the fitted values in terms of "Power values". The random()
function used in this example is stored as .R file with dump()
function and made available in the WindCurves
package and written as:random <- function(x) { data_y <- sort(sample(1:1500, size = 25, replace = TRUE)) d <- data.frame(data_y) return(d) } dump("random") rm(random)
random()
function is attached in the comparison the parameters MethodPath
and MethodName
as shown below, where MethodPath
is a location of the function proposed by the user and MethodName
is a name given to the function.library(WindCurves) data(pcurves) s <- pcurves$Speed p <- pcurves$`Nordex N90` da <- data.frame(s,p) x <- fitcurve(data = da, MethodPath = "source('dumpdata.R')", MethodName = "Random values") ## The user can specify .R files from other locations as: # x <- fitcurve(data = da, MethodPath = "source('~/WindCurves/R/random.R')", MethodName = "Random values") validate.curve(x) plot(x)
WindCurves
allows user to add more error measures with validate.curve()
function as explained below:Consider error()
is a function which uses two vectors as input and returns a error value with a specific error measure, such as RMSE or MAPE as shown below:
# PCV as an error metric error <- function(a,b) { d <- (var(a) - var(b)) * 100/ var(a) d <- as.numeric(d) return(d) } dump("error") rm(error)
The effect of this function can be seen in the results obtained with Validate.curve()
function as:
library(WindCurves) data(pcurves) s <- pcurves$Speed p <- pcurves$`Nordex N90` da <- data.frame(s,p) x <- fitcurve(da) validate.curve(x = x, MethodPath = "source('dumpdata.R')", MethodName = "New Error") plot(x)
Similarly, user can compare various techniques used for wind turbine power curve fitting.
data(pcurves)
pcurves
WindCurves
package provides feature to extract/capture Speed Vs Power discrete points from power curve image. This can be achieved with the following simple instruction:#img2points("image.jpeg")
where, image.jpeg
is the name of power curve image from which discrete points are to extracted. The procedure of extraction is as follows:
img2points("image.jpeg")
, an image will get appeared in the Viewer.n
parameter in img2points()
function.fitcurve()
function.[1] D. Villanueva and A. E. Feij´oo, “Reformulation of parameters of the logistic function applied to power curves of wind turbines,” Electric Power Systems Research, vol. 137, pp. 51–58, 2016.(via)
[2] Iain Staffell, “Wind turbine power curves, 2012” (via)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.