1. Homepage
  2. Homework
  3. MATH3204 Numerical Linear Algebra & Optimisation (S2-2022): Assignment 02
This question has been solved

MATH3204 Numerical Linear Algebra & Optimisation (S2-2022): Assignment 02

Engage in a Conversation
University of QueenslandMATH3204Numerical Linear Algebra OptimisationMathematicalLinear AlgebraRichardson iteration

MATH3204/7234 (S2-2022): Assignment 02 CourseNana.COM


CourseNana.COM

1. [5 marks each] CourseNana.COM

 (a) Show that if AC and λ is an eigen value of A, then λ is an eigen value of A*. CourseNana.COM


(b) Let A C . For an arbitrary matrix induced norm show that CourseNana.COM

ρ(A) ≤ ||Ak ||1/k, k = 1,2,..., CourseNana.COM

where ρ(A) is the spectral radius of A. CourseNana.COM

(c) Consider A, B C . Prove that if one of A or B is non-singular, then AB and BA are similar. CourseNana.COM


CourseNana.COM


CourseNana.COM

2. [10 marks each] SupposeACm×n, BCn×m,andmn. CourseNana.COM

1.    (a)  We know AB and BA are not in general similar. However, we can still say some- thing about their spectrum. Show that the n eigenvalues of BA are the m eige- navlues of AB together with n m zeros. CourseNana.COM

2.     (b)  Suppose A C is invertible and x, y C . Use the first part of this question and show that CourseNana.COM

det(A + xyT) = det(A)(1 + yTA1x). CourseNana.COM


CourseNana.COM


CourseNana.COM

3. [5 marks] CourseNana.COM

Consider the least squares problem

CourseNana.COM

min 1 Ax b2 , CourseNana.COM

   xRn 2 CourseNana.COM

where A Rm×n is rank deficient. Show that among all possible solutions to this problem, Ab has the smallest Euclidean norm. CourseNana.COM


CourseNana.COM


CourseNana.COM

4. [5 marks each] CourseNana.COM

In this question, you will study one of the reasons why forming the matrix-inverse explicitly is so much frowned upon. CourseNana.COM

(a) For n = 100,200,500,1000,2000,5000,10000, consider a series of linear systems Anxn = bn where An = randn(n, n), bn = ones(n, 1) if you are coding in Matlab or An = np.random.randn(n, n), bn = np.ones((n, 1)) in Python CourseNana.COM

(b) Does your observation in comparing the time for these two implementations roughly match that predicted by the theory in terms of “flops”? Provide some explanation for your answer. CourseNana.COM

On paper, these functions are implementing the same thing, namely x = A1b , but on computer, they perform differently! This is one of the places where numerical linear algebra differs from linear algebra. CourseNana.COM

(c) Now generate a similar plot and make similar comparisons as above. However, this time construct An using sprandn(n,n,0.1) or sp.sparse.random(n,n,0.1, format=’csc’) if you are using Matlab or Python, respectively. These commands construct random but sparse matrices. Feel free to check the relevant documenta- tion and see what each argument of these functions is used for. The third argument controls the density of the matrix, i.e., what percentage of the entries of this matrix consists of non-zeros values. CourseNana.COM

(d) Does your observation in comparing the time for these two implementations roughly match that predicted by the theory in terms of “flops”? Provide some explanation for your answer. CourseNana.COM


CourseNana.COM

5. [5 marks each] For solving Ax = b, consider the stationary Richardson iteration CourseNana.COM

xk+1 =xk +α(bAxk). CourseNana.COM

For this question, we assume that all eigenvalues of A are real. CourseNana.COM

1.    (a)  Find the iteration matrix. CourseNana.COM

2.    (b)  Show that if λmin < 0 < λmax, the method will always be divergent for some initial iterate. CourseNana.COM

3.    (c)  So assuming that all eigenvalues are positive, find the spectral radius of the iteration matrix in terms of α, λmin and λmax ? CourseNana.COM

4.    (d)  Find αmin < αmax such that the method converges for any αmin < α < αmax. In other words, find the largest range for α that ensures the method always stays convergent. CourseNana.COM

5.    (e)  What is the optimal value for α? In other words find αopt that minimizes the spectral radius of the iteration matrix. CourseNana.COM

6.    (f)  Suppose A 0 . Using this optimal step-size, obtain the optimal convergence rate in terms of the matrix condition number. CourseNana.COM

7.    (g)  Implement the stationary Richardson iteration and apply it to the matrix gener- ated using the following code. For this assignment, we use beta = gamma = 0, N = 50, x0 = 0, and a right hand-side vector b containing all ones. Compare the performance using three step-sizes: αopt,0.5αopt, and 1.1αopt. What do you observe? Terminate the algorithms if the Euclidean norm of the residual vector rk2 = b Axk2 1012 or if a maximum number of iteration of 20, 000 is reached. CourseNana.COM

function A=lcd(beta ,gamma ,N)
%
% Simple code to generate test matrices for this question and
CourseNana.COM

maybe some later assignments % Usage: CourseNana.COM

% to generate symmetric positive definite, call with beta= gamma =0 CourseNana.COM

% to generate nonsymmetric call, e.g., with beta=gamma=1/2 %
% Note: output matrix is of size N^2-by-N^2
CourseNana.COM

ee=ones(N,1);
a=4; b=-1-gamma; c=-1-beta; d=-1+beta; e=-1+gamma;
CourseNana.COM

t1=spdiags([c*ee,a*ee,d*ee],-1:1,N,N); CourseNana.COM

t2=spdiags([b*ee,zeros(N,1),e*ee],-1:1,N,N); CourseNana.COM

A=kron(speye(N),t1)+kron(t2,speye(N));
end
CourseNana.COM

For Matlab use the above code snippet. CourseNana.COM

import numpy as np
import scipy as sp
def lcd(beta ,gamma ,N):
# Simple code to generate test matrices for this question and maybe some later assignments
CourseNana.COM

# Usage: CourseNana.COM

#  to generate symmetric positive definite, call with beta =gamma=0 CourseNana.COM

#  to generate nonsymmetric call, e.g., with beta=gamma =1/2 CourseNana.COM

#
# Note: output matrix is of size N^2-by-N^2
CourseNana.COM

ee = np.ones((1, N)) CourseNana.COM

a, b, c, d, e = 4, -1 - gamma, -1 - beta, -1 + beta, -1 + gamma CourseNana.COM

t1 = sp.sparse.spdiags(np.vstack([c * ee, a * ee, d * ee]), np.arange(-1,2), N, N) CourseNana.COM

t2 = sp.sparse.spdiags(np.vstack([b * ee, np.zeros((1, N)), e * ee]), np.arange(-1,2), N, N) CourseNana.COM

A = sp.sparse.kron(sp.sparse.eye(N,N), t1) + sp.sparse.kron( t2, sp.sparse.eye(N,N)) CourseNana.COM

For Python use the above code snippet. CourseNana.COM

(h) Implement the accelerated variant of the Richardson iteration and, on the same test problem and starting from the same x0 as above, compare its performance with the stationary version. For both methods, use the step-size α = 2/(λmin + λmax). CourseNana.COM

100 marks in total CourseNana.COM

Note: CourseNana.COM

  • This assignment counts for 15% of the total mark for the course.
  • Although not mandatory, if you could type up your work, e.g., LaTex, it would be

greatly appreciated. CourseNana.COM

  • Show all your work and attach your code and all the plots (if there is a programming question).
  • Combine your solutions, all the additional files such as your code and numerical results, all in one single PDF file.
  • Please submit your single PDF file on Blackboard.

  CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
University of Queensland代写,MATH3204代写,Numerical Linear Algebra Optimisation代写,Mathematical代写,Linear Algebra代写,Richardson iteration代写,University of Queensland代编,MATH3204代编,Numerical Linear Algebra Optimisation代编,Mathematical代编,Linear Algebra代编,Richardson iteration代编,University of Queensland代考,MATH3204代考,Numerical Linear Algebra Optimisation代考,Mathematical代考,Linear Algebra代考,Richardson iteration代考,University of Queenslandhelp,MATH3204help,Numerical Linear Algebra Optimisationhelp,Mathematicalhelp,Linear Algebrahelp,Richardson iterationhelp,University of Queensland作业代写,MATH3204作业代写,Numerical Linear Algebra Optimisation作业代写,Mathematical作业代写,Linear Algebra作业代写,Richardson iteration作业代写,University of Queensland编程代写,MATH3204编程代写,Numerical Linear Algebra Optimisation编程代写,Mathematical编程代写,Linear Algebra编程代写,Richardson iteration编程代写,University of Queenslandprogramming help,MATH3204programming help,Numerical Linear Algebra Optimisationprogramming help,Mathematicalprogramming help,Linear Algebraprogramming help,Richardson iterationprogramming help,University of Queenslandassignment help,MATH3204assignment help,Numerical Linear Algebra Optimisationassignment help,Mathematicalassignment help,Linear Algebraassignment help,Richardson iterationassignment help,University of Queenslandsolution,MATH3204solution,Numerical Linear Algebra Optimisationsolution,Mathematicalsolution,Linear Algebrasolution,Richardson iterationsolution,