Is it possible to interpolate between two polynomials?

  • Thread starter Thread starter GB_Joe
  • Start date Start date
  • Tags Tags
    Polynomials
AI Thread Summary
Interpolating between two polynomials can be achieved through various methods, but the challenge lies in ensuring the resulting polynomial maintains the desired characteristics, particularly when both original polynomials approach zero at their maximum limit. The discussion highlights the importance of choosing the correct axis for interpolation, with equal divisions along the x-axis being preferable for practical applications, such as modeling performance curves for variable-pitch fans. Joe's initial attempts at interpolation through coefficient manipulation yielded incorrect results, prompting a reevaluation of the approach. Ultimately, a method involving inverting equations to calculate flow for a given pressure proved effective, allowing for accurate interpolation. The conversation underscores the necessity of understanding the physical context when applying mathematical techniques for interpolation.
GB_Joe
Messages
5
Reaction score
0
Hi everyone! Having spent many fruitless hours Googling this I stumbled upon this forum, and am hoping you may be able to help...

I'm looking for a way to interpolate between two polynomials. These two lines are related and run along in a near-parallel fashion, and I want to divide the gap between them into 5 equal parts. I can do it by creating a table of values, but really I want to be able to create an equation directly. Simply dividing up the difference between the coefficients produces something which looks close to what I want (it's a similar shape and lies between the original two lines), but is clearly wrong.

Am I making sense?!? Does anyone have any ideas, or do I need to provide more detail? Am I even in the right forum?

Cheers,
Joe.
 
Mathematics news on Phys.org
GB_Joe said:
Hi everyone! Having spent many fruitless hours Googling this I stumbled upon this forum, and am hoping you may be able to help...

I'm looking for a way to interpolate between two polynomials. These two lines are related and run along in a near-parallel fashion, and I want to divide the gap between them into 5 equal parts. I can do it by creating a table of values, but really I want to be able to create an equation directly. Simply dividing up the difference between the coefficients produces something which looks close to what I want (it's a similar shape and lies between the original two lines), but is clearly wrong.

Am I making sense?!? Does anyone have any ideas, or do I need to provide more detail? Am I even in the right forum?

Cheers,
Joe.
Using the divided difference produced a polynomial similar to what you want, but you say it is clearly wrong. You need to elaborate, i.e. why is it wrong?
 
Okay!

My two starting polynomials both go to f(x) = 0 at the maximum limit of x. My attempts at interpolation all go down well below 0.

I've attached a couple of pics to make it easier to understand. The first shows simple interpolation of values, all nice and neat, just what you'd expect. The second is done by interpolating the coefficients. This shows it pretty clearly - they're not a million miles away, but they're obviously not right.

Incidentally, there's no convergence between the two methods at the top end, although it's not so obvious from the pics. You can see it if you flick between them.

I guess I'm surprised that the error is greatest at f(x)=0... but I'm coming at this from a very non-scientific angle, and I clearly don't know what I'm doing!

Cheers, and thanks for replying,
Joe.
 

Attachments

  • interpolate1.png
    interpolate1.png
    7.2 KB · Views: 799
  • interpolate2.png
    interpolate2.png
    8 KB · Views: 776
I couldn't access your attachments.
 
Just as there are many different ways to interpolate between two numbers, there are many different ways to interpolate functions.

Typically, what we do is talk about a "homotopy" which is a function, \phi(x, t), with t between and 1, continuous in both variables, such that \phi(x,0)= f_0(x) and \phi(x, 1)= f_1(x).
 
Last edited by a moderator:
I don't know if you're still here Joe, but now that those attachments are visible it is clear that the one you're doing manually (blue) is dividing the intervals along the "x" axis while the one you're doing via the coefficients (red) is (as expected) dividing the intervals along the "y" axis.

Can you explain why one (equal divisions along x axis) is preferable to the other (equal divisions along y axis)?
 
@ uart:

I am still here! Sorry, I'm a part-timer, looking after the kids Weds. and Thurs. so try to avoid thinking about work then!

Now that you've said it, it's obvious... thank you! The reason that one is right is that division across the x-axis is what you get by experiment. These are performance curves for variable-pitch fans, Volume Flow along the x-axis and Static Pressure along y. We have pretty much infinite combinations we can set them to, so we can't test everything, and I need a way to manipulate the equations rather than data values.

Is it even possible to interpolate along x in this way?

@ HallsofIvy:

:rolleyes:
That, my friend, is going to need a whole lot of unpacking... it's been a looooong time since I did any real maths, and I was rubbish even then...! Please don't be concerned about patronising me, start off by assuming I'm an idiot, I won't take offence!

Thanks to all for your help so far!
Joe.
 
Last edited:
Okay then...

I think I may have figured this out, but it's pretty long-winded. Do you think there's a simpler way to do this?

If we say the lower curve is "15" and the upper is "20", the interpolated ones are 16...19.

So, x_{16} = (4x_{15}+x_{20})/5

and f(x_{16})=(4f(x_{15})+f(x_{20}))/5

and so on.

Well, it doesn't look so bad when you write it out like that... and computers are good at this calculation stuff, aren't they?!?

Joe.
 
GB_Joe said:
Okay then...

I think I may have figured this out, but it's pretty long-winded. Do you think there's a simpler way to do this?

If we say the lower curve is "15" and the upper is "20", the interpolated ones are 16...19.

So, x_{16} = (4x_{15}+x_{20})/5

and f(x_{16})=(4f(x_{15})+f(x_{20}))/5

and so on.

Well, it doesn't look so bad when you write it out like that... and computers are good at this calculation stuff, aren't they?!?

Joe.

No that will ultimately just get you the red curve again.

If you're sure that the blue curve is the one that has the correct physical meaning for your application then there's really no other way than inverting your equations (either algebraically or numerically), so that you can calculate Flow for a given Pressure rather than the other way around.

Like this for example.

- For a given Pressure find Flow_15 and Flow_20.

- Now form Flow_16 = 0.8 Flow_15 + 0.2 Flow20 and so on.

These are your new x values all corresponding to the same value of y (as in "for a given pressure" in the first step). You have to repeat this for each different pressure level that you wish to plot.
 
  • #10
No that will ultimately just get you the red curve again.

Well... it didn't!:confused:

I've ended up with identical data values to when I produced the blue curves.

Initially I did get the same as the red curves, but I was using values of x_{16} in the second equation instead of x_{15} and x_{20}.

I don't trust my maths enough to do this kind of thing theoretically, which is why I always end up producing curves and stuff, but it seems to have done the trick!
 

Similar threads

Back
Top