## Anyone knows a swift way to do double interpolation?

## Anyone knows a swift way to do double interpolation?

(OP)

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

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

## RE: Anyone knows a swift way to do double interpolation?

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...

## RE: Anyone knows a swift way to do double interpolation?

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

## RE: Anyone knows a swift way to do double interpolation?

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

## RE: Anyone knows a swift way to do double interpolation?

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

Respects

IJR

## RE: Anyone knows a swift way to do double interpolation?

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

http://www.xcalcs.com

Online tools for structural design

## RE: Anyone knows a swift way to do double interpolation?

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

Respects

## RE: Anyone knows a swift way to do double interpolation?

Hope it helps!

Yakov

## RE: Anyone knows a swift way to do double interpolation?

Respects

IJR

## RE: Anyone knows a swift way to do double interpolation?

Yakov

## RE: Anyone knows a swift way to do double interpolation?

Keep the touch.

IJR

## RE: Anyone knows a swift way to do double interpolation?

http://home.earthlink.net/~fcernst/

Rob

## RE: Anyone knows a swift way to do double interpolation?

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

## RE: Anyone knows a swift way to do double interpolation?