Sale!

# MACM 316 Computing Assignment 1

\$30.00

Category:

## Description

MACM 316 COMPUTING ASSIGNMENT #3

Instruction
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 || · ||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.
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 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.
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 ||A ∗ AINV − I||1, and ||AC − A||1.
b). For A = H, compute ||A ∗ AINV − I||1, and ||AC − A||1. For this matrix, also compare the
computed inverse to the exact inverse HI provided in the data, i.e., compute ||AINV − HI||1.
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.