MAT 128B, Winter 2019
Programming Project 3
(due by Wednesday, March 13, 11:59 pm)
General Instructions
You are required to submit each of your programming projects via le upload to Canvas.
Note that the due dates set in Canvas are hard deadlines. Submissions outside of Canvas or
after the deadline will not be accepted.
Produce a single le for each Matlab function that you are asked to write and a single driver
le for each of the problems that you are asked to test your programs on. The driver les
should display all the quantities you are asked to print out. We will run these these driver
les to check your programs. Submit a complete set of your Matlab les as a single zip le.
When you prepare your zip le, please make sure that you zip just the Matlab les, rather
than a folder containing these les.
For this current project, you should submit a zip le of a total of 9 Matlab les: 4 les for
the functions POWER ITER, AMULT, AMULT WWW, and AMULT WWW ALPHA and
5 driver les for Problems 1{5.
Write a short report that includes a discussion of the convergence speed of power iteration
and explanations of runs for which power iteration did not produce an approximate dominant
eigenvalue.
When you are asked to print out numerical results, print numbers in 16-digit
oating-point for-
mat. You can use the Matlab command \format long e" to switch to that format from Mat-
lab's default. For example, the number 10 would be printed out as 3.141592653589793e+01
in 16-digit
oating-point format.
For each programming project, upload two les: a zip le of a complete set of Matlab les
that lets us run your programs and a pdf le of your report.
The goal of this programming project is to implement and run power iteration for computing an
approximate eigenvalue and a corresponding approximate eigenvector of any matrix A 2 Rnn.
Write a Matlab function POWER ITER that implements the version of power iteration pre-
sented in class. The inputs of this function should be a function that computes matrix-vector
products x = Au with the matrix A, an initial vector x0, a convergence tolerance TOL, and
a safeguard N0 against innite loops. The outputs should be the approximate eigenvalue
and approximate eigenvector u produced by power iteration, the corresponding eigenvalue
residual norm
:= kAu uk2;
and the number j of iterations that the algorithm needed to produce the approximations
and u.