0

suppose i have (x1,x2) plane which is a subset of R^2 and i consider certain intervals (x1,x2), i1=[-100,100] on x1, i2=[-100,100] on x2. i want to grid this in both x1 and x2, with some step size say h=0.01 and interpolate for all x in R^2 using the grid points, and i have a known function:

phi(x1,x2)=k1*x1+k2*x2 

where values of k1 and k2 are known. The interpolation i want to use is enter image description here and find the error ||phi(x1,x2)-M_{h,D}phi(x)||

How would i grid the x1-x2 plane ? and how to use the interpolation formula there ? Any help ?

Zeno San
  • 111
  • 4
  • 1
    I'm not quite sure how the interpolation formula is supposed to be used, i.e. how M_{h,D}phi(x) is computed, and whether it requires the gridded values of phi(x1,x2), so I won't submit a full answer. However, to grid the data, you can let x1 range over rows (dimension 2) and x2 range over columns (dimension 1). Then: `x1 = (-100:h:100); x2=(-100:h:100)'; phi = k1*x1 + k2*x2;` For versions <=R2016a, you will need to add `[x1, x2] = meshgrid(x1, x2);` before computing phi. – Michael Mar 09 '20 at 01:49
  • @Michael Thank you, ```D=1; h=0.1;D1 = -100;D2 = 100;X = D1 : h : D2;Y = D1 : h : D2;[x1, x2] = meshgrid(X, Y);k1=2; k2=2;phi = k1.*x1 + k2.*x2; figure(1) surf(X,Y,phi)``` This gives me the surface over which i interpolate, by how do i calculate the sum M, for this case phi is from R^2 to R takes x1 and x2 , and m is in Z^{2}. I don't know how to make the summation over m, any idea ? – Zeno San Mar 10 '20 at 07:11
  • My point from the earlier comment is that I'm not sure how to interpret the equation you wrote for M. You say phi = phi(x1, x2), but inside the definition of M, phi is treated as a function of a single variable. For starters, I don't know the the meaning of the other symbols, i.e. D. – Michael Mar 12 '20 at 04:24
  • @Michael sorry, that was for single variable case, i've edited the question – Zeno San Mar 12 '20 at 04:40

0 Answers0