






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Problem set 6 for math 6800, where students are required to write matlab functions for cholesky decomposition and solving linear systems, as well as finding eigenvalues using the qr algorithm. Instructions for each problem and expected outcomes.
Typology: Assignments
1 / 12
This page cannot be seen from the preview
Don't miss anything!







Math 6800
Due: Monday, 11/8/
(a) Write a matlab function, R=myCholesky(A) say, following algorithm 23.1 in the text. Test your function using A=Z’Z, where Z=triu(rand(12,12)). Compute the following quantities: norm(R’R-A)/norm(A) and norm(R-Z)/norm(Z). Comment on the results.
(b) Write a second matlab function, x=mySolve(R,b), that solves the linear system given the Cholesky factorization of A. Test your function using b=Ay, where A is the matrix constructed above and y=ones(12,1). Compute norm(x-y)/norm(y) and comment on the results.
(a) Let A be a 7 × 7 matrix generated using rand(7,7), and find its eigenvalues using matlab’s eig function. Now consider the basic steps of the QR algorithm: (i) compute the QR-factorization of A, (ii) set A = RQ. Apply these two steps iteratively until A reduces to an “eigenvalue revealing form.” (You may use matlab’s qr function to determine the Q,R factors in step (i) of the iteration.) Determine the eigenvalues from this form (without using matlab’s eig function) and compare them to the ones found originally.
(b) Let B be a 7 × 7 matrix generated using the following commands B=diag(rand(7,1)); [Q2,R2]=qr(rand(7,7)); B=Q2’BQ2. Repeat the iteration described in part (a) for the matrix B in order to determine its eigenvalues.