Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: interpolating f(x,y) from evaluation

  • To: mathgroup at
  • Subject: [mg8652] Re: [mg8599] interpolating f(x,y) from evaluation
  • From: Allan Hayes <hay at>
  • Date: Fri, 12 Sep 1997 04:11:05 -0400
  • Sender: owner-wri-mathgroup at

"K. Nikolaj Berntsen" <knb at>
[mg8599] interpolating f(x,y) from evaluation


> I want to generate an interpolatingfunction-like object for a
> complicated function of several variables ....
> I tried:
> Interpolation[Table[{f[i,j].i.j},{i,3},{j,3}]]
> but it did not work.


I may not be understanding your quastion but

1. the dots in f[i,j].i.j seem odd.

2. assuming that you want to interpolate data giving values f[i,j]
at i,j with i and j ranging over 1 to 3 then you need to supply the
data in the form
        {{1,1,f[1,1]},{1,2,f[1,2]}, ..}
(the order of main list is unimportant, {{1,2,f[1,2]},{1,1,f[1,1]},
        {{1,1,f[1,1]},{1,2,f[1,2]}, ..}
(the order of main list is unimportant, {{1,2,f[1,2]},{1,1,f[1,1]},
..} will do  just as well)

However with Table  get

In[1]:= Table[{i,j,f[i,j]},{i,3},{j,3}]


which is not of form expected. We need to remove some of the brackets.

In[2]:= data = Flatten[%,1]  (* the 1 stops the flattening at level 1*)


Now define f.

In[3]:= f[i_,j_]:= i-j

The values of f are now numeric.

In[4]:= data


Do the interpolation

In[5]:= intf = Interpolation[data]
    "Requested order is too high; order has been reduced to {2,2}."


The message simply says that with only 3 data points each way, it
cannot do an order {3,3} interpolation (the default), and has
instead done an order {2,2} one (you can set this order via the
option InterpolationOrder).

The intf works as expected

You can find information online via the help browser: menu Help/Help

Allan Hayes
hay at
voice:+44 (0)116 2714198
fax: +44 (0)116 2718642
Leicester,  UK

  • Prev by Date: Re: Re: programing: reduce list to cycle
  • Next by Date: "mesh" question
  • Previous by thread: Re: interpolating f(x,y) from evaluation
  • Next by thread: Re: interpolating f(x,y) from evaluation