[Solved] Numerical Analysis Homework #4

$25

File Name: Numerical_Analysis_Homework_#4.zip
File Size: 282.6 KB

SKU: [Solved] Numerical Analysis Homework #4 Category: Tag:
5/5 - (1 vote)
  • To get full credit, you must write down sufficient intermediate steps, only giving the final answer earns you no credit!
  • Please make sure that your handwriting is recognizable, otherwise you only get partial credit for the recognizable part.
  1. Consider on [0,2]:

( p(x) if x [0,1],

s(x) =

(2 x)3 if x [1,2].

Determine p P3 such that s(0) = 0. Is s(x) a natural cubic spline?

  1. Given fi = f(xi) of some scalar function at points a = x1 < x2 < < xn = b, we consider interpolating f on [a,b] with a quadratic spline.
    • Why an additional condition is needed to determine s uniquely?
    • Define mi = s0(xi) and pi = s|[xi,xi+1]. Determine pi in terms of fi,fi+1, and mi for i = 1,2,,n 1.
    • Suppose m1 = f0(a) is given. Show how

m2,m3,,mn1 can be computed.

  • Let s1(x) = 1+c(x+1)3 where x [1,0] and c R. Determine s2(x) on [0,1] such that

,

is a natural cubic spline on [1,1] with knots 1,0,1. How must c be chosen if one wants s(1) = 1?

  1. Consider with x [1,1].
    • Determine the natural cubic spline interpolant tof on knots 1,0,
    • As discussed in the class, natural cubic splineshave the minimal total bending energy. Verify this by taking g(x) be (i) the quadratic polynomial that interpolates f at 1,0,1, and (ii) f(x). V. The quadratic B-spline Bi2(x).
    • Derive the same explicit expression of Bi2(x) as that in the notes from the recursive Definition of B-splines and the hat function.
    • Verify that ddxBi2(x) is continuous at ti and ti+1.
    • Show that only one x (ti1,ti+1) satisfies ddxBi2(x) = 0. Express x in terms of the knots within the interval of support.
    • Consequently, show Bi2(x) [0,1).
    • Plot.
  1. We proved a theorem on constructing B-splines from truncated power functions,

Verify it algebraically for the case of n = 2, i.e.

.

The above six problems weigh 4, 9, 4, 8, 10, and 5 points, respectively.

2 C++ programming

  • Write a C++ subroutine for cubic-spline interpolation of the function

on evenly spaced nodes within the interval [1,1] with N = 6,11,21,41,81. Compute the max-norm of interpolation errors at the nodes for each N and report the errors and convergence rates with respect to the number of subintervals.

Your algorithm should follow the example of interpolating the natural logarithm in the notes and your program must use an implementation of lapack.

Plot the interpolating spline against the exact function to observe that spline interpolation is free of the wide oscillations in the Runge phenomenon.

  • (*) Write a Matlab subroutine to illustrate (1) by plotting the truncated power functions and building a table of divided difference where the entries are figures instead of numbers. See the hints in Section 4.

The two programming assignments weigh 14 and 6 points, respectively. Problem (b) is for extra credit. The total number of points of this homework is thus 54(+6).

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] Numerical Analysis Homework #4
$25