Question: 3. (15 points) Using the programming language of your choice (Matlab is recommended): write a function that accepts as input an n x n matrix

3. (15 points) Using the programming language of your choice (Matlab is recommended): write a function that accepts as input an n x n matrix A, an initial vector xo in R" and an initial eigenvalue estimate a, and returns an eigenvalue and associated eigenvector of A obtained using the Shifted Inverse Power Method. Your program should include a stopping criterion that tests for convergence and should avoid getting into an infinite loop if convergence does not occur. (For example, you could stop when norm(Ax - ix) > epsilon for some small number epsilon, or when a pre-defined maximum number of iterations has occurred.) 10 6 -12 Test your function on A = | 12 7-15 | , with x0-| 0 | and ? = 3, ? = 2, ?-1. 12 6 -14 0) Compare the answers you get to the exact answers returned by Matlab's eig() function. 3. (15 points) Using the programming language of your choice (Matlab is recommended): write a function that accepts as input an n x n matrix A, an initial vector xo in R" and an initial eigenvalue estimate a, and returns an eigenvalue and associated eigenvector of A obtained using the Shifted Inverse Power Method. Your program should include a stopping criterion that tests for convergence and should avoid getting into an infinite loop if convergence does not occur. (For example, you could stop when norm(Ax - ix) > epsilon for some small number epsilon, or when a pre-defined maximum number of iterations has occurred.) 10 6 -12 Test your function on A = | 12 7-15 | , with x0-| 0 | and ? = 3, ? = 2, ?-1. 12 6 -14 0) Compare the answers you get to the exact answers returned by Matlab's eig() function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
