3D surface plots

조회 수: 4 (최근 30일)
ANOSH PHIROZ AMARIA
ANOSH PHIROZ AMARIA 2018년 10월 1일
댓글: Shafahat Ali 2022년 1월 11일

I want to plot a 3D surface plot for Power (P) of a wind turbine while its gear ratio (GR) and Diameter (D) are varying over a range of 14.6:2:20.6 amd 16.5:1:20.5 respectively. I am using a nested for loop to get the power at each of the GR and D. How do I get the surface plot of GR vs D vs P. Code is as below.

clear all
close all
clc
%WIND TURBINE SYSTEM PARAMETERS
% D = 16.5:0.1:20.5;    %Rotor diameter in m
%GR= 14.6:0.2:20.6;   %Gear Ratio of the gearbox connecting rotor to generator
beta=0;   % Angle of attack for maximum efficiency of the turbine
%AIR PROPERTIES
rho = 1.27;    % Density of air kg/m^3
Vw = [0.001:0.01:35];
Wgen = 1800;   %Synchronous Speed of the Generator in rpm
for D=16.5:0.1:20.5
    for GR=14.6:0.2:20.6
    Vt= ((Wgen.*pi/30)./GR).*(D/2);
    Lambda =  Vt./Vw;
    %Heier Approach to Calculate the Coefficient of Performance (Cp)
    %Matrix of Coefficient
    C=[0.5 116 0.4 0 0 6 21 0.08 0.035];
    Lambda_i = ((1./(Lambda+(C(8).*beta)))-(C(9)./((beta.*beta.*beta)+1))).^(-1);
    Cp=0.5*((C(2)./Lambda_i)-(C(3).*beta)-C(6)).*exp(-C(7)./Lambda_i);
    %Calculation of Power
    P=0.5*rho*((pi/4)*(D*D/2).*(Vw.^3)).*(Cp);
    end
end
  댓글 수: 1
Shafahat Ali
Shafahat Ali 2022년 1월 11일
i want to make 3d plots with input cutting speed and feed rate of 3 levels. Output of three levels can be anything. How can i make it please tell me so it will come in grid shape.

댓글을 달려면 로그인하십시오.

채택된 답변

ANKUR KUMAR
ANKUR KUMAR 2018년 10월 1일
I have made few modifications. In your program, you are not saving the output of P for each diameter and gear ratio.
clear all
close all
clc
%WIND TURBINE SYSTEM PARAMETERS
% D = 16.5:0.1:20.5; %Rotor diameter in m
%GR= 14.6:0.2:20.6; %Gear Ratio of the gearbox connecting rotor to generator
beta=0; % Angle of attack for maximum efficiency of the turbine
%AIR PROPERTIES
rho = 1.27; % Density of air kg/m^3
Vw = [0.001:0.01:35];
Wgen = 1800; %Synchronous Speed of the Generator in rpm
i=0;
for D=16.5:0.1:20.5
i=i+1;
j=0;
for GR=14.6:0.2:20.6
j=j+1;
Vt= ((Wgen.*pi/30)./GR).*(D/2);
Lambda = Vt./Vw;
%Heier Approach to Calculate the Coefficient of Performance (Cp)
%Matrix of Coefficient
C=[0.5 116 0.4 0 0 6 21 0.08 0.035];
Lambda_i = ((1./(Lambda+(C(8).*beta)))-(C(9)./((beta.*beta.*beta)+1))).^(-1);
Cp=0.5*((C(2)./Lambda_i)-(C(3).*beta)-C(6)).*exp(-C(7)./Lambda_i);
%Calculation of Power
P(i,j,:)=0.5*rho*((pi/4)*(D*D/2).*(Vw.^3)).*(Cp);
end
end
[xx,yy]=meshgrid(16.5:0.1:20.5,14.6:0.2:20.6);
surf(xx,yy,nanmean(P,3)','FaceAlpha',0.5,'EdgeColor','none')
xlabel('Rotor diameter')
ylabel('Gear Ratio')
colorbar
  댓글 수: 3
ANOSH PHIROZ AMARIA
ANOSH PHIROZ AMARIA 2018년 10월 1일
편집: ANOSH PHIROZ AMARIA 2018년 10월 1일
I essentially need to plot the graph of maximum power in each case vs GR vs D? How will I edit the above code to plot the max power computed at every case?
ANKUR KUMAR
ANKUR KUMAR 2018년 10월 2일
편집: ANKUR KUMAR 2018년 10월 2일
Just use max command in the place of nanmean.
surf(xx,yy,max(P,[],3)','FaceAlpha',0.5,'EdgeColor','none')

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Wind Power에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by