airfoilprediction

airfoilprediction - A2 + dzdx*cos2t*dtheta end B0 = B0/pi...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 clear data = load('naca4415 coordinates.txt') [m,n] = size(data) % the following stops the loop when it finds x=0 (meaning end of upper layer) Nj = 0 for i = 1:m xup(i) = data(i,1) zup(i) = data(i,2) Nj = Nj+1 if xup(i) == 0, break, end end % then we can fill in the lower layer for i = 1:Nj xlow(i) = data(Nj+i-1,1) zlow(i) = data(Nj+i-1,2) end % spline for upper layer fxup = spline(xup,zup) sup = ppval(fxup,xup) % spline for bottom layer fxlow = spline(xlow,zlow) slow = ppval(fxlow,xlow) xk = xlow for i = 0:Nj-1 zk(i+1) = .5*(zup(Nj-i) + zlow(i+1)) end s(1) = 0.0 for i = 2:Nj s(i) = s(i-1) + sqrt((xk(i)-xk(i-1))^2 + (zk(i)-zk(i-1))^2) end fx = spline(xk,zk) sk = ppval(fx,xk) % integrate c=1 B0 = 0 A1 = 0 A2 = 0 for j = 2:Nj dx = xk(j) - xk(j-1) dz = zk(j) - zk(j-1) dzdx = dz/dx thetaj = acos(1- 2*xk(j)/c) thetajm = acos(1-2*xk(j-1)/c) dtheta = thetaj - thetajm theta = . 5*(thetaj + thetajm) cost = cos(theta) Page 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 cos2t = cos(2*theta) B0 = B0 + dzdx*dtheta A1 = A1 + dzdx*cost*dtheta A2 =
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: A2 + dzdx*cos2t*dtheta end B0 = B0/pi A1 = A1*2/pi A2 = A2*2/pi % alpha loop for i = 1:31 alphadeg(i) = i-11 alpha = alphadeg(i)*pi/180 A0 = alpha - B0 Cl(i) = 2*pi*(A0 + A1/2) Cm(i) = pi/4*(A2 - A1) Xcp(i) = 1/4*(1 + pi/Cl(i)*(A1 - A2)) end Xac = .25 alpha0 = B0 - A1/2 alpha0 = alpha0*180/pi % load experimental data data2 = load('naca4415 alpha vs Cl.txt') [m,n] = size(data2) for i = 1:m Clexp(i) = data2(i,2) end data3 = load('naca4415 alpha vs Cm.txt') [m,n] = size(data2) for i = 1:m Cmexp(i) = data3(i,2) end % graph figure(1) xlabel('Angle of Attack (degrees)') title('Moment Coefficient Data') figure(2) xlabel('Angle of Attack (degrees)') title('Lift Coefficient Data') figure(3) xlabel('Angle of Attack (degrees)') title('Location of Center of Pressure') Page 2 Sheet1 clear all clc Page 3 Sheet1 plot(alphadeg,Cm,alphadeg,Cmexp,'ro') ylabel('Cm') plot(alphadeg,Cl,alphadeg,Clexp,'ro') ylabel('Cl') plot(alphadeg,Xcp) ylabel('Xcp') Page 4...
View Full Document

This note was uploaded on 03/26/2008 for the course AERE 343 taught by Professor Hindman during the Spring '08 term at Iowa State.

Page1 / 5

airfoilprediction - A2 + dzdx*cos2t*dtheta end B0 = B0/pi...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online