# Master degree course on

## Testo completo

(1)

### Approximation Theory and Applications,

Lab exercises

Prof. Stefano De Marchi A.Y. 2017-18

1. Construct the Dubiner points on the square [−1, 1]2 and on the disk x2+ y2= 1.

2. At the CAA Research Group you find the software for making the so-called (Weakly) Admissible Meshes, (W)AM on various 1,2 and 3 dimensional domains (see the web page http://www.math.

unipd.it/~marcov/wam.html).

• On [0, 1]d, d = 1, 2, 3, interpolate on the corresponding (W)AM the function f (x) = 4d

d

Y

k=1

xk(1 − xk), x = (x1, . . . , xd) ∈ [0, 1]d

• Compute the Lebesgue constant for the WAMs of the previous point.

3. Consider the Franke function in 2 and 3 dimensions. The Matlab codes to define them are

% Franke function in 2d

term1 = 0.75 * exp(-(9*x1-2)^2/4 - (9*x2-2)^2/4);

term2 = 0.75 * exp(-(9*x1+1)^2/49 - (9*x2+1)/10);

term3 = 0.5 * exp(-(9*x1-7)^2/4 - (9*x2-3)^2/4);

term4 = -0.2 * exp(-(9*x1-4)^2 - (9*x2-7)^2);

y = term1 + term2 + term3 + term4;

or simply use the built-in function z=franke(x,y), with x,y two-dimensional Matlab grids.

% A version of Franke function in 3d

term1 = 0.75 * exp(-(9*x1-2)^2/4 - (9*x2-2)^2/4- (9*x3-2)^2/4);

term2 = 0.75 * exp(-(9*x1+1)^2/49 - (9*x2+1)/10-(9*x3+1)^2/10);

term3 = 0.5 * exp(-(9*x1-7)^2/4 - (9*x2-3)^2/4 - (9*x3-5)^2/4);

term4 = -0.2 * exp(-(9*x1-4)^2 - (9*x2-7)^2- (9*x3-5)^2);

y = term1 + term2 + term3 + term4;

Then, compute for the Franke function f its integral Z

[0,1]d

f (x)dx, d = 2, 3 ,

using the Monte Carlo (random points) and the Quasi Monte Carlo (Halton and Hammersly points) for different increasing values of the number of points. Compare the results with the built-in functions quad2d and quad3d.

About the Hammersly points, you can produce them by the corresponding function found in the Matlab File Exchange, toolbox SNTO (Sequential Number Theoretical Optimization package).

1

(2)

4. Plot the following strictly positive definite RBF, centered at the origin

• Gaussian - Laguerre for n = 1, 2 and s = 1, 2

s n = 1 n = 2

1 (3/2 − x2)e−x2 (15/8 − 5/2 x2+ 1/2x4)e−x2 2 (2 − kxk2)e−kxk2 (3 − 3kxk2+ 1/2kxk4)e−kxk2 for s = 1, x ∈ [−1, 1] while for s = 2, x ∈ [−1, 1]2.

• Poisson functions for s = 2, 3, 4 in [−1, 1]2 using the shape parameter  = 10 (to be introduced in the below definitions)

s = 2 s = 3 s = 4

J0(kxk) r2

π

sin(kxk) kxk

J1(kxk) kxk

where Jp is the Bessel function of first kind and order p (in Matlab besselj(p,z) where z is an evaluation vector of points).

• Mat´ern functions in [−1, 1]2, for three values of β (again with  = 10) β1 = s+12 β2= s+32 β3= s+52

e−kxk (1 + kxk) e−kxk 3 + 3kxk + kxk2 e−kxk

Notice that Mat´ern for β1 is not differantiable at the origin. For β2 is C2(Rs) and for β3is C4(Rs).

• Generalized inverse multiquadrics Φ(x) = (1 + kxk2)−β, s < 2β, in [−1, 1]2 (always using  = 5) for β = 1/2 (Hardy) and β = 1 (inverse quadrics).

• Truncated powers Φ(x) = (1 − kxk)l+ when l = 2, 4 (in [−1, 1]2).

• Whittaker’s potentials in [−1, 1]2, for the following α, k e β

α k = 2 k = 3

0 β − kxk + kxke−β/kxk β2

β2− 2βkxk + 2kxk2− 2kxk2e−β/kxk β3

1 β − 2kxk + (β + 2kxk)e−β/kxk β3

β2− 4βkxk + 6kxk2− (2βkxk + 6kxk2)e−β/kxk β4

Note: For the plots take β = 1.

5. Construct the RBF interpolant of the Franke functions on a grid 20 × 20 of Chebyshev points with Poisson and Mat´ern RBF. Compute also the RMSE (Root Mean Square Error)

6. Plot the most important Conditionally Positive Definite RBF

2

(3)

Φ(x) = (1 + kxk2)β, x ∈ Rs, β ∈ R\N0

with β = 1/2 (Hardy) we get SCDP of order 1 while with β = 5/2 we get a SCDP of order 3.

• Power functions (shape parameter free!)

Φ(x) = kxkβ, x ∈ Rs, 0 < β /∈ 2N

For β = 3 we get a SCPD of order 2 while for β = 5 a SCPD of order 3.

• thin-plate splines (shape parameter free!)

Φ(x) = kxklog kxk, x ∈ Rs, β ∈ N

The “classic” one is for β = 1 (SCPD of order 2), while for β = 2 we get a function SCPD of order 3. Verify that also these functions are shape parameter free.

• The Matlab functions necessary for interpolation can be dowloaded at the link http://www.math.unipd.it/∼demarchi/TAA2010.

7. Plot the power function for two kernels, one PD and one CPD, say Φ1, Φ2 and scattered centers X on 2 and 3 dimensions.

8. Implement the Shepard’s method with orders 1 up to 3, in 1 and 2 variables.

9. Complete the function PU.m of the toolbox PUM (available at the website of the course) and then run MAIN PU.m with different shape parameters.

3

Updating...

## Riferimenti

Updating...

Argomenti correlati :