# Need help on the proper use of a formula to produce a cambered airfoil

Following the book on "The Theory of Thin Wing Sections" page #112 describes the method to combine a camber line (i.e Mean Line) and a thickness distribution to form a cambered wing section. Data derived from the function below will produce a symmetrical airfoil with no camber for the value is a percentage of chord.

yt[x_] :=
Module[{t = .30,c = 1},
(5*t*c*(.2969*Sqrt[x/c] + (-.1260)*(x/c) + (-.3516)*(x/c)^2 + .2843*(x/c)^3 +
(-.1015)*(x/c)^4))*1/2]

Plot[{yt[x], yt[x] - (yt[x]*2), yc[x]*.5}, {x, 0, 1}, AspectRatio -> .15] The function to derive the camber line (Mean Line) as a % of chord is listed below.

m = max thickness
p = position of max thickness in percentage of chord

(* forward of maximum ordinate *)
yc[x_] :=
Module[{m = 0.02, p = .4}, (m (2 p x - x^2))/p^2]

(* aft of maximum ordinate *)
yc1[x_] :=
Module[{m = 0.02, p = .4}, (m (1 - 2 p + 2 p x - x^2))/(1 - p)^2]

Show[Plot[yc[x], {x, 0, .4}], Plot[yc1[x], {x, .4, 1}],
PlotRange -> Automatic, AspectRatio -> .05] Reproducing part of the PDF found on another site, a shorter version is found here, The root of my pain is I don't think I'm using the right trig function. If I were to use the formula $x-y\,t \sin(\theta)$, and I tried, but I didn't come close to the answer. How would I use $x-y\,t \sin(\theta)$ in Mathematica?

Below is a sample found in a PDF from "The Theory of Thin Wing Sections" • Maybe its me, but I can't figure out what is being asked here... what do you mean by how to use "x -yt sin(theta)" in Mathematica? Use it to do what? and where exactly do you want to use it? – Bichoy May 28 '15 at 2:47

I have to thank you for leading me down a fascinating rabbit hole! I have always found airfoil shapes enormously pleasing, but I was not aware of the NACA system.

For those who, like me, did not know much about the story, NACA was the predecessor of NASA. They established some of the first airfoil definitions codified through mathematical relationships. For instance, a so called four-digit NACA airfoil such as "NACA 2415" is defined as follows:

• The length of an airfoil is called its chord. Here we use a parametric length of $1$, which can just be adjusted to any length necessary.
• The first digit in the NACA designation indicates the maximum camber $m$ (curvature) as a percentage of the cord (length): in this example 2%;
• The second digit indicates the position $p$ of the point of maximum curvature, in tenths of the chord measuring from the leading edge, i.e. the front; here it is at 4 tenths of the chords, i.e. 40% back;
• The last two digits indicate the maximum thickness $t$ of the airfoil as a percentage of the chord; here 15%.

These definitions come with standard formulae (linked in the OP's question) that allow you to calculate the shape of the airfoil. These functions are more conveniently defined using Piecewise below (here is its documentation), rather than having the two separate definitions used by the OP.

m = 0.02; p = 0.40; t = 0.15; (* characteristics of NACA 2415*)

yc[x_] := Piecewise[{
{m/p^2 (2 p x - x^2), 0 <= x < p},
{m/(1 - p)^2 ((1 - 2 p) + 2 p x - x^2), p <= x <= 1}
}]

yt[x_] := 5 t (0.2969 Sqrt[x] - 0.1260 x - 0.3516 x^2 + 0.2843 x^3 - 0.1015 x^4)


The final cambered profile is expressed using trigonometric functions of an angle $\theta=\arctan \frac{d{y_c}}{d{x}}$, shown below as the pre-calculated derivative. Mathematica will calculate this for you using D[yc[x], x].

theta[x_] := ArcTan@ Piecewise[{
{(m*(2*p - 2*x))/p^2, 0 <= x < p},
{(m*(2*p - 2*x))/(1 - p)^2, p <= x <= 1}
}]


Now we have all the machinery in place to plot the shape of the cambered airfoil.

In the NACA model the contour of the airfoil is expressed as a function of one parameter, i.e. the distance $x$ along the chord, so ParametricPlot (docs) is a natural fit here:

ParametricPlot[
{
{x - yt[x] Sin[theta[x]], yc[x] + yt[x] Cos[theta[x]]},
{x + yt[x] Sin[theta[x]], yc[x] - yt[x] Cos[theta[x]]}
},
{x, 0, 1}, ImageSize -> Large, Exclusions -> None
] • Nice. Makes me remember when I wanted to be an aerospace engineer... Anyhoo, you can get rid of those breaks in your plot by using Exclusions->None. (+1) – kale May 28 '15 at 13:47
• @kale That's a good point: let me add that to the answer and fix the plot. Thank you for the upvote as well! – MarcoB May 28 '15 at 13:56
• @MarcoB I have been tinkering with this for a long time. With little forward progress and learning MMA, I could not have found the solution without your help. I have a better understanding on a number of fronts. Thank you: Bob Brooks – Bob Brooks May 28 '15 at 15:16
• @MarcoB: I added {x,yc[x]} to see the mean line, your plot works nice. – Bob Brooks May 28 '15 at 15:40
• @BobBrooks I'm delighted! As I said, thank you again for bringing up the problem, it was fun to delve into the airfoil shapes & equations. I was thinking about adding the chord and the mean lines to the plot as well: you don't need my help with that since you have it figured out already, but if I have the time I might add it to the answer anyway, just for the sake of completeness. – MarcoB May 28 '15 at 16:07