Re: interpolation of a matrix function
- To: mathgroup at smc.vnet.net
- Subject: [mg72122] Re: interpolation of a matrix function
- From: dh <dh at metrohm.ch>
- Date: Wed, 13 Dec 2006 06:39:01 -0500 (EST)
- Organization: hispeed.ch
- References: <ele7at$rng$1@smc.vnet.net>
Hi Daniele, The principle is simple, we interpolate every matrixelement seperately, but we need some pretty complicated data juggling. To make it easier,we define some functions, that give us the independent and dependent variables: dat={ {1,{{4,3},{3,4}}}, {2,{{5,7},{2,3}}}, {2.3,{{8,5},{5,4}}}, {3,6,{{1,1},{5,6}}} } col[0] = dat[[All, 1]]; col[i_, j_] := dat[[All, 2, i, j]]; WIth this we feed the Interpolationfunction. With the result we define a new function that returns the interpolated matrix: matfun = Evaluate[Table[Interpolation[Transpose[{col[0], col[i, j]}]][#], {i, 1, 2}, {j, 1, 2}]] & matfun[1] yields {{4., 3.}, {3., 4.}} and matfun[1.5] yields:{{1.49704, 7.85503}, {-0.747041, 2.32396}} Daniel Jepessen wrote: > Hi to all. > > My problem is the following: I' have a list, in which elements are in > this form > > {a, {{m11,m12},{m21,m22}}}, > > So, an example list can be this: > > { > {1,{{4,3},{3,4}}}, > {2,{{5,7},{2,3}}}, > {2.3,{{8,5},{5,4}}}, > {3,6,{{1,1},{5,6}}} > } > > In other words, I've a list of matrices, that depend on parameter 'a'. > > I'd like to create ad interpolating function that interpolate the > entire matrix, and if I write > > interpolatedMatrix[parameter] > > it gives me a matrix formed by the interpolation of matrices of that > list, depending of a parameter. > > What's the better way to do this? > > Thanks for replies > > Daniele >