CS 290 I:  Homework #1:  Due Mon 9 February 1:00 pm

 

 

Rules:

 

This assignment is due by 1:00 pm on Monday, February 9, 2004.  Turn it in to the CS290I homework box in room 2108 of the Engineering I building (next to the Computer Science Department office), or else turn it in at the beginning of class that day.  Be sure to put your name on it!  You may discuss the problems with other students but what you turn in must be your own work. 

 

Problems:

 

1 [10 + 10 points].  Recall that a symmetric matrix A is defined to be positive definite if xTAx > 0 for every nonzero vector x.

 

a)      Prove that a symmetric matrix A is positive definite if and only if all its eigenvalues are positive.

 

            b)  Prove that if A is symmetric and positive definite, then the function ||x||A = (xTAx) 1/2 actually satisfies the properties of a vector norm:

i.                     ||x||A > 0 if x is nonzero, and ||0||A = 0

ii.                   ||ax||A = |a| ||x||A  for every scalar a and vector x.

iii.                  ||x||A  + ||y||A  >=   ||x + y||A for all vectors x and y.

 

 

2 [20 points].  We showed that in the Conjugate Gradient algorithm, only one of the beta’s is nonzero at each iteration; this is why CG only needs to A-orthogonalize against one previous vector at each iteration, so that an iteration costs only O(n) time plus one matrix-vector multiplication.

 

In class, we derived the formula              bk =  - rkT A dk-1  /  dk-1T A dk-1

 

Show that this is equivalent to the formula in the CG algorithm on the lecture slides, which is          bk =   rkT rk  /  rk-1T rk-1

 

 

3 [60 points].  For this exercise, you will use Matlab to experiment with convergence of CG on the model problem, Poisson’s problem on a 2D mesh.  Your goal is to verify experimentally two of the entries in the “complexity of linear solvers” table (on slide 15 of the lecture slides here). 

 

Let A be the n-by-n matrix of coefficients of the model problem (here are three ways to generate A), and let b be a randomly chosen right-hand side.  Use Matlab’s “pcg” function to solve Ax=b by conjugate gradients, with no preconditioning.  Plot the number of iterations versus n for enough values of n to confirm or deny that the total running time is growing proportionally to n^(3/2) (equivalently, that the total number of iterations is growing as O(n^(1/2))).

 

Now repeat the experiment, but use an incomplete LU preconditioner.  Use incomplete LU with no pivoting and with no fill.  (Matlab’s  “luinc” will compute this; you will have to wade through the help file to find out exactly how to get what you want!)  What is the order of growth of the number of iterations?

 

Finally, repeat the experiment again, using a “modified” incomplete LU, or “milu”, preconditioner.  (“luinc” again!)  This is the same as incomplete LU, except that whenever a fill element is dropped from the factor, its value is added to the diagonal.  Can you confirm the entry in the complexity table that says the running time is proportional to O(n^(5/4))?

 

For this problem, turn in the Matlab code you run, and also printouts of Matlab plots that support your conclusions.