Re: ListInterpolation
- To: mathgroup at smc.vnet.net
- Subject: [mg58342] Re: ListInterpolation
- From: "Valeri Astanoff" <astanoff at yahoo.fr>
- Date: Tue, 28 Jun 2005 21:56:41 -0400 (EDT)
- References: <d9r4tv$55q$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Stephane, In your example, seems to me that if there are 4 occcurrences of x and 2 of y, then the data should be a {4,2} list (which is not the case, so your data have to be transposed). If I was you, in such a case of explicit values of the variables, I would first "regularize" the data to get an evenly spaced grid, before using ListInterpolation. An example of what you could do : In[1]:=data1={{1, 1.3, 2.5, 5},{1, 2, 3, 4}}//Transpose Out[1]={{1,1},{1.3,2},{2.5,3},{5,4}} In[2]:=data2={{1, 1.3, 2.5, 5},{5, 6, 7, 8}}//Transpose Out[2]={{1,5},{1.3,6},{2.5,7},{5,8}} In[3]:=f1=Interpolation[data1]; In[4]:=f2=Interpolation[data2]; In[5]:=gridData={Table[f1[x],{x,1,5,4/3}], Table[f2[x],{x,1,5,4/3}]}//Transpose Out[5]={{1.,5.},{3.05919,7.05919},{2.22269,6.22269},{4.,8.}} In[6]:=res = ListInterpolation[gridData, {{1, 5}, {0.5, 1.3}}] ; >From In[6]:= ListInterpolation::inhr:Requested order is too high; order has been reduced to {3, 1} In[7]:=res[1,0.5] Out[7]=1. In[8]:=res[5,1.3] Out[8]=8. In[9]:=res[2,1.1] Out[9]=6.03108 Valeri