Numerical Analysis I, Fall 2010 (http://www.math.nthu.edu.tw/˜ wangwc/)

Quiz 04

Nov 26, 2010.

1. (25 pts) Let x_{0} = −1, x_{1} = 0, x_{2} = 1. To interpolate f and f′ on x_{0}, x_{1}, x_{2} with a single polynomial, what is the lowest degree needed in general? Find a polynomial P (x) of this degree such that P (x_{0}) = P′(x_{0}) = 0, P (x_{2}) = P′(x_{2}) = 0 and P (x_{1}) = 1, P′(x_{1}) = 2 (Need not simplify).

2. (25 pts) Write a pseudo-code (algorithm) for the divided difference version of Hermite interpolation with data (x_{0}, f(x_{0}), f′(x_{0})), ⋯ (x_{n}, f(x_{n}), f′(x_{n})). You can instead give (or start with) the original version (using the ’basis functions’) for 15 pts.

3. (25 pts) A clamped cubic spline S for a function f is defined by

S(x) = \{ \begin{matrix}S_{0}(x) = 1 + Bx + 2x^{2} − 2x^{3}, & 0 ≤ x ≤ 1 \\ S_{1}(x) = 1 + b(x − 1) − 4(x − 1)^{2} + 7(x − 1)^{3}, & 1 ≤ x ≤ 2 \end{matrix}

Find f′(0) and f′(2).

4. (25 pts) Interpolate the function f(x) = \frac{1}{1+x^{2}} on [−5, 5] with equally spaced nodes −5, −4, ⋯, 4, 5 using the built-in spline function in octave. Give the interpolated value at x = 0.1 with 10 digits. The answer should be close to f(0.1). You can write your code to the answer sheet for potential partial credit in case the answer is wrong.

Numerical Analysis I, Fall 2010 (http://www.math.nthu.edu.tw/˜ wangwc/)

Quiz 04

Nov 26, 2010.

1. (25 pts) Let x_{0} = −1, x_{1} = 0, x_{2} = 1. To interpolate f and f′ on x_{0}, x_{1}, x_{2} with a single polynomial, what is the lowest degree needed in general? Find a polynomial P (x) of this degree such that P (x_{0}) = P′(x_{0}) = 0, P (x_{2}) = P′(x_{2}) = 0 and P (x_{1}) = 1, P′(x_{1}) = 2 (Need not simplify).

2. (25 pts) Write a pseudo-code (algorithm) for the divided difference version of Hermite interpolation with data (x_{0}, f(x_{0}), f′(x_{0})), ⋯ (x_{n}, f(x_{n}), f′(x_{n})). You can instead give (or start with) the original version (using the ’basis functions’) for 15 pts.

3. (25 pts) A clamped cubic spline S for a function f is defined by

S(x) = \{ \begin{matrix}S_{0}(x) = 1 + Bx + 2x^{2} − 2x^{3}, & 0 ≤ x ≤ 1 \\ S_{1}(x) = 1 + b(x − 1) − 4(x − 1)^{2} + 7(x − 1)^{3}, & 1 ≤ x ≤ 2 \end{matrix}

Find f′(0) and f′(2).

4. (25 pts) Interpolate the function f(x) = \frac{1}{1+x^{2}} on [−5, 5] with equally spaced nodes −5, −4, ⋯, 4, 5 using the built-in spline function in octave. Give the interpolated value at x = 0.1 with 10 digits. The answer should be close to f(0.1). You can write your code to the answer sheet for potential partial credit in case the answer is wrong.