Interpolating multivariable functions

1.5k Views Asked by At

Assume I have two functions, $f_1$ and $f_2$, that both depend on $x$ and $y$, so that $f_1(x,y)$ and $f_2(x,y)$.

I don't know the exact functions, but know values of each function at some points (actually, any points I want).

So, for example, let's say that:

at $x=+1$ and $y=-1$, $$f_1=+9,$$ $$f_2=+7,$$

at $x=-1$ and $y=+1$, $$f_1=-2,$$ $$f_2=-6,$$

at $x=+1$ and $y=+1,$ $$f_1=+11,$$ $$f_2=+9.$$

at $x=-1$ and $y=-1,$ $$f_1=-7,$$ $$f_2=-8.$$

I need to find the values for $x$ and $y$ where both functions equal $0$.

If each function only depended on one variable a linear interpolation would suffice. But as both functions depend on $2$ variables I'm getting a bit confused.

I've been searching on bilinear and trilinear interpolation, but I can't really pinpoint what I actually need to use.

Thank you all.

2

There are 2 best solutions below

1
On BEST ANSWER

How about this way? Suppose the function can be approximated by a polynomial of degree 1, that is, $$f_1(x, y) = c_{00} + c_{10}x + c_{01}y$$ for some constants $c_{00}$, $c_{10}$, and $c_{01}$. From the first three conditions, we have $$ \begin{bmatrix} 1 & 1 & -1 \\ 1 & -1 & 1 \\ 1 & 1 & 1 \end{bmatrix} \begin{bmatrix} c_{00} \\ c_{10} \\ c_{01} \end{bmatrix} = \begin{bmatrix} f_1(1, -1) \\ f_1(-1, 1) \\ f_1(1, 1) \end{bmatrix} = \begin{bmatrix} 9 \\ -2 \\ 11 \end{bmatrix} $$ and its solution is $c_{00} = 7/2$, $c_{10} = 13/2$, and $c_{01} = 1$. Hence $$ f_1(x, y) \approx \frac{7}{2} + \frac{13}{2}x + y. $$ Do it again for $f_2$ and we get $$ f_2(x, y) \approx \frac{1}{2} + \frac{15}{2}x + y. $$ Lastly, solving $$\begin{cases} f_1(x, y) = 0 \\ f_2(x, y) = 0 \end{cases}$$ gives you $x = 3$ and $y = -23$.

If you would like to get more accurate approximation, try to do this by polynomial with higher degree.

0
On

Just another try. Since it seems, the coordinates are of a plane,I interpret them as complex values. Then from the four given arguments and the four resulting values I do an ordinary polynomial interpolation procedure. This gives the complex polynomial: $$ \operatorname{ cofu } (z)= (-25/16 - 37/16 I) z^3 + 3/8 I z^2 + (33/8 + 23/8 I) z + (11/4 + 1/2 I) $$ This gives then, for instance, $$ \operatorname{cofu}(1-1 I) = 9 + 7I $$ One can plot this using mathematica, getting a rough impression - don't find the best command-parameters,though...

Then one can use a complex root-finder, as for instance in Pari/GP (or again in Wolfram-mathematica). We get using Pari/GP: $$ \operatorname{polroots}(\operatorname{cofu}(z)) = \\ [1.57353592868 - 0.292970871914 I, \\ -0.931132188421 - 0.0424173327510 I, \\ -0.531069738252 + 0.410613881696 I] $$