フィルターのクリア

interpolation to maximum points

4 ビュー (過去 30 日間)
Alzapoa
Alzapoa 2012 年 8 月 24 日
Hi all, I have below code to generate a group of graphs. I need to interpolate a line through their maximum points. could you please help? in addition I need to cut the graph below the -0.1 if it is possible. Thanks
Cp=[ ];
landa=(0:0.1:16);
for B=0:3:30
for i=1:1:length(landa)
landa_i=1/((1/(landa(i)+0.08*B))-(0.035/(B^3+1)));
Cpi=0.22*((116/landa_i)-(0.4*B)-5)*exp(-12.5/landa_i);
Cp=[Cp Cpi];
end
if B==0
Cpmax=max(Cp);
end
plot(landa,Cp,'b');
% mesh(landa,B);
hold on;
Cp=[ ];
end
xlabel('Tip speed ratio');
ylabel ('Performance corfficient Cp');
hold off;

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 8 月 24 日
close
Cp=[ ];
landa=(0:0.1:16);
result=[];
for B=0:3:30
for i=1:1:length(landa)
landa_i=1/((1/(landa(i)+0.08*B))-(0.035/(B^3+1)));
Cpi=0.22*((116/landa_i)-(0.4*B)-5)*exp(-12.5/landa_i);
Cp=[Cp Cpi];
end
if B==0
Cpmax=max(Cp);
end
result=[result Cp'];
plot(landa,Cp,'b');
% mesh(landa,B);
hold on;
Cp=[ ];
end
xlabel('Tip speed ratio');
ylabel ('Performance corfficient Cp');
%hold off;
[i1,j1]=max(result)
xi=landa(j1);yi=i1;
xyi=sortrows([xi' yi'],1)
hold on
x1=landa(min(j1):max(j1))
y1=interp1(xyi(:,1),xyi(:,2),x1);
plot(x1,y1,'r')
set(gca,'ylim',[-0.1 max(i1)])
  2 件のコメント
Alzapoa
Alzapoa 2012 年 8 月 24 日
Hi Azzi, Thanks for the solution. if you look at the result plot the red line goes to landa=0.4382 and then back down which is not meant to do that. it should go through the max values independent from the order of plot. so what to do with that I hope I am clear.
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 8 月 24 日
but i ve used your result. what kind of interpolation do you want?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWind Power についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by