Avdeling for teknologiske fag

Exercises: PhD D0308 Matrix Methods


MATLAB should be used in order to illustrate the theory.

Week 39

1. Use MATLAB and write an m-file script to caculate the Nullspace of an m x n matrix A. Use the SVD decomposition. Solution proposal using MATLAB: ex_nullspace.m

2. May the QR decomposition be used in order to calculate the Nullspace ?

 Week 43

Make a MATLAB implementation of the pseudo code for the modified Gram-Smidth process on p. 236 in the textbook. Solution qr_gs.m. The Gram Smidth process works for (m x n) matrices A with independent columns, also assumung m>= n.

Remarks: An implementation of the QR decomposition could with advantage be done by using Householder QR factorization as also pointed out in the book on p. 237. The idea is to zeroing out one column at a time below the diagonal of R. For the interested reader this may be implemented in MATLAB as in the following m-file functions based on theory from Golub and Van Loan.

QR software using Householder reflections: house.m qr:house.m qr_house2.m . Notice: These functions works for rank deficient matrices A and computes the famous QR decomposition, A=QR, where Q is orthogonal and R upper triangular.

Task for Ch 9.

1) Write a MATLAB m-file code for calculating the n-eigenvalues of a square (n x n) matrix A with real eigenvalues using QR iterations. First calculate Q and R in A=QR and then set A1=R*Q and calculate Q1 and Q2 in A1=Q1R1, then put A2=Q1*R1 and calculate the QR decomposition A2=Q2R2, and so on. Finally after some iterations, say, i, then Ai is diagonal and similar to matrix A, i.e. Ai have the n-eigenvalues to A on its diagonal. Solution: qr_it.m

2) Extend the above QR method in order to calculate the block real Schur decomposition, A=QTQ' where T is upper block triangular with complex eigenvalues in (2 x 2) blocks on the diagonal of T. Solution: qr_it2.m

3) Exercise SV's    Use the QR method and the qr_it.m function in order to write a MATLAB m-file function for calculate th, p=min(n,m) singular values, s_i for all i=1,...,p, of an (n x m) matrix A ? SOLUTION: s=sqrt(diag(qr_it(A*A')))

Software: house.m qr:house.m qr_house2.m

 

 

 

Teacher:  Dr. ing., 1. amanuensis David Di Ruscio                          


[Avdeling for teknologiske fag]     [Hjemmesiden til Høgskolen i Telemark]

Updated 29.09.2011 david.di.ruscio@hit.no