How do I surf plot this data in matlab?

9 vues (au cours des 30 derniers jours)
Vinay Mepani
Vinay Mepani le 9 Sep 2016
My three variables are: "Beta", "lambda_fit", "Cp" (as shown in the image) and I would like to surface plot this data. Matlab is not letting me plot the data because the beta matrix is only a 1x4 instead of 4x8. How would I get Matlab to plot this data?
Appreciate any help.
Here's my code:
beta=[15,20,30,35]; %Pitch Angles
Vw = [3,3.5,4,4.5,4.75,5,5.25,5.5];
RPM1= [300 400 470 550 580 630 645 660]; %(15 degrees)
P1 = [4 50 80 100 108 120 128 137];
Vw = [3,3.5,4,4.5,4.75,5,5.25,5.5];
RPM2 = [350 460 530 590 615 660 680 750]; %(20 degrees)
P2 = [45 60 70 112 114 120 145 165];
Vw = [3,3.5,4,4.5,4.75,5,5.25,5.5];
RPM3 = [300 380 400 420 445 480 515 520]; %(30 degrees)
P3 = [8 30 50 60 74 82 83 90];
Vw = [3,3.5,4,4.5,4.75,5,5.25,5.5];
RPM4 = [200 280 320 340 350 360 390 420]; %(35 degrees)
P4 = [2 3 5 10 20 40 46 50];
figure(1);
plot(Vw,RPM1,'x');
title('RPM vs Windspeed (15 degrees pitch angle)');
xlabel('Vw');
ylabel('RPM');
figure(2);
plot(Vw,RPM2,'x');
title('RPM vs Windspeed (20 degrees pitch angle)');
xlabel('Vw');
ylabel('RPM');
figure(3);
plot(Vw,RPM3,'x');
title('RPM vs Windspeed (30 degrees pitch angle)');
xlabel('Vw');
ylabel('RPM');
figure(4);
plot(Vw,RPM4,'x');
title('RPM vs Windspeed (35 degrees pitch angle)');
xlabel('Vw');
ylabel('RPM');
RPM_fit1=[318.625730994152,391.929824561404,465.233918128655,538.538011695906,575.190058479532,611.842105263158,648.494152046784,685.146198830409];
RPM_fit2=[368.625730994152,441.929824561403,515.233918128655,588.538011695906,625.190058479532,661.842105263158,698.494152046784,735.146198830409];
RPM_fit3=[313.128654970760,354.649122807018,396.169590643275,437.690058479532,458.450292397661,479.210526315789,499.970760233918,520.730994152047];
RPM_fit4=[223.216374269006,261.228070175439,299.239766081871,337.251461988304,356.257309941520,375.263157894737,394.269005847953,413.274853801170];
RPM_fit=[RPM_fit1;RPM_fit2;RPM_fit3;RPM_fit4];
w_fit=(2*pi)/60*RPM_fit;
Vw_m=[3,3.5,4,4.5,4.75,5,5.25,5.5;3,3.5,4,4.5,4.75,5,5.25,5.5;3,3.5,4,4.5,4.75,5,5.25,5.5;3,3.5,4,4.5,4.75,5,5.25,5.5]
R = 0.17; %radius of turbine
ro = 1.23;%density of air
A = pi*(R^2)%swept area
lambda_fit=w_fit*R./Vw_m;
[B,L]=meshgrid(beta,lambda_fit);
p_m=[4 50 80 100 108 120 128 137;45 60 70 112 114 120 145 165;8 30 50 60 74 82 83 90;2 3 5 10 20 40 46 50;]; %matrix form of power
Cp=2.*p_m./((Vw_m.^3)*ro*A); %power coefficient
figure(5)
surf(B,Cp,L); %3d plot
title('')
xlabel('Pitch angle')
ylabel('Cpf')
zlabel('lambda')
end
Thanks in advance, Vinay

Réponses (1)

Star Strider
Star Strider le 9 Sep 2016
For your vector data, your best option to plot them in 3D is the ribbon plot.

Community Treasure Hunt

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

Start Hunting!

Translated by