How to plot 2D line with a maximal value
显示 更早的评论
Hello,
I'm trying to plot the power output of of a 10 kW wind turbine with respect to per second wind speed data. I would like a singular line following the output but instead I have these vertical line for each value - how can I correct it?
I would also like a solid line for my power curve but only a scatter graph gives me the shape I'm after.
Thank you for your help!


%% Code for 10 KW Wind turbine of Diameter 7.1m, rho = 1.16 at hub height 30m, cut in speed 3 m/s,
V = xlsread('windspeed.xlsx','F2:F86401');%wind data per second in a day
Vv= V';
%G = xlsread('windspeed.xlsx','H2:H86401');%generation based on capacity factor of 0.42
for k=1:length(V)
if V(k) < 3 || V(k)>26
P=0;
else P(k) = min( 10000, 0.5*1.16*35*V(k)^3);%power in watts
end
end
Pp = P/1000;%into kW
Pp1 = Pp';
E= (sum (Pp))/3600 %into kWh, energy produce on that day by the turbine
Cp = (E/(10*60*60*24/3600))
t =1:length(V);
figure (1)
plot (Pp)
title ('Power output per second');
xlabel('time (s)');
ylabel('Power out(kW)');
xlim([0 86400])
ylim([0 12])
figure (2)
scatter (Vv,Pp)
title ('Power Curve')
xlabel('time (s)')
ylabel('Power out(kW)')
xlim([0 30])
ylim([0 12])
5 个评论
Rik
2020-5-12
Please attach the source excel file.
Mehmed Saad
2020-5-12
attach windspeed.xlsx
Walter Roberson
2020-5-12
P=0;
That is overwriting all of P with a scalar 0, instead of just writing to the "current" P, P(k)
Susannah Duncan
2020-5-12
Susannah Duncan
2020-5-12
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Smoothing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



