Starting from:

$35

Numerical Analysis Homework 5 Solved

I.     Scaled integral of B-splines.

Deduce from the Theorem on derivatives of B-splines that the scaled integral of a B-spline Bin(x) over its support is independent of its index i even if the spacing of the knots is not uniform.

II.    Symmetric Polynomials.

We have a theorem on expressing complete symmetric polynomials as divided difference of monomials.

(a)   Verify this theorem for m = 4 and n = 2 by working out the table of divided difference and comparing the result to the definition of complete symmetric polynomials.

(b)   Prove this theorem by the lemma on the recursive relation on complete symmetric polynomials.

The above problems weigh 8 and 12 points, respectively.

2        C++ programming
(a)   (20 points) Let f : R → R be a given function. Implement two modules to interpolate f by the quadratic and cubic cardinal B-splines, which corresponds to the two corollaries in the notes on unique interpolation by quadratic B-splines and complete cubic cardinal Bsplines, respectively.

(b)   (10 points) Run your subroutines on the function

 ,

using  10 for quadratic B-splines and ti = −6+i, i = 1,...,11 for complete cubic cardinal B-splines. Plot the polynomials against the exact function.

(c)   (10 points) Define ES(x) = |S(x) − f(x)| as the interpolation error. For the two cardinal B-spline interpolants, what are the values of ES(x) at the sites x = −3.5,−3,−0.5,0,0.5,3,3.5? Program in C++ to output these values. Why are some of the errors close to machine precision? Which of the two B-splines is more accurate?

(d)   (10 points) The roots of the following equation constitute a closed planar curve in the shape of a heart:

                              .                         (1)

Modify your C++ subroutines in the previous homework to plot the heart. As discussed in the lectures, the parameter of the curve should be the cumulative chordal length defined from n given points (x1,y1), (x2,y2), .... (xn,yn) as

 .

Choose n = 10,40,160 and produce three plots of the heart function. (Hints: Your knots should include the characteristic points and you should think about (i) how many pieces of splines to use? (ii) what boundary conditions are appropriate? ) You can choose the knots by C++ or by yourselves. No matter what method you use, make sure that the final result shown in your homework can be reproduced by running one simple command “produceHeartCurve” or something like that.

More products