Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multivariate polynomial interpolation

Status
Not open for further replies.

Frankpendegrass

Programmer
Jun 25, 2009
3
GB
I have tables of data stored as text files. There are four variables, a, b, c and d, which eventually produce a thermodynamic property, e. Thus, z = fn(a,b,c,d,e). The text files that contain the data are arranged in columns with headers.
Problem is, interpolation; so far, i've been using linear interpol but the accuracy isn't good enaff. I have to do quadratic interpolation in all four dimensions (to obtain 'e') to increase the accuracy.

So far, I have tried defining the polynomial equation (from which I will get the matrix co-efficients (alphas)) as,

z(i) = alpha1*a*b + alpha2*a*c + alpha3*a*d + alpha4*b*c + alpha5*b*d + alpha6*c*d + alpha7*asquared + alpha8*bsquared + alpha9*csquared + alpha10*dsquared + alpha11*a + alpha12*b + alpha13*c + alpha14*d + alpha15

Where alpha15 is the constant.

I did it this way coz it's meant to be quadratic.

Question; am I right ?

Thanks in advance.
 
It's hard to say whether you're right, because I don't know the physics behind your problem.

Nevertheless, if you know it ought to be quadratic, maybe you can use Taylor approximations of more than one dimension (you can find them in the better math books and maybe on the net as well) in which you approximate the derivative terms by the appropiate finite differences (this may be harder to find, you can also construct them yourself adding and substracting discrete Taylors).

If you use the finite differences, be careful if your matrix is not equidistant in all your variables, in that case you can't use the standard formulae.

If you happen to have control over which points will be available as known data, you might as well construct a Chebyshev grid (see literature). The Chebyshev polynomial interpolation will probably give you a better interpolation quality with less numerical damping.

Interpolation in more than one dimension and with a higher than linear degree is far from straight forward. I'd rather refine the grid data so I can use linear interpolation in some hyperplane.

Hope this helps a bit. After all your question is not about fortran, it's a bit beyond the scope of this forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top