Question
You must create ONE .pdfile that contains the following: Page 1 will be your report - the TA will only read and mark page 1
You must create ONE .pdfile that contains the following: Page 1 will be your report - the TA will only read and mark page 1 - if there is additional writing on any other page, it will be ignored and you will get no credit for it. Pages two (and maybe 3) will be your Matlab code that you used in the assignment. The TA may choose to run this code if your report does not match the code you submit. You will get a Crowdmark link that will allow you to upload your completed assignment.The assignment is due at 11:00pm. I have set the due time in Crowdmark to 11:05pm and if Crowdmark indicates that you submitted late, you will be given 0 on the assignment. Your computing report portion of your submission must be exactly 1 page. Please read the Guidelines for Assignments rst. Keep in mind that Canvas discussions are open forums. Acknowledge any collaborations and assistance from colleagues/TAs/instructor. Computing Assignment { Ill-conditioned linear systems To complete this assignment, I suggest you download in partial code, 316ac3CodeSample.m, from Canvas (computing assignments page). You will need to modify this script suitably in order to complete the assignment. The main objective of this assignment is to investigate ill-conditioned matrices and to investigate the performance of di erent methods of solving linear systems when the system matrix is ill-conditioned. Let us start with some de nitions. Let Let A ? Rn n be a square matrix. We can define a norm for A by ||A|| := max||Ax|| ||x||=1
This definition depends on the vector norm we pick to compute ||Ax||, x ? Rn. Matlab command norm computes the norm of matrices using this de nition. The types of norms available are the 2-norm, 1-norm, max (Inf) norm and Frobenius norm. Take a matrix A = rand(3,3), and compute the 1-norm, 2-norm, in nity-norm and the Frobenius norm. Then compute the condition number of the matrix using all 4 norms. Use the Matlab commands norm and cond. Make a one sentence comment about what you see. The condition number of a matrix plays a very important role in Numerical Linear Algebra. It appears in many error bounds of di erent methods solving linear systems. The condition number of a non-singular matrix is defined by
cond(A) :=||Ax||||A?1||
We always have that cond(A) ? 1 for any square matrix A. An ill-conditioned matrix is a matrix with a very large condition number. The Matlab command cond(A) computes the condition number of a given matrix A.
A known example of an ill-conditioned matrix is the Hilbert matrix. A Hilbert matrix Hn :=(hij) ? Rnn is defined as
hij := 1/i + j ? 1 , ? i, j.
Matlab command hilb generates such matrix with the dimension n as input. You will investigate how the condition number of the Hilbert matrix grows with n. Compute the condition number of the Hilbert matrices Hn ? Rnn, for all n = 1, . . . , 50. Plot the log of condition number of Hn, What is the behaviour of the condition number of this matrix? Compare this with the anticipated theoretical growth of O((1+suaqre root2)^4n/suqre root n).
The next step is to compare the performance of different methods of solving linear systems using the Hilbert matrix. Fix nmin = 100 and nmax = 400 to change the size of the Hilbert matrix. For n from nmin to nmax, generate Hilbert matrices Hn ? Rnn, create the vector solution x := ones(n,1) and define the right hand side b := Hn x. Then compute solutions xlu, xqr and xbackslash with the LU decomposition, QR factorization of Hn, and the Matlab backslash command. Compute the error with the 2-norm errorlu :=|Ix ? xluI| errorqr :=|Ix ? xqrI|and errorbackslash :=||x ? xbackslashI| Finally, plot the range of dimensions nmin to nmax versus these 3 different errors. What do you observe? Which method would you recommend to use in this case?
Your conclusions should be explained in a one-page report. Your report must include the following:
(a) Computations of the various norms and condition numbers for a sample matrix.
(b) A plot of cond(Hn) versus n with a comparison to the theoretical anticipated growth.
(c) Plots of the errors while using LU, QR and versus dimension of Hn. You may find the Matlab command subplot very useful.
(d) Discussion of benefits of one method over the others.
(e) Make sure you answer all the questions in the document.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started