Transcribed TextTranscribed Text

Question 1 (Hessenberg Form, Eigenvalues, QR Algorithm) Let A be the inverse Hilbert matrix 16 -120 240 -140 -120 1200 -2700 1680 A = 240 -2700 6480 -4200 -140 1680 -4200 2800 Using SciPy 0.10.0 and later, you should be able to create A by using the command A = scipy linalg. invhilbert (4) Otherwise, you will need to create A by specifying its components. (a) Find the two vectors V1, V2 and their corresponding Householder transformations Q1.Q2 which will reduce A to upper Hessenberg form H: A = Q2Q1HQ;Q2 Show each of the two steps of the reduction. You can perform these steps by hand or by using python. (b) Use the function scipy linalg. eig in PYTHON to obtain the spectra of each of A and H. You must produce two sorted vectors of eigenvalues (i.e. one vector for A and one for H) and display them in long format. Use numpy . sort as appropriate. Find the relative error between these two vectors of eigenvalues. (c) Use PYTHON (or any other programming language) to write a function which uses the unshifted QR algorithm to produce the Schur decomposition of a tridiagonal matrix. You must submit your code in electronic form SO that it can be run, if necessary. Use your function to obtain the spectrum of H, sort the resulting vector, and compare your answer to that of b) above. You can use the command numpy set_printoptions (precision=16) to set the default output precision to 16 significant figures (this is somewhat like the format long in matlab). (d) Explain, in general terms, any differences between the eigenvalues produced by the eig function in b) above, and the eigenvalues produced by your Schur decomposition in c) above. Use your observations of the code and the outputs, as well as the theory covered in the Notes. Remember that both vectors of eigenvalues are approximations. Recall the significance of size of the matrix A in relation to methods for obtaining the roots of polynomials.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

import numpy as np
import scipy.linalg as lg
from scipy.linalg import *

#Question a)


def computeHessenberg(A):
n=A.shape[1] ; H=A.copy() ; Qs=[];Vs=[];
for k in range(0,n-2):
return (H,Qs,Vs)
H,Qs,Vs = computeHessenberg(A)

#Question b)


By purchasing this solution you'll be able to access the following files:

for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Numerical Analysis Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats