Professional Documents
Culture Documents
FINAL PROJECT
INSTRUCTOR: JIA LIU
Date: 07/27/2015.
1
(1) Let
4 2
2 3
(a) Verify that the matrix A is Symmetric Positive Definite (SPD).
(b) Let
1
x=
2
and be a positive parameter. Determine all values of such that
the matrix A xxT is still SPD.
A=
FINAL PROJECT
(2) Take m = 50, n = 12. Using Matlabs linspace, define t to be the m-vector
corresponding to linearly spaced grid points from 0 to 1. Using Matlabs
vander and fliplr, define A to be the m n matrix associated with least
squares fitting on this grid by a polynomial of degree n 1. Take b to
be the function cos 4t evaluated on the grid. Now, calculate and print
( to sixteen-digit precision) the least squares coefficient vectors x by six
methods:
(a) Formation and solution of the normal equations, using Matlabs \,
(b) QR factorization computed by mgs (Modified Gram-Schmidt, from
quiz 5)
(c) QR factorization computed by house (Householder triangularization
from quiz 5)
(d) QR factorization computed by Matalbs qr
(e) x = A\b
(f) SVD, using Matlabs svd
(g) The calculations above will produce six lists of twelve coefficients. In
each list, shade with red pen the digits that appear to be wrong(due
to the rounding errors).
(h) Comment on what differences you observe.
(i) Explain your observations.
FINAL PROJECT
(4) Linear systems that arise in many applications can become quite large. It
is often necessary to exploit any structure and /or sparsity in the matrices
to reduce the computation burden. We will consider the one-dimensional
Poisson equation: y 00 (t) = f (t) on [0,1], with y(0) = y(1) = 0.
Such problems are frequently very hard to handle because it is often
not possible to express y(t) in terms of elementary functions (as is done
in undergraduate courses on ODE). Numerical methods are employed in
order to approximate y(t) at discrete points inside the interval [a,b]. This
approach will leads to a linear system of equations (we will learn how in
the numerical PDE class).
The approach we consider begins by subdividing the interval [a,b] into
ba
: t0 = a, t1 = a + h, t2 =
n + 1 equal subintervals, each of length n+1
a + 2h, , tn = a + nh, tn+1 = b; The points ti = a + ih are called
ba
grid points, and the value h = n+1
is called the step size. Smaller step
sizes generally produce better approximations to the derivatives, so better
accuracy requires smaller step size, and hence larger number of grid points.
Let yi = y(ti ) and fi = f (ti ), and show that by using the finite difference
method, we can compute approximations to yi by solving the linear system
T y = h2 f , where
1
T =
1
..
.
..
..
.
..
.
1
y1
y2
, y =
..
.
1
yn
2
, f =
f1
f2
..
.
fn
(a) Prove that the matrix T has an LU factorization with L(i, i) = 1 and
i
L(i + 1, i) = i+1
, U (i, i) = i+1
i and U (i, i + 1) = 1.
(c) Find a formula for the determinant of the matrix T. Explain how you
got this formula.
(f) Let f (t) = sin t, then the right hand side fi = sin (ti ). Experiment
with various values of n, say n = 10, 100, 500, 1000. Fill the following
table:
n
10
100
500
1000
h absolute error
FINAL PROJECT
1
T =
1
..
.
..
..
.
..
.
1
u1
u2
..
.
, u =
1
un
2
j = 2(1cos Nj
+1 ) for j = 1 : N , corresponding to the eigenvectors uj (k) =
q
jk
2
N +1 sin( N +1 ) is the kth entry in uj . Noteice that the eigenvectors are
normalized w.r.t. the 2-norm. Also notice that eigenvalues of Tn lie in the
interval (0,4). Hence, the eigenvalues of h2 TN lie in the interval (0, 4(N +
1)2 ).
(e) (Bonus 20 pts) Write a Matlab code implementing the inverse power
method to compute approximations of the smallest eigenvalue 1 = 2
of L and corresponding eigenfunctions. Use N = 500 and apply the
algorithm to h2 TN . Start with a random initial guess, use normalization in the 2-norm, and stope when the difference of two subsequent
approximate eigenvectors has 2-norm less than some prescribed tolerance . (e. g. = 106 ).
(i) Report the number of iterations performed
(ii) compared approximations with exact eigenvalue/eigenvector pair.
(iii) Use matalb to plot the computed eigenvector.