Interpolation of blade pitch angle and rotor speeds

Hello everyone,

I would like to share with you a simple MATLAB code that interpolates the values of blade pitch angle and rotor speed from tabulated data as given by technical report.

This could be very useful when trying to run OpenFAST simulations and this is crucial to avoid the error of “Tower Strike”.

The code is written in MATLAB and the tabulated data of reference are put in Excel File.

You can put the tabulated blade pitch angle and rotor speed for any wind turbine not necessarily for the 5 MW.

The MATLAB code is in the following:

function [output] = find_blade_pitch_and_rotor_speed_for_the_5_MW_WT(input_wind_speed)
% All the values in the Excel file are obtained from Jason JONKMAN Ph.D. thesis
Excel_file_path=“5MW_WT_blade_pitch_angle_and_rotor_speed.xlsx”;
T=readtable(Excel_file_path);
Array_Excel=table2array(T);
V=Array_Excel(:,1);
BladePitch=Array_Excel(:,2);
RotorSpeed=Array_Excel(:,3);

if (iscolumn(input_wind_speed))
Vq=input_wind_speed;
else
Vq=input_wind_speed’;
end

BladePitch_query=180ones(length(Vq),1);
RotorSpeed_query=180
ones(length(Vq),1);

for i=1:length(Vq)
if (Vq(i)>=3)&&(Vq(i)<=25)
BladePitch_query(i) = interp1(V,BladePitch,Vq(i));
RotorSpeed_query(i) = interp1(V,RotorSpeed,Vq(i));
elseif (Vq(i)<3)
BladePitch_query(i)=0;
RotorSpeed_query(i)=0;
else
BladePitch_query(i)=90;
RotorSpeed_query(i)=0;
end
end
output=[Vq BladePitch_query RotorSpeed_query];
end

%% =============================end of the code================

Here a screen capture how the Excel file looks like:

Dont forget to put the Excel file in the same directory of the MATLAB code otherwise, you should give the path of the Excel file.

Hope that this simple MATLAB code makes life easier.

Best Regards,

Riad