This repository contains a step-by-step guide to forecast the long-term energy of a wind turbine system.
You can find the raw Excel workbook with instructions added. And, following the guide, you are able to compute using MATLAB the values requested in the workbook. The outcomes of the computation process are available at the filled version of the workbook.
Folder Matlab-code
contains the .m
script files. Some important MATLAB functions used in this project are reported hereafter:
- Function
xlsread
(e.g, in script Reconstruct_SS_WS80m)
filename = 'Wind-turbine-long-term-energy-forecast_Workbook.xlsx';
sheetname = 'Monthly Correlation with Ref';
Mast_Measurements = xlsread(filename,sheetname);
This function reads a specific worksheet in the Microsoft Excel spreadsheet file, and returns the numeric data in matrix. To read column-oriented data from spreadsheet files (included file with extension .xls
or .xlsx
), newer version of MATLAB provides alternative functions like readtable
, readmatrix
or readcell
.
- Function
fit
(e.g, in script Reconstruct_SS_WS80m)
[f_WS70m_WS80m,gof_WS70m_WS80m] = fit(WS_70m(Index_com_vd,1),WS_80m(Index_com_vd,1),'poly1');
This function is used to obtained the coefficients p₁ and p₂ of the linear regression model y = p₁x + p₂. Notice that the flag 'poly1' represents that the model type used to fit here is a linear polynomial curve. See more details.
MATLAB also has a built-in function fit
in the Predictive Maintenance Toolbox, which helps to estimate the parameters of a remaining useful life prediction model using historical data.
- Function
feval
(e.g, in script Reconstruct_SS_WS80m)
Temp = feval(f_WS70m_WS80m,WS_70m(Index_vd_WS70m));
This function, based on the linear regression model determined using function fit
above, returns the corresponding output values obtained by linearly interpolating the input values.
- Function
histc
(e.g, in script Estimate SS_WD78m.m and Frequency_Distribution_WS_WD.m)
[Nb_Datapoints,Index_Sector] = histc(WD10m_vd_common,direction_edges);
This function counts the number of values in the first arguments (WD10m_vd_common) that are within each specific bin range which endpoints determined by the second arguments (direction_edges). The output argument Nb_Datapoints contains the number of element from WD10m_vd_common in each bin, while the output argument Index_Sector is an array of the same size as WD10m_vd_common indicating the bin number that each entry in WD10m_vd_common sorts into. In newer version of MATLAB, user is recommended to switch to function histcounts
.