using python The NACA airfoils are airfoil shapes for aircraft wings developed b
ID: 2074510 • Letter: U
Question
using python The NACA airfoils are airfoil shapes for aircraft wings developed by the National Advisory Committee for Aeronautics (NACA). The shape of the four-digit NACA airfoils is described using four digits following the word NACA". The rst two digits describe the camber and the last two digits describe maximum thickness of the airfoil as percent of the chord. The shape of the symmetric four-digit NACA airfoil is described by Equation 2. (2) y=pm rac{tc}{0.2}[0.2969sqrt{rac{x}{c}}-0.1260rac{x}{c}-0.3516(rac{x}{c})^2+0.2843(rac{x}{c})^3-0.1015(rac{x}{c})^4] where: c is the chord length, x is the position along the chord from 0 to c, t is the maximum thickness as a fraction of the chord length (tc = maximum thickness). Symmetrical four-digit NACA airfoils are designated NACA 00xx, where xx is 100t (i.e., NACA 0015 has t = 0.15). Write a Python program for a symmetric four-digit NACA 00xx airfoil that: 1. Asks the user to enter the chord length in m, 2. Asks user to enter two last digits of the four-digit NACA code, 3. Graph the shape of a symmetric NACA 00xx airfoil.
Explanation / Answer
% NACA 6414%
clc
clear
format compact
m1=input('Please enter one digit number for maxi camber line:')
p1=input('Please enter one digit number for distance of m and chordline:')
t1=input('Please enter two digit number for thickness of airfoil:')
m=m1*0.01;
p=p1*0.1;
t=t1*0.01;
x1=[0:0.01:p];
x2=[p:0.01:1];
x=[x1,x2]
yc1=(m*(2*p*x1-x1.^2))/(p^2);
yc2=(m/(1-p)^2)*((1-2*p)+2*p*x2-x2.^2);
yt=(t/0.2)*(0.2969*sqrt(x)-0.1260*x-0.3516*x.^2+0.2843*x.^3-0.1015*x.^4)
yc=[yc1,yc2]
ang1=(atan((m/p^2)*(2*p-2*x1)))*180/pi
ang2=(atan((m/(1-p)^2)*(2*p-2*x2)))*180/pi
ang=[ang1,ang2]
xu=x-yt.*sin(ang)
yu=yc+yt.*cos(ang)
xl=x+yt.*sin(ang)
yl=yc-yt.*cos(ang)
xplot=[xu,xl]
yplot=[yu,yl]
plot(xplot,yplot)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.