机翼图问题

  • 本文关键字:问题 matlab
  • 更新时间 :
  • 英文 :


我在matlab上绘制翼型时遇到问题。似乎有一些Abberation只有一两个值。我已经反复检查了这些公式,所以它们应该是好的。我还没有转成学位,所以这不是问题所在。

%% setup 
clc
clear all
%type of airfoil
typeNACA = '2312';
%extract values of airfoil type
M = str2double(typeNACA(1)); % max camber %chord
P = str2double(typeNACA(2)); % chordwise position
Thmax = str2double(typeNACA(3:4));
M=M/100;
P=P/100
Thmax=Thmax/100;

% gridpoints
gridpoints = 1000; 
% Airfoil grid
x = linspace(0,1,gridpoints);
%camber equations 
%yc1(x) = (M/P^2)*(2*P*x-x^2);
%yc(x) = (M/(1-P)^2*(1-2*P+2*Px-x^2); % (for P =< x <1)
%dyc1 = (2*M/P^2)*(P-x)
%dyc2 = (2*M)/(1-P^2)*(P-x)
%Camber and gradient
yc = ones(gridpoints,1);
dyc= ones(gridpoints,1);
theta=ones(gridpoints,1);
for i=1:gridpoints
if (x(i) >= 0 && x(i) < P)
yc(i) = (M/P^2)*(2*P*x(i)-x(i)^2); % (for 0 =< x < P)
dyc(i)= ((2*M)/P^2)*(P - x(i)); %dyc/dx
elseif (x(i) >= P && x(i) <= 1)  % (for P =< x <1)
yc(i)=(M/(1-P)^2)*(1-2*P+2*P*x(i)-x(i)^2); 
dyc(i) = (2*M)/((1-P)^2*(P-x(i)));
end
theta(i) = atan(dyc(i)); %angle theta
end

% thickness coefficients
a0 = 0.2969;
a1 = -0.126;
a2 = -0.3516;
a3 = 0.2843;
a4 = -0.1036;  % -0.1015 for open TE -0.1036 for closed TE
%thickness distribution 
yt = ones(gridpoints,1);
for i=1:1:gridpoints
yt(i) = (Thmax/0.2)*(a0*x(i)^0.5 + a1*x(i) + a2*x(i)^2 + a3*x(i)^3 + a4*x(i)^4);
end
% Upper surface points
xu = ones(gridpoints,1);
yu = ones(gridpoints,1);
for i= 1:gridpoints
xu(i) = x(i) - yt(i)*sin(theta(i));
yu(i) = yc(i) + yt(i)*cos(theta(i));
end
% Lower surface points
xl = ones(gridpoints,1);
yl = ones(gridpoints,1);
for i=1:1:gridpoints
xl(i) = x(i) + yt(i)*sin(theta(i));
yl(i) = yc(i) - yt(i)*cos(theta(i));
end
%PLOT
f1 = figure(1);
hold on; grid on;
axis equal
plot(xu,yu,'r';
plot(xl,yl,'b');

好!第一个问题是你忘记了第二行末尾的右括号。但如果你想让我检查你的代码,我需要你的typeNACA((函数.m文件来修改它。或者你可以在这里发布它的代码。

%PLOT
f1 = figure(1);
hold on; grid on;
axis equal
plot(xu,yu,'r';
plot(xl,yl,'b');

相关内容

  • 没有找到相关文章

最新更新