Exercise set 4: Interpolation & Approximation

1. Find a cubic polynomial p such that p(0) = -1, p(1) = 1 and p’(1) = p’(2) = 0.

2. Consider the function f(x) = sin(x), x ∈ [0, 2π].
2.1 Sample 6 values (Subscript[x, i]) ∈ [0, 2π] and compute the corresponding (Subscript[f, i]) = f((Subscript[x, i])). Interpolate the resulting data by a polynomial p of degree 5.
2.2 Plot the interpolation (Subscript[p, 1]), the original function f, and the values ((Subscript[x, i]), (Subscript[f, i])) into one image.
2.3 Compute the (L^2) and (L^∞) norm of the interpolation error f-(Subscript[p, 1]).

3. Consider the function f(x) = sin(x), x ∈ [0, 2π].
3.1 Sample 3 values (Subscript[x, i]) ∈ [0, 2π] and compute the corresponding (Subscript[f, i]) = f((Subscript[x, i])), (Subscript[f, i+3]) = f’((Subscript[x, i])). Interpolate the resulting Hermite data by a polynomial (Subscript[p, 2]) of degree 5.
3.2 Plot the interpolation (Subscript[p, 2]), the original function f, and the values ((Subscript[x, i]), (Subscript[f, i])) into one image.
3.3 Compute the (L^2) and (L^∞) norm of the interpolation error f-(Subscript[p, 2]).

4. Consider the function f(x) = sin(x), x ∈ [0, 2π].
4.1 Chose a random point y ∈ (0, 2π).
4.2 Compute a cubic Hermite interpolation of f(x) at the subintervals [0, y] and [y, 2π] using the boundary data (i. e. the values and derivatives at 0, y, 2π).
4.3 Plot the interpolation (Subscript[p, 3]), and the original function f into one image.
4.4 Compute the (L^2) and (L^∞) norm of the interpolation error f-(Subscript[p, 3]).
Hint: It might be easier (for Mathematica) to compute the error for each subinterval separately and then combine the result.

5. Consider the curve c={(t^2)+3t,((3t)/((t^2)+1))} for t ∈ [-3, 0].
5.1 For -3 = (Subscript[t, 0]) < (Subscript[t, 1]) < ... < (Subscript[t, 6]) = 0 sample 7 points (Subscript[P, i]) = c((Subscript[t, i])), on the curve c. Compute the tangent vectors (Subscript[v, i]) = c’((Subscript[t, i])) at these points.
5.2 Interpolate the points (Subscript[P, i]) by a polynomial curve (Subscript[d, 1]) of degree 6. Plot the curve, the interpolation, and the sampled points into one image.
5.3 Interpolate each segment [(Subscript[t, i]), (Subscript[t, i+1])] by a cubic curve using Hermite interpolation. The result should by a piecewise polynomial curve (Subscript[d, 2]), satisfying (Subscript[d, 2])((Subscript[t, i])) = (Subscript[P, i]) and (Subscript[d, 2])’((Subscript[t, i])) = (Subscript[v, i]). Plot the original curve c, the interpolation (Subscript[d, 2]), the sampled points and the sampled vectors into one image.
5.4 Sample 30 points (Subscript[Q, 1]), (Subscript[Q, 2]), ..., (Subscript[Q, 30]) onto the curve c. Approximate the curve at these points by a Bézier curve b of degree 6. Make sure to compute the control points directly! Plot the approximate curve b, the original curve c, and the sampled points (Subscript[Q, i]) into one image.