49 views (last 30 days)

I have a bunch of data for a NACA 63-412 aerofoil which I want to use in my software. I have two data sets, one for reynolds number 400000 and one for 5000000. I need to interpolate/extrapolate the data so that I can calculate with other reynolds numbers. The furthest I have gotten now is this, I have drawn two lines from this data and now I need to connect those into i suppose a surface but really wouldn't know how? any help would be greatly appreciated!

Cd1 = [0.0088

0.0089

0.0089

0.009

0.009

0.009

0.009

0.009

0.0091

0.0091

0.0092

0.0093

0.0094

0.0096

0.0098

0.0101

0.0106

0.0116

0.0133];

Cl1= [-0.0053

0.0523

0.1096

0.1675

0.2248

0.2823

0.3392

0.3952

0.452

0.5089

0.5647

0.6206

0.6767

0.7321

0.7858

0.836

0.885

0.928

0.9606];

RE1= [400000

400000

400000

400000

400000

400000

400000

400000

400000

400000

400000

400000

400000

400000

400000

400000

400000

400000

400000];

Cd2 = [0.008

0.008

0.008

0.0081

0.0081

0.0081

0.0081

0.0082

0.0082

0.0083

0.0084

0.0085

0.0087

0.0089

0.0093

0.0101

0.0112

0.0127

0.0141];

Cl2 = [-0.0048

0.053

0.1108

0.1689

0.2267

0.2837

0.3406

0.3982

0.455

0.5117

0.5687

0.6249

0.681

0.7356

0.7879

0.8352

0.8793

0.9172

0.9541];

RE2 = [500000

500000

500000

500000

500000

500000

500000

500000

500000

500000

500000

500000

500000

500000

500000

500000

500000

500000

500000];

figure(1)

hold on

plot3(Cl1,Cd1,RE1);

plot3(Cl2,Cd2,RE2);

John D'Errico
on 11 Jan 2021

Edited: John D'Errico
on 11 Jan 2021

You lack sufficient information to construct a meaningful surface, since you have only 2 pieces of information in terms of Reynolds number.

First, plot what you have. A 3-d plot is effectively useless here, and makes it far more difficult to understand what you do have.

plot(Cl1,Cd1,'-or',Cl2,Cd2,'-*b')

legend('RE 400K','RE 500K')

xlabel 'Cl'

ylabel 'Cd'

So we see two curves that are not terribly similar in shape. There is a bit of noise seen. And the abscissa for these two curves are not the same, so you could not just use a tool like interp2 to interpolate. Extrapolating those curves, or for Reynold's numbers that fall (significantly) outside the interval [4e5,5e5] would seem to be a foolish (risky) task, due to the high amount of curvature of the respective curves, and due to the noise in the data.

If you merely wish to predict a point for some other Reynolds number however, you could simply use a spline interpolant, a linear interpolant, or perhaps a smoothing spline for each curve. Then, since you have only two distinct Reynolds numbers and thus only two distinct curves, just use linear interpolation between the two. For example, if you have the curve fitting toolbox, I might do this:

CF1 = fit(Cl1,Cd1,'smoothingspline');

CF2 = fit(Cl2,Cd2,'smoothingspline');

CFinterp = @(Cl,Re) (5e5 - Re)/(5e5-4e5)*CF1(Cl) + (Re - 4e5)/(5e5-4e5)*CF2(Cl);

Cl = linspace(0,1,50);

Reinterp = 4.5e5;

hold on

plot(Cl,CFinterp(Cl,Reinterp),'g-')

legend('RE 400K','RE 500K','RE 450K')

I hard coded the Reynolds numbers in the interpolant there, but it is easy enough to fix that.

John D'Errico
on 11 Jan 2021

With only two curves, thus essentialy two pieces of information, you cannot do much more than the linear interpolation between then that I did.

However, with more curves, you can now use a better interpolation scheme. One issue is they are not all at the same set of points, so a tool like interp2 is still inappropriate. However, if you had multiple such curves, you might now set it up as a scattereed interpolation, perhaps using a tool like scatteredInterpolant. One problem you would need to consider is that your data has been rounded.

That is, we see this:

Cd1 = [0.0088

0.0089

0.0089

0.009

0.009

0.009

0.009

0.009

0.0091

0.0091

0.0092

0.0093

0.0094

0.0096

0.0098

0.0101

0.0106

0.0116

0.0133];

The result is, we see information has been lost because the numbers have been rounded to 4 decimal places. This is in fact probably a large part of what I viewed as noise in my answer. So the first problem is to avoid rounding your data.

Years ago, I wrote a little toy to unround such data. It finds the best approximate set of values in a vector that are consistent with rounding your data, yet form a smooth sequence. I'll attach unround to this comment. It uses quadprog as I recall, from the optimization toolbox.

Cd2hat = unround(round(Cd2*10000))/10000

Cd2hat =

0.00799562511358732

0.00801375007622656

0.00803187503888049

0.00805000000151423

0.00806812496391403

0.00808899994112061

0.00811537494835355

0.00815000000087096

0.00819562511387439

0.00825978140711786

0.0083500000003701

0.00847381201377941

0.0086500000000361

0.00889734651195069

0.00934999999997362

0.0101421089145642

0.0112499999999845

0.0126500000000143

0.0140500416872856

>> Cd1hat = unround(round(Cd1*10000))/10000

Cd1hat =

0.00885

0.00888733905579094

0.00892167381973867

0.00895

0.00896931330473172

0.00898453765121487

0.00900059695673051

0.00902241513855969

0.00905491611398346

0.00910302380028289

0.0091716621147461

0.00926575497466125

0.00939022629731648

0.00955

0.00975

0.01006

0.01064

0.01165

0.01325

plot(Cl1,Cd1hat,'-or',Cl2,Cd2hat,'-*b')

xlabel 'Cl'

ylabel 'Cdhat'

That has now dramatically improved your data. (I should probably post unround.m on the File Exchange someday. I don't think I ever did.) It suggests that your data is not in fact noisy, only that you sloppily allowed it to be rounded to 4 digits.

If you now had several such curves, now I might try building a scatteredInterpolant for Cd, as a function of the parameters Cl and Re. But before you could do that, you need the more accurate values for Cl, otherwise any interpolation will fail to perform well. The nice thing about scatteredInterpolant is it will allow you to create that surface as a function of the two variables.

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

Start Hunting!
## 5 Comments

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/713878-aerofoil-graph-interpolation-extrapolation#comment_1256638

⋮## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/713878-aerofoil-graph-interpolation-extrapolation#comment_1256638

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/713878-aerofoil-graph-interpolation-extrapolation#comment_1256868

⋮## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/713878-aerofoil-graph-interpolation-extrapolation#comment_1256868

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/713878-aerofoil-graph-interpolation-extrapolation#comment_1257348

⋮## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/713878-aerofoil-graph-interpolation-extrapolation#comment_1257348

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/713878-aerofoil-graph-interpolation-extrapolation#comment_1257638

⋮## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/713878-aerofoil-graph-interpolation-extrapolation#comment_1257638

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/713878-aerofoil-graph-interpolation-extrapolation#comment_1258438

⋮## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/713878-aerofoil-graph-interpolation-extrapolation#comment_1258438

Sign in to comment.