$29
Instruction
Upload a PDF file with two parts. Part one should include your typed report (your discussions, data and figures). Part two should list your code. You will receive a Crowdmark link for uploading your results.
Perturbations in linear systems
This computing assignment is an exploration of condition numbers, perturbations, and the numerical behavior of random and not-so-random matrices. You will need to load Data.mat from the folder to get all the data for the assignment, including the matrices E, H, HI, H8, and HI8 referred to below. For all your computations use = 10 6, a variable epsilon with the proper value is included in the data.
1. For A = E, A = H, compare the 1-condition number 1(A) (in Matlab simply cond(A,1)) to the observed amplification in perturbations as well as to the Matlab estimate rcond(A). Note, that rcond(A) estimates the reciprocal 1= 1(A).
a). Perturbations in the right-hand side
For each of these two matrices (A = E and A = H) you will solve a total of 100 systems. You pair each right side b = B(:,j) with each perturbation direction d = D(:,k); note, that all column vectors in your data have length 1 in the jj jj1 norm. Compute (simply use the Matlab “n” backslash command) the solution of
Ax = b; and Ay = b + d;
and compare the amplification of the relative errors
jjy xjj1
=
jjy
xjj1
e =
jjxjj1
jj djj1
jj
x
1
b
jj
1
jj
jj
to the upper bound 1(A).
Look at the average, median, and maximum of the amplification factors. Describe your ob-servations (supported by a plot), and comment on your results. See the sample below for a possible visualization.
1
MACM 316 COMPUTING ASSIGNMENT #3
b). Perturbations of the matrix
For each of the two matrices E and H, solve a total of 60 linear systems to compute am-plification factors. You use the same 10 right hand sides b from the first part; to get your perturbation matrices, type C=BIGC(:,:,k), for k = 1; : : : ; 6. All the data matrices have jjCjj1 = 1.
Compute (simply use the Matlab “n” backslash command) the solution of
Ax = b; and (A + C)z = b;
and compare the amplification of the relative errors
e =
jjz xjj1
= A
jjz xjj1
jjxjj1
jj jj1
jj Cjj1
jj
x
1
jj
A
jj
1
jj
to the upper bound 1(A) and the Matlab estimate 1/rcond(A).
Look at averages, median, and maxima of amplification factors. Plot your results, and com-ment on your observations.
2. Use the Matlab command AINV=inv(A) to find the inverse of a matrix A, and compute the inverse of this inverse, AC=inv(AINV), which mathematically equals A = A 1 1. The matrix I is the identity matrix.
a). For A = E, compute jjA AIN V Ijj1, and jjAC Ajj1.
b). For A = H, compute jjA AIN V Ijj1, and jjAC Ajj1. For this matrix, also compare the
computed inverse to the exact inverse HI provided in the data, i.e., compute jjAIN V HIjj1.
c). Repeat b) for the matrix A = H8 with exact inverse HI8. Compute 1(H8).
Summarize your observations and highlight anything that might seem surprising.
2