1
$\begingroup$

Hey geniuses out there!

Definitely got a brain teaser here (for me anyway!).

I need some help. I'm developing some calculation software that needs to match all calculation results with an existing software (which was created by the people who created the calculation procedure for this software).

There is a lot of Linear Interpolation and I match what they get in all instances, however there is this one particular case where I can't seem to find what they're doing differently.

I'm using a very straight-forward formula which matches all instances of interpolation, except in one area, the method I'm using is:

((x - x0) × (y1 - y0) ÷ (x1 - x0)) + y0

I am then able to get the value of y.

HOWEVER

In this one particular instance with a dataset I can't seem to find out the method they're using for interpolation to find y.

Take the following dataset for example, in brackets I've added what they represent - although not important it may help somewhat:

x (PSR) = 2.116029176481704

x0 (PSR) = 2
x1 (PSR) = 3

y0 (efficiency) = 78.6
y1 (efficiency) = 71.5

y = 77.7761928469799 = ((x - x0) × (y1 - y0) ÷ (x1 - x0)) + y0

With the above data by using standard Linear Interpolation I get 77.7761928469799, however - the method they're using gets them (to 4DP) 77.7047

There is a note against this specific case of Linear Interpolation but it's too vague for me to understand what they're doing differently.

The note says:

For the efficiency values, the interpolated efficiency is the reciprocal of linear interpolation between the reciprocals of the efficiencies.

Unfortunately I have no idea what that means in regards to how I'm to go about this Linear Interpolation any differently.

I know there are some brilliant minds on here and I hope you can help me out by giving me some insight as to how they use Linear Interpolation using that dataset to get 77.7047.

Thank you so much to anybody who helps! :)

$\endgroup$
  • $\begingroup$ The reason I'm sure they're using the standard method of interpolation is I had to use Linear Interpolation to get the value of x, which matches theirs perfectly. The key I think is in this comment in the calculation procedure document "For the efficiency values, the interpolated efficiency is the reciprocal of linear interpolation between the reciprocals of the efficiencies." :) $\endgroup$ – ArtisanC Oct 20 '17 at 14:01
  • 3
    $\begingroup$ The note seems pretty clear. The reciprocal of a number x means 1/x. So use 1/y_0 and 1/y1 instead of y0 and y1, then look at 1/y. $\endgroup$ – Dap Oct 20 '17 at 14:01
  • $\begingroup$ @Dap Thanks, if you've managed to get the number they've got can you please provide me with an updated version of my formula (in the format I've written it) so my small brain can understand? I'm not totally familiar with the lingo in the note! :) $\endgroup$ – ArtisanC Oct 20 '17 at 14:03
  • $\begingroup$ @Dap you absolute genius, I've got it!! I had no idea what a reciprocal was and when I was researching it I was researching them being use with interpolation and it made little sense to me, I did a simple Google on reciprocal and I've got the answer, you're so awesome - thank you all for your help!! :) $\endgroup$ – ArtisanC Oct 20 '17 at 14:12
1
$\begingroup$

Got it guys, thank you so much for the help - especially you Dap for giving me the hint I need, the note is clear with the knowledge of what a reciprocal is, the formula I needed was:

function linearInterpolation(x, x0, y0, x1, y1)
{
  return ((x - x0) * (y1 - y0) / (x1 - x0)) + y0;
}

Then I can do:

1 / linearInterpolation(2.116029176481704, 2, 1 / 78.6, 3, 1 / 71.5)

You guys are the best, thank you SOOO much!!!! :)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.