Sale!

MACM 316 COMPUTING ASSIGNMENT #3 solved

Original price was: $35.00.Current price is: $30.00. $25.50

Category:

Description

5/5 - (6 votes)

This computing assignment is an exploration of condition numbers,
perturbations, and the numerical behaviour of random and not-sorandom matrices.
You will need to download gendata.p from Canvas to get all the
data for the assignment, including the matrices E, H, HI, H8, and
HI8 referred to below. (Note: gendata is encoded, displaying it will
show a sequence of strange characters.) Run the script, and look at
the work space or type whos to get a list of the data.
For all your computations use  = 10−6
– a variable epsilon with
the proper value is included in your data.
C1. 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).
1. Perturbations in the right-hand side.
For each of these two matrices 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 || · ||1 norm. Compute (simply use the Matlab
“\” backslash command) the solution of
Ax = b, and Ay = b + d,
and compare the amplification of the relative errors
e =
||y−x||1
||x||1
||d||1
||b||1
=
||y − x||1
||x||1
to the upper bound κ1(A).
Look at the average, median, and maximum of the amplification factors. Describe your
observations (supported by a plot), and comment on your results. See the sample below
for a possible visualization.
MRT 1
MACM 316 COMPUTING ASSIGNMENT #3
2. Perturbations of the matrix.
For each of the two matrices E and H, solve a total of 60 linear systems to compute
amplification 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 ||C||1 = 1.
Compute (simply use the Matlab “\” backslash command) the solution of
Ax = b, and (A + C)z = b,
and compare the amplification of the relative errors
e =
||z−x||1
||x||1
||C||1
||A||1
= ||A||1
||z − x||1
||x||1
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
comment on your observations.
C2. Short (and sweet – depending on your taste). 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.
1. For A = E, compute ||A ∗ AINV − I||1, and ||AC − A||1.
2. For A = H, compute ||A ∗ AINV − I||1, ||AC − A||1. For this matrix, also compare the
computed inverse to the exact inverse HI provided, i.e., compute ||AINV − HI||1.
3. Repeat item 2 for the matrix A = H8 with exact inverse HI8. Compute κ1(H8).
Summarize your observations and highlight anything that might seem surprising.
MRT