View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
vezerid
 
Posts: n/a
Default Interpolate from a table?

I have imported your data and plotted it to see what function they fit
to nicely. It seems that the best match is the quadratic that goes
through 0, i.e. f(x)=ax^2+bx, where x is the angle. The problem is that
a and b change with H/W, therefore we will assume a linear change of
both a and b with H/W. We thus seek to find another function:

f(x,y)=(ay+b)x^2+(cy+d)x, where x is angle and y is H/W.

We will use the Solver to find a, b, c and d with the Least Squares
method.

Use four cells, say A12:D12 to hold a, b, c and d. Initially you can
set them to 0.

Copy the entire data set to the right. Start from I1. Erase the values
and enter the following formula in place of the first 0.08 of the
copied data:

=($A$12*I$1+$B$12)*$H3^2+($C$12*I$1+$D$12)*$H3

Copy over the previously copied data.

In yet another area of the same dimensions, use a formula to calculate
the square error between your data and the estimated function:

=(B3-I3)^2

Copy this accross and down as far as the data area. Then produce the
sum of all these cells in yet another cell, say, M18. Now issue the
Solver:

Tools|Solver (if it does not appear in Tools menu, first Tools|Add
Ins... and choose SOlver Add in).

Set target cell: M18
By Changing cells: A12:D12
Solve

When you solve, A12:D12 will get the values of the above expression. In
my run they produced the following:

f(Angle, HW) =
(-0.0000199600635287658*HW+0.00014782591576092)*Angl e^2+(0.000025289182495776*HW+0.00153502941872466)* Angle

Now, by supplying whatever values you want for Angle and H?W you can
get the interpolated value.

Does this help?

Kostis Vezerides