How to smooth an airfoil given through a set of points ?
Afficher commentaires plus anciens
Hi everyone!
I've written a simple code to study an airfoil geometry. The problem arises when I try to zoom in the leading edge; infact the result is a curve not smooth:

I've tryed to use interp1 but I've had some diffuculties. The code is the following one:
clc; close all; clear all;
%Import points
A = importdata ('DAE-21.txt'); %here we have 80 points starting from trailing edge, counter-clockwise direction, and returning to t.e.
x = A (:,1);
y = A (:,2);
do = importdata ('DAE-21_dorsoDraw.txt');
ve = importdata ('DAE-21_ventreDraw.txt');
n = length(do);
yv=interp1(ve(:,1),ve(:,2),do(:,1));
for i=1:n-1
X(i) = (do(i,1)+ ve(i,1))/2;
Y(i) = (do(i,2)+ ve(i,2))/2;
end
%mean line
lm=(yv+do(:,2))/2;
figure (1)
plot (x,y,'o')
axis equal
axis ([-0.05 1.05 -0.1 0.2])
xlabel ('x/c')
ylabel ('z/c')
grid on
%Disegno del profilo: con la linea media
figure (2)
plot(x,y,'k',do(:,1),lm,'k--','LineWidth',1.2);
axis equal
axis ([-0.05 1.05 -0.1 0.2])
xlabel ('x/c')
ylabel ('z/c')
grid on
% LEADING EDGE ZOOM
figure (3)
plot (x,y,'k','LineWidth',1.2)
axis equal
axis ([-0.01 0.05 -0.03 0.05])
xlabel ('x/c')
ylabel ('z/c')
grid on
%trailing edge zoom
figure (4)
plot (x,y,'k','LineWidth',1.2)
axis equal
axis ([0.9 1.05 -0.03 0.04])
xlabel ('x/c')
ylabel ('z/c')
grid on
Whats commands can I use to smooth the airfoils or at least the leading edge ?
Réponse acceptée
Plus de réponses (1)
David Hill
le 22 Oct 2019
airfoil=fit(x,y,'smoothingspline');
plot(airfoil);
2 commentaires
John D'Errico
le 22 Oct 2019
David, I explain why that fails in my answer.
David Hill
le 22 Oct 2019
Thanks.
Catégories
En savoir plus sur Airfoil tools dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


