I want to make airfoil on Matlab..please tell me code of this

79 views (last 30 days)
Airfoil ko m n Matlab p draw krna h..so mjhe us k code chae
  3 Comments
DGM
DGM on 17 Nov 2023
Moved from comment-as-flag by @Aina:
I want to make rocket on Matlab..plz send me code for this
DGM
DGM on 17 Nov 2023
It's been over a decade since I did any airfoil optimization, but I recall some things about it:
  • The design of an airfoil consists of the selection of multiple parameters
  • The optimal design depends on the purpose and specific application conditions
  • The specific application conditions and range of parameters are often restrictive
In other words, it's almost guaranteed that any airfoil I give you won't be the airfoil you need, because it's a complicated problem which has thus far been completely undefined. Now you want to graduate to an even larger-scale system -- a rocket.
Maybe you don't even need an optimal real-world design. Maybe you just want to draw a generic shape for some non-technical purpose. Either way, you need to be more specific about what you want.
I don't normally do this, but

Sign in to comment.

Answers (4)

DGM
DGM on 16 Nov 2023
Any old airfoil, eh? Start by drawing any plane curve.
x = [89 4 4 3 3 4 4 12 12 96 96 89 89 88 88 88 88 96 NaN 58 49 49 45 45 37 37 33 33 29 29 27 27 27 27 35 35 37 37 39 39 49 49 59 59 67 67 62 62 84 84 66 NaN 67 75 75 80 80 86 86 83 83 80 80 84 NaN 76 71 71 68 68 66 66 72 72 75 75 75 75 68 NaN 83 94 94 93 93 89 89 79 79 81 81 93 NaN 35 39 39 44 44 48 48 49 49 58 NaN 48 62 62 61 61 51 NaN 34 27 27 24 24 33 NaN 30 27 27 32 32 31 31 37 37 39 39 38 38 35 35 30 30 30 NaN 28 24 24 24 24 24 24 26 26 29 NaN 34 32 32 47 NaN 56 71 71 73];
y = [10 72 72 73 73 75 75 83 83 22 22 10 10 11 11 14 14 22 NaN 32 22 22 19 19 15 15 16 16 19 19 24 24 27 27 37 37 47 47 50 50 56 56 58 58 62 62 56 56 71 71 44 NaN 62 71 71 90 90 94 94 71 71 69 69 93 NaN 76 80 80 78 78 74 74 69 69 71 71 73 73 78 NaN 71 63 63 60 60 58 58 64 64 68 68 60 NaN 37 35 35 29 29 33 33 43 43 49 NaN 21 29 29 30 30 25 NaN 37 55 55 57 57 36 NaN 23 18 18 19 19 21 21 27 27 30 30 31 31 29 29 22 22 21 NaN 20 17 17 14 14 13 13 14 14 18 NaN 67 65 65 55 NaN 48 37 37 38];
plot(x,y,'k','linewidth',2)
axis equal
... and bam! Airfoils all over the place. Super easy.

atharva
atharva on 16 Nov 2023
Hey Aina,
I understand that you want to plot airfoil on MATLAB.
You can use the following
To describe any airfoil, one must have the relation between the coordinates (x, y). You can use the above relation with your coordinates file to plot Airfoil on MATLAB.
I hope this helps!

Sam Chak
Sam Chak on 17 Nov 2023
Some aircraft instructors didn't teach the math behind drawing the airfoil. I had to dig up an old file to plot the NACA 4415 airfoil. However, I haven't uploaded it to the File Exchange. So, consider this as a reference or something.
c = 1; % chord length
s = num2str(4415);
NACA = s;
d1 = str2double(s(1)); % pulls the first digit out of the scalar
d2 = str2double(s(2)); % pulls the second digit out of the scalar
d34 = str2double(s(3:4)); % pulls the third and fourth digit out of the scalar
m = d1/100;
p = d2/10;
t = d34/100;
x = linspace(0, c, 250);
yt = 5*t*c*(.2969*(sqrt(x/c))+-.1260*(x/c)+-.3516*(x/c).^2+.2843*(x/c).^3+-.1015*(x/c).^4);
for k = 1:length(x)
if x(k) <= p*c
yc(k) = m*(x(k)/p^2)*(2*p - (x(k)/c));
dx(k) = (2*m)/p^2*(p - (x(k)/c));
elseif x(k) > p*c
yc(k) = m*((c - x(k))/(1 - p)^2)*(1 + (x(k)/c) - 2*p);
dx(k) = (2*m/(1 - p)^2)*(p - (x(k)/c));
end
% upper and lower limits of the airfoil (xu, yu); (xl, yl)
theta = atan(dx(k));
xu(k) = x(k) - yt(k)*sin(theta);
yu(k) = yc(k) + yt(k)*cos(theta);
xl(k) = x(k) + yt(k)*sin(theta);
yl(k) = yc(k) - yt(k)*cos(theta);
end
% Plot the airfoil
plot(xu, yu, 'linewidth', 1.5, 'color', '#528AFA')
hold on
plot(xl, yl, 'linewidth', 1.5, 'color', '#528AFA')
plot(x, yc, 'color', '#FA477A')
hold off
title('NACA 4415 airfoil', 'FontSize', 16)
axis equal
  8 Comments
Sam Chak
Sam Chak on 17 Nov 2023
Some airfoils are more popular than others, such as the NACA 4412 airfoil. Studies indicate that the NACA 4412 airfoil delivers the highest performance at an Angle of Attack of 13.8°. Despite its popularity in sports planes, the airfoil's shape can be optimized to achieve a higher lift-to-drag ratio.
title('NACA 4412 airfoil', 'FontSize', 16)
Dyuman Joshi
Dyuman Joshi on 18 Nov 2023
NACA 4 digits airfoils, particularly xx12 series, have been one of the most popularly studied Airfoil designs created by NACA.

Sign in to comment.


Image Analyst
Image Analyst on 16 Nov 2023
See the links on the right hand side of this page.

Categories

Find more on Airfoil tools in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!