One way to attack this is to use a fog law to define your equation, then use a loop to create the points.
One reason fog laws are cool is that you can define discontinuous functions.
For example, a fog law defining the camber line for a NACA 4 digit series airfoil looks like this:
Formal Real parameters are x and y
Real parameters in the tree are P_Law and M_Law
the body of the law is:
if ( x <= P_Law )
{
y = (M_Law /(P_Law **2)) * ( 2 * P_Law * x - x**2)
}
else
{
y = (M_Law / ((1 - P_Law ) ** 2)) * (( 1 -(2 *P_Law ) ) + (2 * P_Law * x) - x**2)
}
This describe the curve you want. To create the points you can use a KWA loop.
One input to the loop is your fog law, here locally named MCL.
A second input is LawStep which is the step in x along the chord line.
the body of the loop is:
Point_$i$ isa GSMPoint
{
PointType = 0;
TypeObject isa GSMPointCoord
{
X = $i$ * LawStep * 1in;
Y = MCL.Evaluate($i$ * LawStep) * 1in;
Z = 0in;
}
}
Which generates all the points with all the formulas in one shot.
Finally a spline can be generated through all the points by starting with a Parameter Curve (f(x) tool -> Add new parameter of type curve) and assigning the formula:
spline(CamberPoints->Query("GSMPoint","" ) )
I am not sure my fog law is actually correct but the results look right. I got the formula from here: www.aerospaceweb.org/question/airfoils/q0041.shtml
I attach my experiment for your reference.
|