Professional Documents
Culture Documents
Michael J. Johnson
Spring 2008
Abstract. These are the homework assignments for Advanced Numerical Computing –
CS 543 taught at Kuwait University Spring Semester 2008.
Typeset by AMS-TEX
1
2 CS 543
1. Homework
Problem 1.1. Let Ξ1 = {0, 1, 5}, Ξ2 = {0, 1, 2, 5}, and Ξ3 = {0, 1, 3, 5}.
a) Is P3,Ξ1 a subspace of P6,Ξ1 ?
b) Is P3,Ξ1 a subspace of P3,Ξ2 ?
c) Is P3,Ξ2 a subspace of P3,Ξ3 ?
j1
X
f (x) = cj Bjk (x) for all x ∈ [ξ1 , ξ2 ].
j=j0
Problem 1.4. Let Ξ be the knots a = ξ1 < ξ2 < · · · < ξN +1 = b and let k ∈ N0 . Prove
that Sk,Ξ ∩ Sk+1,Ξ = Πk | .
[a,b]
Problem 1.5. Let k ∈ N and assume that the P knots {. . . , ξ−1 , ξ0 , ξ1 , . . . } are equispaced
∞
(ie. ξi+1 − ξi = h for all i). Prove that f (x) = j=−∞ ξj Bjk (x) is a polynomial of degree
1.
CS 543 3
2. Homework
The questions here may involve both written and Octave work. Let me suggest the
following format for your answers:
Give me your written work (on paper) along with a diskette or an archive (via email).
The diskette or archive should contain Octave scripts (*.m files). For each question, your
written answer should mention which Octave script file I’m supposed to see from your
diskette or archive. You may find the Octave commands disp, keyboard, input useful
in Octave scripts.
Problem 2.1. Let Ξ = {0, 1, 2, 4}. Find the unique spline s ∈ S1,Ξ which satisfies s(0) =
3, s(1) = 0, s(2) = 1, and s(4) = −1.
Problem 2.2. Let Ξ = {0, 1, 3, 6, 10} and k = 3.
a) Choose Ξext in an appropriate manner.
b) Using Octave, construct the pp representation of
Problem 2.3. Let Ξ = {−2, 1, 2, 5, 6}. Use Octave to verify the identity
d k k k
B (x) = Bik−1 (x) − k−1
Bi+1 (x)
dx i ξi+k − ξi ξi+k+1 − ξi+1
for i = 1, k = 3. (Suggestion: Construct the LHS and the RHS, and then plot both on the
same plot).
Problem 2.4. Let Ξ = {3, 4, 7, 8, 10, 13}. Use Octave to verify the identity
x − ξi ξi+k+1 − x
Bik (x) = Bik−1 (x) + k−1
Bi+1 (x)
ξi+k − ξi ξi+k+1 − ξi+1
for i = 1, k = 4.
Problem 2.5. Use Octave to construct and plot the natural quintic (degree 5) spline
which passes thru the points (1, 1), (2, 5), and (5, 5).
Problem 2.6. Use Octave to construct and plot the complete quintic spline s which passes
thru the points (0, 0), (2, 3), and (3, 1) and satisfies s0 (0) = 1, s00 (0) = −1, s0 (3) = 0,
s00 (3) = −2.
4 CS 543
3. Homework
Problem 3.1. Let f (x) = ln x, 1 ≤ x ≤ 4 (that’s log in Octave). Write an Octave script
which, given N, does the following:
a) Constructs the natural spline interpolant s, of degree 5, which interpolates f at the
N +1 equispaced points which start with 1 and end with 4 (you may use the supplementary
Octave command natural spline).
b) Compute (approximately)
Run your script for the values N = 40, 80, 160 and record the error measurements E 40 , E80 , E160 .
Problem 3.2. Consider the error estimate given in Theorem 6.1. How well does this error
estimate correlate with the results of the above experiment? Explain.
Problem 3.3. Prove that if ψ ∈ Cc (R) satisfies the Strang-Fix conditions of order k + 1,
then so does
Xn
φ(x) := λj ψ(x − τj ).
j=1
Problem 3.4. Suppose the pp s ∈ PX,4 has the Octave representation (X,S), where X
contains the knots and S is the matrix of coefficients. Explain how you would obtain the
Octave representation of the pp
a) f (x) = 5s(x).
b) g(x) = s(x − 3).
c) h(x) = s(4x).
Problem 3.5. Let ψ be the B-spline of degree k = 2 having knots
{−3/2, −1/2, 1/2, 3/2}.
a) Use Octave to find scalars λ1 , λ2 , λ3 so that
satisfies Z ∞
t` φ(t) dt = δ`,0 for ` = 0, 1, 2.
−∞
4. Homework
φ(x) = λ1 ψk (x + 2) + λ2 ψk (x + 1) + λ3 ψk (x) + λ4 ψk (x − 1) + λ5 ψk (x − 2)
Problem 4.2. Use Octave to verify that φ ∗0 p = p for all p ∈ Πk . I suggest the following
steps:
(a) Choose a basis q0 , q1 , q2 , q3 , q4 for Πk .
(b) For ` = 0, 1, 2, 3, 4, plot q` and φ ∗0 q` over the interval [−3, 3] to verify that they are
equal (use the supp. Octave command semi discrete val).
Problem 4.3. For h > 0 and [a, b] = [0, 2] consider the functions fe and se which are
described on pages 25 and 26 of our lecture notes.
(a) Write an octave function f wig.m which returns fe(x) (see the skeleton file f wig.m on
our esnips repository).
(b) Plot (in the same plot window) the function fe over the interval [−0.25, 2.25] for h =
1/10 and h = 1/20.
Problem 4.4. Let se = φ ∗0h fe.
(a) Plot the error f − se over the interval [0, 2] for h = 1/10 and h = 1/20.
(b) Approximate Eh := kf − sek[0,2] for h = 1/20, 1/40, and 1/80.
(c) Do the values Eh from part (b) correspond well with the error estimate in Approxima-
tion Theorem 8.9?
Problem 4.5. Prove that the centered cardinal B-spline ψk satisfies
ψk = ψ0 ∗ ψk−1 for k = 1, 2, 3, . . .
Suggestion: Give a proof by induction. The base case k = 1 can be worked out explicitly,
the induction step can be had by first showing that the derivatives are equal (property
(iii) on page 4 of our lecture notes should be helpful here). It will then follow that ψk and
ψ0 ∗ ψk−1 differ by a constant, and it is easy to finally show that this constant is 0.