MA 5324 Problem 6.1

Shepard's method in 2D

Contents

for compactly supported RBFs

s = 2; f = @(x) 4^s*prod(x.*(1-x),2);
% rbf = @(r) max(spones(r)-r,0).^4.*(4*r+spones(r));
rbf = @(r) max(spones(r)-r,0).^6.*(35*r.^2+18*r+3*spones(r))/3;
k = 7; N = (2^k+1)^s;
ep = 3; %(2^k+1)/2;
ep = (2^k+1)/2;
[X,N] = points(N,s,'u');
fX = f(X);
M = 16^s; [Xe,M] = points(M,s,'u');
E = rbf(ep*sdistm(Xe,X,1/ep));
E = spdiags(1./(E*ones(N,1)),0,M,M)*E;
Pf = E*fX;
[XXe,YYe] = meshgrid(linspace(0,1,sqrt(M)));
surf(XXe,YYe,reshape(Pf,sqrt(M),sqrt(M))); shading interp
norm(Pf-f(Xe))/M
ans =

   6.2255e-05