Docsity

MATH 434/534 Computer Assignment 3: Solving Linear Systems using MATLAB - Prof. Biswa Datt, Study notes of Linear Algebra

Toggle sidebar
bg1
MATH 434/534
Computer Assignment 3
Due on November 15, 2011
Chapter 6
M6.1
(a)
Write MATLAB programs called linsyswp and linsyspp to solve Ax =band to compute
the growth factor (gf) usign Gaussian elimination with no and partial pivotings, respectively,
as follows;
(ˆx, gf ) = lnsyswp(A, b).
(ˆx, gf ) = lnsyspp(A, b).
(b)
Using the computed solutions and the growth factors obtained in (a) make the following
table for each of the given data set.
Test Data for Problem M6.1:
Each of the following matrices of order 20: Hilbert, Pei, Hankel, Vandermonde, a randomly
generated matrix, and a triangular matrix with small diagonal entries. For the Pei matrix,
take αclose too 1.
Create the vector bin each case such that the solution vector xis a vector with all components
equal to 1. Present your result using the following table.
Method kˆxk∞
kx−ˆxk2
kxk2kb−Aˆxk2Cond2(A)kb−Aˆxk2
kbk2Growth Factor
linsyswp
linsypp
A−1b
M6.5
Using the MATCOM program choles or the MATLAB program chol, write a MATLAB
program, linsyschol, to implement Algorithm 6.8 in the following format:
[x] = linsyschol(A, b).
Data:
Create a 200 ×200 lower triangular matrix Lwith positive diagonal entries taking some
of the diagonal entries small enough to be very close to zero, multiply it by LT, and take
A=LLTas your test matrix A. Create the vector bsuch that xhas all its entries equal to
1.

Partial preview of the text

Download MATH 434/534 Computer Assignment 3: Solving Linear Systems using MATLAB - Prof. Biswa Datt and more Study notes Linear Algebra in PDF only on Docsity!

MATH 434/

Computer Assignment 3 Due on November 15, 2011

Chapter 6 M6. (a) Write MATLAB programs called linsyswp and linsyspp to solve Ax = b and to compute the growth factor (gf ) usign Gaussian elimination with no and partial pivotings, respectively, as follows;

(ˆx, gf ) = lnsyswp(A, b). (ˆx, gf ) = lnsyspp(A, b).

(b) Using the computed solutions and the growth factors obtained in (a) make the following table for each of the given data set.

Test Data for Problem M6.1: Each of the following matrices of order 20: Hilbert, Pei, Hankel, Vandermonde, a randomly generated matrix, and a triangular matrix with small diagonal entries. For the Pei matrix, take α close too 1.

Create the vector b in each case such that the solution vector x is a vector with all components equal to 1. Present your result using the following table.

Method ‖xˆ‖∞ ‖x ‖−x‖ˆx 2 ‖^2 ‖b − Axˆ‖ 2 Cond 2 (A)‖b− ‖bA‖x 2 ˆ‖^2 Growth Factor linsyswp linsypp A−^1 b

M6. Using the MATCOM program choles or the MATLAB program chol, write a MATLAB program, linsyschol, to implement Algorithm 6.8 in the following format:

[x] = linsyschol(A, b).

Data: Create a 200 × 200 lower triangular matrix L with positive diagonal entries taking some of the diagonal entries small enough to be very close to zero, multiply it by LT^ , and take A = LLT^ as your test matrix A. Create the vector b such that x has all its entries equal to