Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Anyone knows a swift way to do double interpolation? 6

Status
Not open for further replies.

IJR

Structural
Dec 23, 2000
774
I usually have to find a value between two curves(if we think graphically)

so I have 3 columns: one for x-axis, one for y1 and one for y2

Havent reserched yet and forgive me if this one is not worth your attention.

Anyone wants to share his/her ideas

Respects

IJR
 
Replies continue below

Recommended for you

Are the two curves in 3-Space and are you looking for a third surface at some proportional distance from the two original surfaces, ie. on the normal line between the two curves?

Each curve will have it's own normal line to the other (I think), so you'll have to start by assuming one curve is 'master'.

Will have to sit down and 'scratch' some sketches (and head) to determine the equation for a normal to a surface...
 
Thanks dik for the fast response and comments

But I am not into 3D surfaces. The two curves are plane curves as I described above

I mean y1=f1(x) and y2=f2(x) as is usual in most engineering applications, stuff like you have some pipe diameters along x-axis and one curve for larger storage tank discharge, the other for lesser capacity storage tank discharge both of which are functions of pipe diameter but differ in their discharges only as related to material friction coefficients, to cite a simple example and you are looking for discharge given a pipe diameter and a given size of storage tank in between the two curves.


Thanks
IJR
 
To me it looks like finding the root of a function:

Z(x) = 0,

where Z(x) = f1(x) - f2(x)

My approach in a spreadsheet would be:

Select an interval [x1 , x2] where you have a positive and a negative value of Z(x)

Z(x1) * Z(x2) < 0

Narrow your interval until Z(x) = 0 or sufficient small.

There are some other methods but I never used them in spreadsheets, just plain programming in pascal or fortran, but it must be possible. Check out a good book about numerical methods.

Regards Steven van Els
SAvanEls@cq-link.sr
 
Thanks Svanels

I am sure that your method will work and I am sure I can do Lagrange interpolation, but I was looking out for something &quot;swift&quot; and was expecting some combination of built in functions in Excel

Respects
IJR
 
Your problem is perhaps not very well posed.
I'll try an interpretation hoping it is the correct one.
You have in fact not 2 functions of the same variable, but a single function of 2 variables, x (the diameter in your example) and y (the tank capacity).
Now say you have two values for x (x0 and x1) and two values for y (y0 and y1), and you know 4 values of your function (the discharge rate in your example):
f00=f(x0,y0)
f01=f(x0,y1)
f10=f(x1,y0)
f11=f(x1,y1)
Your problem should be how to interpolate a value of f for any given values of x between x0 and x1 and of y between y0 and y1.
The interpolation cannot be fully linear in this case (unlike for a single variable) and different interpolation formulae may be used.
The 'flattest' one is as follows:
f=f00+(x-x0)(f10-f00)/(x1-x0)+(y-y0)(f01-f00)/(y1-y0)+(x-x0)(y-y0)(f11+f00-f10-f01)/((x1-x0)(y1-y0))


prex
motori@xcalcs.com
Online tools for structural design
 
Yes prex you got me right.

And thanks for the formula. That flatness is good enough for now.

Respects
 
On a few occasions I needed to do double interpolation and it could be done by using LOOKUP functions or by creating your own function in VBA. The attached file contains the function INTERPOLATE performing double interpolation and INTERPOLATE1 for single interpolation. Explanations and examples inside the file. Oops! I cannot attach the file, so I will place it at The file name is doubleinterpol.xls.

Hope it helps!

Yakov
 
You done it Yakov 4928 49(100+28/49). Good interpolation man. I have downloaded the stuff. Do you put other stuff there. If yes, let us know.

Respects
IJR
 
Thanks for compliments, IJR. The site where I place the spreadsheets I might place some utilities spreadsheets like 'interpolation' some time soon.

Yakov
 
By the way 4928 I am very serious in my every single compliments. If I were rich I would have invited all of you guys to my house for some high status party man.

Keep the touch.
IJR
 
I have a need to perform quite a bit of table lookup/interpolation, and struggled alot with the single interpolation functions in EXCEL. I finally found a shareware EXCEL add-in at the following link. It's cheap, and it works well for double interpolation:




Rob
 
staudro

I have downloaded the file. There seems to be a small problem. The function wizard shows me correct interpolated value, but the target cell is always filled with a zero. In other words, I can not get the result displayed in a cell
Do you know why?

By the way,yakov's spreadsheet also works pretty well though not as flexible as yours

Thanks all of you guys

regards
IJR
 
there is a program called MathModeler at that lets you reduce all the curves on the graph to one equation, which then eliminates need to interpolate, just calculate directly. Just enter several points from all the curves (the more points entered, the more accurate the equation). For instance, you have x versus y with several curves, say each repesents the data at a different temperature. You would enter into a spreadsheet y (as the dependent variable), x as an independent variable, and the temperature as an independent variable. Then it will give you an equation for y as a function of x and temp.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor