Linear Interpolation of Reference Drag Coefficient

Recap

In the last section we discussed the difference between an analytical and a numerical solution. We finished with an example of how to calculate the first three steps of a numerical method to solve the 3D equations of motion of a projectile. There is one last piece we haven't discussed yet, and that is how to get the reference drag coefficient Cdref.

Getting the Cdref value - Linear Interpolation

In the above example, we glossed over the explanation of how to get the Cdref value. Recall these previous charts, the Cdref value changes with the velocity of the projectile:

g7 drag profile plot cdref vs mach speed
G7 Profile: Cdref vs Mach speed
g7 drag profile plot cdref vs velocity m/s
G7 Profile: Cdref vs Velocity (m/s) @ ICAO Conditions: 15 deg C, speed of sound (c)= 340.3 m/s
g7 drag profile plot cdref vs velocity fps
G7 Profile: Cdref vs Velocity (ft/s) @ ICAO Conditions: 59 deg F, speed of sound (c) = 1116.5 fps

The table used to generate these graphs looks like this:

table of g7 cdref values

If we look back to our example above, the velocity at t=0 was 900 m/s. If you look at the above table, you can see there is an entry for 888 m/s and 905 m/s. So how do we get the Cdref value for 900 m/s? Linear interpolation is a mathematical technique for this precise situation, it lets us approximate the correct value between two entries in a table.

Intuitively, it is quite easy to understand how the technique works. Given the example above, 900 m/s is in between 888 m/s and 905 m/s. What is the midpoint between 888 and 905?

We start by taking the difference of 905 and 888:

905 - 888 = 17

Divide this by two:

(905 - 888) / 2 = 8.5

Then add back the smaller number (888):

(905 - 888) / 2 + 888 = 896.5

The midpoint between the two numbers is 896.5.

Now let’s assume that the value for Cdref changes in a straight line over this small interval. We can find the Cdref at the midpoint:

  • Cdref @ 905 = 0.2615
  • Cdref @ 888 = 0.2643

(0.2615 - 0.2643) / 2 + 0.2643 = 0.2629

  • Cdref @ 896.5 = 0.2629

Since we know that 900 is in between 896.5 and 905, we also know that the Cdref @ 900 will be in between 0.2629 and 0.2615.

Linear interpolation works along this same principle. However, instead of taking the halfway point, it calculates exactly how far the value is in between the two outer values.

Imagine you have a number line:

velocity number line

The difference between 900 and 888 is 12.

900 - 888 = 12

The difference between 905 and 888 is 17.

905 - 888 = 17

If we take a ratio of these numbers, we can see that 900 is 0.71 or 71% of the way between 888 and 905.

12 / 17 = 0.71 = 71%

Now we need to find the corresponding Cdref value that is 71% of the way in between 0.2643 and 0.2615.

Cdref number line

We can work in reverse using simple algebra (x is a placeholder variable):

cdref@900 - 0.2643 = x

0.2615 - 0.2643 = -0.0028

x / -0.0028  = 0.71

x = 0.71 * -0.0028

x = -0.001988

cdref@900 - 0.2643 = -0.001988

cdref@900 = -0.001988 + 0.2643

cdref@900 = 0.2623

Now instead of doing this math piece by piece, we can summarize it all into one equation:

(v - v1) / (v2 - v1) = ratio

(Cdref - Cdref1) / (Cdref2 - Cdref1) = ratio

  • v: velocity for which we want Cdref

  • v1: velocity of lower bound

  • v2: velocity of upper bound

  • Cdref: Cdref we are solving for

  • Cdref1: Cdref @ v1

  • Cdref2: Cdref @ v2

Since the ratio is the same across both equations, we can set them equal to each other:

(v - v1) / (v2 - v1) = (Cdref - Cdref1) / (Cdref2 - Cdref1)

Now we need to rearrange the equation to get Cdref:

(Cdref - Cdref1) = (v - v1) / (v2 - v1) * (Cdref2 - Cdref1)

Cdref = (v - v1) / (v2 - v1) * (Cdref2 - Cdref1) + Cdref1

If you are a visual learner, here is an illustration of the process:

Linear interpolation visual

Lets double check we get the same answer:

Cdref = (v - v1) / (v2 - v1) * (Cdref2 - Cdref1) + Cdref1

Cdref = (900 - 888) / (905 - 888) * (0.2615 - 0.2643) + 0.2643

Cdref = (12 / 17) * (-0.0028) + 0.02643

Cdref = -0.001988 + 0.02643

Cdref = 0.2623

That is the essence of linear interpolation, and with this technique we can get a value for Cdref at any velocity as long as there is a value above and below it in the table.

IMPORTANT: This technique only works when the distance between data points is small. For example, if you tried to linearly interpolate the Cdref @ 500m/s between the velocities of 100 m/s and 1000 m/s, you will not get an accurate result. Linear interpolation works on the assumption that the data between two points would fall on a straight line if you connected them. In the case of our table above, the velocities are roughly 20m/s apart which is sufficiently accurate for our purposes.

Next article: Calculating Trajectory: Installation and Configuration of Python and VSCode