clear clc af=[1.0002 -0.00161 0.99043 0.00065 0.97609 0.00427 0.95715 0.00921 0.93617 0.01477 0.91469 0.02055 0.89312 0.02641 0.87154 0.03231 0.84996 0.03824 0.82838 0.04419 0.80681 0.05014 0.78524 0.0561 0.76367 0.06207 0.74209 0.06803 0.72058 0.07398 0.69922 0.07986 0.6781 0.08563 0.6573 0.09122 0.63695 0.09654 0.61707 0.10151 0.59763 0.10606 0.57854 0.11018 0.55967 0.11384 0.54089 0.11704 0.5221 0.11981 0.50324 0.12214 0.48429 0.12404 0.46525 0.12553 0.44616 0.12658 0.42704 0.12722 0.40789 0.12742 0.38868 0.1272 0.36939 0.12657 0.35001 0.12553 0.33058 0.1241 0.31113 0.12228 0.2917 0.12008 0.27233 0.11751 0.25307 0.11457 0.23393 0.11126 0.21496 0.10757 0.19621 0.10353 0.17773 0.09911 0.15956 0.09433 0.14177 0.08917 0.12444 0.08366 0.10769 0.07778 0.09162 0.07157 0.07638 0.06506 0.0622 0.05831 0.04931 0.05144 0.03799 0.0446 0.02846 0.03803 0.0208 0.03198 0.01489 0.02657 0.01041 0.0218 0.00707 0.01758 0.00458 0.01383 0.00276 0.01046 0.00147 0.00741 0.00061 0.00462 0.00013 0.00203 0 -0.00039 0.00025 -0.00278 0.00097 -0.00517 0.00221 -0.00746 0.00399 -0.00958 0.00632 -0.0115 0.00921 -0.01324 0.01273 -0.01487 0.01707 -0.01644 0.02253 -0.018 0.02956 -0.01953 0.03876 -0.02098 0.05086 -0.0222 0.06651 -0.02308 0.08566 -0.02362 0.10687 -0.02393 0.12869 -0.02401 0.15089 -0.02391 0.17339 -0.02368 0.19597 -0.02337 0.21855 -0.02297 0.24109 -0.02251 0.26357 -0.022 0.28601 -0.02144 0.30841 -0.02085 0.33079 -0.02023 0.35315 -0.01959 0.37549 -0.01891 0.39782 -0.01821 0.42015 -0.01749 0.44247 -0.01673 0.46479 -0.01595 0.48711 -0.01513 0.50943 -0.01429 0.53175 -0.01342 0.55407 -0.01251 0.57639 -0.01157 0.59871 -0.0106 0.62103 -0.00962 0.64335 -0.00864 0.66567 -0.00767 0.688 -0.00673 0.71036 -0.00582 0.73279 -0.00494 0.7553 -0.00407 0.77776 -0.0032 0.80018 -0.00229 0.82264 -0.00135 0.84494 -0.00044 0.86681 0.0004 0.88806 0.00108 0.90848 0.00151 0.92796 0.00161 0.94637 0.00129 0.96339 0.00052 0.97834 -0.00064 0.99047 -0.00204 0.9998 -0.00357]; k=1:length(af); top=1:length(af)/2; bottom=sort(length(af)/2+1:length(af),'descend'); cam_line(:,1)=(af(top,1)+af(bottom,1))/2; cam_line(:,2)=(af(top,2)+af(bottom,2))/2; hold on for i=length(af) plot(af(i,1),af(i,2),'r*') axis equal text(af(i,1),af(i,2),num2str(i)) end plot(cam_line(:,1),cam_line(:,2),'r:') hold off [p o]=max(cam_line(:,2)); max_cam=cam_line(o,:) % naca=5400; m=.05; p=.4; c=1; x=linspace(0,1,length(af)/2); for lw=1:length(af)/2 for mn=1:length(m) for pn=1:length(p) if x(lw)<=p y_c(lw,mn,pn)=m(mn)/p(pn)^2*(2*p(pn)*x(lw)-x(lw)^2); else y_c(lw,mn,pn)=m(mn)/(1-p(pn))^2*((1-2*p(pn))+2*p(pn)*x(lw)-x(lw)^2); end end end end figure(2) clf hold on plot(cam_line(:,1),cam_line(:,2),'r:') plot(x,y_c(:,1,1),'k-.') axis equal title('Camber Line') legend('AF94145','NACA 5400'); hold off chord=20/12*12; taper=linspace(1,.6,7); root=chord; tip=chord*taper; h_span=8.1*12; rib_num=4; x=linspace(0,h_span,rib_num); for tx=1:length(taper) ribs = (root*(h_span-x)+tip(tx)*x)./h_span; for rx=1:length(x) area(tx,rx)=polyarea(af(:,1)*ribs(rx),af(:,2)*ribs(rx)); end end area norm_weight=sum(area,2) weight_savings=(norm_weight(1)-norm_weight)./norm_weight(1)*100; disp(' Taper %Area Diff') disp([taper',weight_savings])