Fasshauer 2008 Lecture4
Fasshauer 2008 Lecture4
Fasshauer 2008 Lecture4
Greg Fasshauer
Lu = f in Ω
u = g on Γ = ∂Ω
Lu = f in Ω
u = g on Γ = ∂Ω
" #
A
eL
If invertible (open problem since 1986), then approximate
A
e
solution (at any point x) found by inserting λ in basis expansion, i.e.,
u(x) = ΦT (x)λ
" #
A
eL
If invertible (open problem since 1986), then approximate
A
e
solution (at any point x) found by inserting λ in basis expansion, i.e.,
u(x) = ΦT (x)λ
with " #
e L A−1 Ae L A−1
A I B M P
LΓ = e −1 e −1 = ,
AA I AA B
0 I
Program (KansaLaplaceMixedBCTref_2D.m)
global rbf Lrbf; rbf_definition; epsilon = 3;
N = 289; M = 1681;
Lu = @(x,y) zeros(size(x));
[collpts, N] = CreatePoints(N, 2, ’u’); collpts = 2*collpts-1;
indx = find(abs(collpts(:,1))==1 | abs(collpts(:,2))==1);
bdypts = collpts(indx,:);
intpts = collpts(setdiff([1:N],indx),:);
ctrs = [intpts; bdypts];
evalpts = CreatePoints(M,2,’u’); evalpts = 2*evalpts-1;
DM_eval = DistanceMatrix(evalpts,ctrs);
EM = rbf(epsilon,DM_eval);
DM_int = DistanceMatrix(intpts,ctrs);
DM_bdy = DistanceMatrix(bdypts,ctrs);
LCM = Lrbf(epsilon,DM_int);
BCM = rbf(epsilon,DM_bdy);
CM = [LCM; BCM];
rhs = zeros(N,1); NI = size(intpts,1);
indx = find(bdypts(:,1)==1 | (bdypts(:,1)<0) & (bdypts(:,2)==1));
rhs(NI+indx) = (bdypts(indx,1)==1)*0.2.*sin(3*pi*bdypts(indx,2)) + ...
(bdypts(indx,1)<0).*(bdypts(indx,2)==1).*sin(pi*bdypts(indx,1)).^4;
Pf = EM * (CM\rhs);
disp(sprintf(’u(0,0) = %16.12f’,Pf(841)))
We just showed that we always have (even if the Kansa matrix is not
invertible) " #
A
eL −1 M P
LΓ = A =
A
e 0 I
We just showed that we always have (even if the Kansa matrix is not
invertible) " #
A
eL −1 M P
LΓ = A =
A
e 0 I
It is known that
LΓ is invertible for polynomial basis (1D)
In a certain limiting case RBF interpolant yields polynomial
interpolant
We just showed that we always have (even if the Kansa matrix is not
invertible) " #
A
eL −1 M P
LΓ = A =
A
e 0 I
It is known that
LΓ is invertible for polynomial basis (1D)
In a certain limiting case RBF interpolant yields polynomial
interpolant
We just showed that we always have (even if the Kansa matrix is not
invertible) " #
A
eL −1 M P
LΓ = A =
A
e 0 I
It is known that
LΓ is invertible for polynomial basis (1D)
In a certain limiting case RBF interpolant yields polynomial
interpolant
ut + Lu = f
ut + Lu = f
Then
uk (x) ≈ uk −1 (x) + ∆t [f (x) − Luk −1 (x)]
Start with
N
X
u(x, t) = λj (t)Φj (x) = ΦT (x)λ(t)
j=1
Start with
N
X
u(x, t) = λj (t)Φj (x) = ΦT (x)λ(t)
j=1
Start with
N
X
u(x, t) = λj (t)Φj (x) = ΦT (x)λ(t)
j=1
or h i
ΦT (x)λ(k ) = ΦT (x) − ∆tLΦT (x) λ(k −1) + ∆tf (x)
Collocation on X = {x 1 , . . . , x N } yields
Collocation on X = {x 1 , . . . , x N } yields
Collocation on X = {x 1 , . . . , x N } yields
u (k ) = Aλ(k ) , Aij = Φj (x i )
Collocation on X = {x 1 , . . . , x N } yields
u (k ) = Aλ(k ) , Aij = Φj (x i )
u 0 = Du
u 0 = Du
Example
Chebyshev polynomials on Chebyshev points. In this case explicit
formulas for entries of D are known.
N N
X
0
X d
u(x) = λj Φj (x) =⇒ u (x) = λj Φj (x).
dx
j=1 j=1
N N
X
0
X d
u(x) = λj Φj (x) =⇒ u (x) = λj Φj (x).
dx
j=1 j=1
and
d
u 0 = Ax λ with Ax,ij = Φj (xi ).
dx
N N
X
0
X d
u(x) = λj Φj (x) =⇒ u (x) = λj Φj (x).
dx
j=1 j=1
and
d
u 0 = Ax λ with Ax,ij = Φj (xi ).
dx
Therefore
u 0 = Ax A−1 u =⇒ D = Ax A−1 .
L = AL A−1
L = AL A−1
Lu = f
Discretize space
Lu ≈ Lu
Then (at grid points)
u = L−1 f
Lu = f
Discretize space
Lu ≈ Lu
Then (at grid points)
u = L−1 f
Challenge
Need to ensure invertibility of L
Discretize:
Lu = f =⇒ u = L−1 f = A (AL )−1 f
Invertibility of L (and therefore AL ) required.
Discretize:
Lu = f =⇒ u = L−1 f = A (AL )−1 f
Invertibility of L (and therefore AL ) required.
Discretize:
Lu = f =⇒ u = L−1 f = A (AL )−1 f
Invertibility of L (and therefore AL ) required.
Discretize:
Lu = f =⇒ u = L−1 f = A (AL )−1 f
Invertibility of L (and therefore AL ) required.
Remark
RBFs “too good to be true”. Built-in regularization due to variational
framework.
Lu = f in Ω
u=g on Γ = ∂Ω
Lu = f in Ω
u=g on Γ = ∂Ω
Here
M is NI × NI (interior points)
I is NB × NB (boundary points)
NB number of grid points on boundary Γ
NI = N − NB number of grid points in the interior Ω
Here
M is NI × NI (interior points)
I is NB × NB (boundary points)
NB number of grid points on boundary Γ
NI = N − NB number of grid points in the interior Ω
Then
f
u = L−1
Γ g
u Ω = M −1 (f − Pg),
u Ω = M −1 f .
u Ω = M −1 (f − Pg),
u Ω = M −1 f .
Remark
For standard PS methods the block M is invertible. Its spectrum is well
studied for many different L and BCs.
rectangular blocks
ÂL,ij = Lϕ(kx − x j k) x=x , i = 1, . . . , NI , j = NI + 1, . . . , N
i
Program (HermiteLaplaceMixedBCTref_2D.m)
global rbf Lrbf L2rbf; rbf_definition; epsilon = 3;
N = 289; M = 1681;
Lu = @(x,y) zeros(size(x));
[datasites, N] = CreatePoints(N, 2, ’u’); intdata = 2*datasites-1;
sg = sqrt(N); bdylin = linspace(-1,1,sg)’; bdy1 = ones(sg-1,1);
bdydata = [bdylin(1:end-1) -bdy1; bdy1 bdylin(1:end-1);...
flipud(bdylin(2:end)) bdy1; -bdy1 flipud(bdylin(2:end))];
h = 2/(sg-1); bdylin = (-1+h:h:1-h)’; bdy0 = repmat(-1-h,sg-2,1); bdy1 = repmat(1+h,sg-2,1);
bdycenters = [-1-h -1-h; bdylin bdy0; 1+h -1-h; bdy1 bdylin;...
1+h 1+h; flipud(bdylin) bdy1; -1-h 1+h; bdy0 flipud(bdylin)];
centers = [intdata; bdycenters];
evalpoints = CreatePoints(M, 2, ’u’); evalpoints = 2*evalpoints-1;
DM_inteval = DistanceMatrix(evalpoints,intdata);
DM_bdyeval = DistanceMatrix(evalpoints,bdycenters);
LEM = Lrbf(epsilon,DM_inteval);
BEM = rbf(epsilon,DM_bdyeval);
EM = [LEM BEM];
DM_IIdata = DistanceMatrix(intdata,intdata);
DM_IBdata = DistanceMatrix(intdata,bdycenters);
DM_BIdata = DistanceMatrix(bdydata,intdata);
DM_BBdata = DistanceMatrix(bdydata,bdycenters);
LLCM = L2rbf(epsilon,DM_IIdata);
LBCM = Lrbf(epsilon,DM_IBdata);
BLCM = Lrbf(epsilon,DM_BIdata);
BBCM = rbf(epsilon,DM_BBdata);
CM = [LLCM LBCM; BLCM BBCM];
rhs = [Lu(intdata(:,1),intdata(:,2)); zeros(sg-1,1); 0.2*sin(3*pi*bdydata(sg:2*sg-2,2)); ...
zeros((sg-1)/2,1); sin(pi*bdydata((5*sg-3)/2:3*sg-3,1)).^4; zeros(sg-1,1)];
Pf = EM * (CM\rhs);
disp(sprintf(’u(0,0) = %16.12f’,Pf(841)))
is invertible.
is invertible.
Entries of K T given by
Entries of K T given by
e T , and therefore
Symmetry of RBFs implies AL∗ = A L
" #T
T
h
eT
i A
eL
K = AL∗ A =
Ae
or h i−1
λ= AL∗ eT
A u.
Remark
Note that L̂ differs from
" #
ÂLL∗ ÂL h i−1
L̂Γ = AL∗ eT
A
ÂL∗ Â
Non-symmetric (Kansa):
Non-symmetric (Kansa):
" #
A
eL
Can formulate discrete differential operator LΓ = A−1
Ae
Non-symmetric (Kansa):
" #
A
eL
Can formulate discrete differential operator LΓ = A−1
Ae
Cannot ensure general invertibility of LΓ
Non-symmetric (Kansa):
" #
A
eL
Can formulate discrete differential operator LΓ = A−1
Ae
Cannot ensure general invertibility of LΓ
=⇒ OK for time-dependent PDEs
Non-symmetric (Kansa):
" #
A
eL
Can formulate discrete differential operator LΓ = A−1
Ae
Cannot ensure general invertibility of LΓ
=⇒ OK for time-dependent PDEs
Symmetric:
Non-symmetric (Kansa):
" #
A
eL
Can formulate discrete differential operator LΓ = A−1
Ae
Cannot ensure general invertibility of LΓ
=⇒ OK for time-dependent PDEs
Symmetric:
Can ensure general solution of Lu = f
Non-symmetric (Kansa):
" #
A
eL
Can formulate discrete differential operator LΓ = A−1
Ae
Cannot ensure general invertibility of LΓ
=⇒ OK for time-dependent PDEs
Symmetric:
Can ensure general solution of Lu = f
Cannot" in general formulate
# discrete differential operator
ÂLL∗ ÂL h i−1
L̂Γ = AL∗ A eT
ÂL∗ Â
Non-symmetric (Kansa):
" #
A
eL
Can formulate discrete differential operator LΓ = A−1
Ae
Cannot ensure general invertibility of LΓ
=⇒ OK for time-dependent PDEs
Symmetric:
Can ensure general solution of Lu = f
Cannot" in general formulate
# discrete differential operator
ÂLL∗ ÂL h i−1
L̂Γ = AL∗ A eT
ÂL∗ Â
=⇒ OK for time-independent PDEs
First-order Derivatives
The chain rule says
∂ xj d
ϕ(kxk) = ϕ(r ),
∂xj r dr
q
where xj is a component of x, and r = kxk = x12 + . . . + xs2 .
First-order Derivatives
The chain rule says
∂ xj d
ϕ(kxk) = ϕ(r ),
∂xj r dr
q
where xj is a component of x, and r = kxk = x12 + . . . + xs2 .
This implies we need to
provide code for derivatives of ϕ, e.g., for the Gaussian
dxrbf = @(ep,r,dx) -2*dx*ep^2.*exp(-(ep*r).^2);
First-order Derivatives
The chain rule says
∂ xj d
ϕ(kxk) = ϕ(r ),
∂xj r dr
q
where xj is a component of x, and r = kxk = x12 + . . . + xs2 .
This implies we need to
provide code for derivatives of ϕ, e.g., for the Gaussian
dxrbf = @(ep,r,dx) -2*dx*ep^2.*exp(-(ep*r).^2);
compute distances r (with DistanceMatrix.m),
First-order Derivatives
The chain rule says
∂ xj d
ϕ(kxk) = ϕ(r ),
∂xj r dr
q
where xj is a component of x, and r = kxk = x12 + . . . + xs2 .
This implies we need to
provide code for derivatives of ϕ, e.g., for the Gaussian
dxrbf = @(ep,r,dx) -2*dx*ep^2.*exp(-(ep*r).^2);
compute distances r (with DistanceMatrix.m),
and compute differences in x.
Program (DifferenceMatrix.m)
1 function DM = DifferenceMatrix(dcoord,ccoord)
2 [dr,cc] = ndgrid(dcoord(:),ccoord(:));
3 DM = dr-cc;
[email protected] Lecture IV Dolomites 2008
RBF Differentiation Matrices in M ATLAB
Program (DRBF.m)
Remark
The differentiation matrix is given by D = Ax A−1 . In M ATLAB we
implement this as solution of DA = Ax using mrdivide (/).
Could add a version of LOOCV to find “optimal” ε.
with solution
u(x, t) = f (x − ct)
Example (Allen-Cahn)
Boundary conditions:
Program (p36_2D.m)
1 rbf=@(e,r) exp(-e*r).*(15+15*e*r+6*(e*r).^2+(e*r).^3);
2 Lrbf=@(e,r)e^2*exp(-e*r).*((e*r).^3-(e*r).^2-6*e*r-6);
3 N = 24; ep = 2.4;
4 [L,x,y] = LRBF(N,rbf,Lrbf,ep);
5 [xx,yy] = meshgrid(x,y); xx = xx(:); yy = yy(:);
6 b = find(abs(xx)==1 | abs(yy)==1); % boundary pts
7 L(b,:) = zeros(4*N,(N+1)^2); L(b,b) = eye(4*N);
8 rhs = zeros((N+1)^2,1);
9a rhs(b) = (yy(b)==1).*(xx(b)<0).*sin(pi*xx(b)).^4 + ...
9b .2*(xx(b)==1).*sin(3*pi*yy(b));
10 u = L\rhs;
11 uu = reshape(u,N+1,N+1); [xx,yy] = meshgrid(x,y);
12 [xxx,yyy] = meshgrid(-1:.04:1,-1:.04:1);
13 uuu = interp2(xx,yy,uu,xxx,yyy,’cubic’);
14 surf(xxx,yyy,uuu), colormap(’default’);
15 axis([-1 1 -1 1 -.2 1]), view(-20,45)
16a text(0,.8,.4,sprintf(’u(0,0) = %12.10f’,...
16b uu(N/2+1,N/2+1)))
[email protected] Lecture IV Dolomites 2008
Solving PDEs via RBF-PS Methods M ATLAB Code
Remark
Note that for this type of elliptic problem we require inversion of the
differentiation matrix.
As pointed out above, we use the non-symmetric RBF-PS method
even though this may not be warranted theoretically.
Program (LRBF.m)
1 function [L,x,y] = LRBF(N,rbf,Lrbf,ep)
2 if N==0, L=0; x=1; return, end
3 x = cos(pi*(0:N)/N)’; % Chebyshev points
4 y = x; [xx,yy] = meshgrid(x,y);
5 points = [xx(:) yy(:)];
6 r = DistanceMatrix(points,points);
7 A = rbf(ep,r);
8 AL = Lrbf(ep,r);
9 L = AL/A;
Summary
Future work:
Need to think about stable way to compute larger problems with
RBFs (preconditioning) – especially for eigenvalue problems
Need efficient computation of differentiation matrix analogous to
FFT
Can think about adaptive PS methods with moving grids
References I
Buhmann, M. D. (2003).
Radial Basis Functions: Theory and Implementations.
Cambridge University Press.
Fasshauer, G. E. (2007).
Meshfree Approximation Methods with M ATLAB.
World Scientific Publishers.
Fornberg, B. (1998).
A Practical Guide to Pseudospectral Methods.
Cambridge Univ. Press.
Higham, D. J. and Higham, N. J. (2005).
M ATLAB Guide.
SIAM (2nd ed.), Philadelphia.
Trefethen, L. N. (2000).
Spectral Methods in M ATLAB.
SIAM (Philadelphia, PA).
References II
Wendland, H. (2005).
Scattered Data Approximation.
Cambridge University Press.
Fasshauer, G. E. (1997).
Solving partial differential equations by collocation with radial basis functions.
in Surface Fitting and Multiresolution Methods, A. Le Méhauté, C. Rabut, and L.
L. Schumaker (eds.), Vanderbilt University Press (Nashville, TN), pp. 131–138.
Ferreira, A. J. M. and Fasshauer, G. E. (2006).
Computation of natural frequencies of shear deformable beams and plates by an
RBF-pseudospectral method.
Comput. Methods Appl. Mech. Engrg. 196, pp. 134–146.
Ferreira, A. J. M. and Fasshauer, G. E. (2007).
Analysis of natural frequencies of composite plates by an RBF-pseudospectral
method.
Composite Structures, 79, pp. 202–210.
References III
Kansa, E. J. (1986).
Application of Hardy’s multiquadric interpolation to hydrodynamics.
Proc. 1986 Simul. Conf. 4, pp. 111–117.
Schaback, R. (2007).
Convergence of unsymmetric kernel-based meshless collocation methods,
SIAM J. Numer. Anal. 45(1), pp. 333–351.