function [coord] = CST_airfoil(wl,wu,dz,N);
% Description : Create a set of airfoil coordinates using CST parametrization method
% Input : wl = CST weight of lower surface
% wu = CST weight of upper surface
% dz = trailing edge thickness
% Output : coord = set of x-y coordinates of airfoil generated by CST
% Create x coordinate
x=ones(N+1,1);y=zeros(N+1,1);zeta=zeros(N+1,1);
for i=1:N+1
zeta(i)=2*pi/N*(i-1);
x(i)=0.5*(cos(zeta(i))+1);
end
% N1 and N2 parameters (N1 = 0.5 and N2 = 1 for airfoil shape)
N1 = 0.5;
N2 = 1;
zerind = find(x(:,1) == 0); % Used to separate upper and lower surfaces
xl= x(1:zerind-1); % Lower surface x-coordinates
xu = x(zerind:end); % Upper surface x-coordinates
[yl] = ClassShape(wl,xl,N1,N2,-dz); % Call ClassShape function to determine lower surface y-coordinates
[yu] = ClassShape(wu,xu,N1,N2,dz); % Call ClassShape function to determine upper surface y-coordinates
y = [yl;yu]; % Combine upper and lower y coordinates
coord = [x y]; % Combine x and y into single output
%% Function to calculate class and shape function
function [y] = ClassShape(w,x,N1,N2,dz);
% Class function; taking input of N1 and N2
for i = 1:size(x,1)
C(i,1) = x(i)^N1*((1-x(i))^N2);
end
% Shape function; using Bernstein Polynomials
n = size(w,2)-1; % Order of Bernstein polynomials
for i = 1:n+1
K(i) = factorial(n)/(factorial(i-1)*(factorial((n)-(i-1))));
end
for i = 1:size(x,1)
S(i,1) = 0;
for j = 1:n+1
S(i,1) = S(i,1) + w(j)*K(j)*x(i)^(j-1)*((1-x(i))^(n-(j-1)));
end
end
% Calculate y output
for i = 1:size(x,1)
y(i,1) = C(i,1)*S(i,1) + x(i)*dz;
end
Matlab项目包含用于使用cst参数化方法生成翼型的源代码和Matlab示例
172 浏览量
2023-09-01
20:36:34
上传
评论
收藏 2KB ZIP 举报
温柔-的-女汉子
- 粉丝: 777
- 资源: 4010
最新资源
- 基于图像的三维模型重建C++源代码+文档说明(高分课程设计)
- 基于聚焦法的工件立体测量方案,根据数据进行三维重建 使用HALCON处理图像,MATLAB拟合数据+源代码+数据集+效果图
- 锄战三国村 修改:货币使用不减 v1.10(2) 原创 (中文).apk
- 基于python实现的单目双目视觉三维重建+源代码+图像图片(高分课程设计)
- 基于C+++OPENCV的全景图像拼接源码(课程设计)
- 基于Python+OpenCV对多张图片进行全景图像拼接,消除鬼影,消除裂缝+源代码+文档说明+界面截图(高分课程设计)
- 基于C++实现的全景图像拼接源码(课程设计)
- 基于SIFT特征点提取和RASIC算法实现全景图像拼接python源码+文档说明+界面截图+详细注释(95分以上课程大作业)
- 基于matlab实现眼部判别的疲劳检测系统+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
- 基于Matlab的异常姿势识别系统+源代码+全部数据+文档说明+详细注释+使用说明+截图(高分课程设计)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈