Question: start code is % system for problem 2: A temp = randn(10); Sys = temp'*temp; % system and vector for problem 5: m = 100;

start code is
% system for problem 2: A temp = randn(10); Sys = temp'*temp;
% system and vector for problem 5: m = 100; n = 50; A = rand(m, n); b = randn(m,1);
(4) The power method is an algorithm for computing the eigenvalue of largest absolute value, and the corresponding (normalized) eigenvector. (a) Write a function to implement the following (i) Input: starting vector w, linear system A, number of iterations N (ii) Initialize yo w/IIwll. (iii) For k 1, 2 .,N (A) compute z Ay (B) compute AK (2 )Ty -1 (C) compute yk zk/II2 (iv) Output yk, Ak The output yk is the normalized eigenvector, while A is the corresponding eigenvalue (of largest absolute magnitude). Include your code below (b) Apply your function to the linear system in the starter code. What is the eigenvalue that you found? Check that the eigenvector is correct, by computing norm (Sys v lam*v). Show your commands and the output below. (c) One can also obtain all the eigenvalues of a matrix using the QR factorization. Implement the following function: (i) Input: linear system A, number of iterations N (ii) Initialize A A. (iii) For k 1.2 ,N k pk A) compute QR factorization of A (B) compute A RRQ iv) Output vector of diagonal entires of A Include your code below. (d) Run your function on the same system as in part (b). What are the eigenvalues
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
