Docsity

Lecture Notes - Vectors, Matrices, Linear Systems, LU Decomposition | CMSC 460, Study notes of Computer Science

Partial preview of the text

Download Lecture Notes - Vectors, Matrices, Linear Systems, LU Decomposition | CMSC 460 and more Study notes Computer Science in PDF only on Docsity!

Computational Methods CMSC/AMSC/MAPL 460

Vectors, Matrices, Linear Systems, LU

Decomposition,

Ramani Duraiswami, Dept. of Computer Science

Gaussian Elimination

•^

Zero elements offirst column below 1

st^

row

  • multiplying 1

st^

row

by 0.3 and add to 2

nd

row

  • multiplying 1

st^

row

by -0.5 and add to 3

rd

row

  • Results in -^

Zero elements offirst column below 2

nd

row

  • Swap rows– Multiply 2

nd

row by

0.04 and add to 3

rd

Partial Pivoting

•^

Interchange rows below the current row to ensure that thelargest element by magnitude is in the current row

-^

Also possible to do column interchanges in addition torow interchanges (called full pivoting)

Solution

•^

Start from last equation whichcan be solved by division

-^

Next substitute in the previousline and continue

-^

This describes the way to dothe algorithm by hand

-^

How to represent it usingmatrices?

-^

Also, how do we solve anothersystem that has the same matrix?– Upper triangular matrix we end up with will be the same, but

the sequence of operations on the r.h.s needs to be repeated

•^

Book keeping to account for changes in a permutationmatrix

-^

(If we did full pivoting we need two permutationmatrices to account in addition for column interchanges)

LU Decomposition

•^

What is an upper triangularmatrix?– Elements below diagonal are zero

-^

Lower triangular matrix

-^

Elements above diagonal are zero

-^

Unit lower triangular matrix

-^

Elements along diagonal are one

-^

Upper triangular part of GaussElimination is clear …–

final matrix we end up with

•^

What about lower triangular and permutation?

How good are the answers given by LU?

•^

In general we cannotdetermine the exact answer.

-^

Rather we will determineanswer (possibly incorrect),and use it to find howpoorly it does in predictingthe right hand side

-^

Difference in r.h.s is the“residual” and is a measureof the error

True solution

With pivoting weget

•^

Recall “backward error analysis”

-^

Determine region in “problem space” where the problemwe solved lies

-^

Here the problem we solved is

Ax=b-r

•^

Theorem– Gauss elimination with partial pivoting produces small

residuals

•^

Next question:– Does a small residue mean a small forward error?– Here it did

Condition Number of a Matrix

A measure of how close a matrix is to singular•^

cond(

I ) = 1

•^

cond(singular matrix) =

•^

So even though residual was small, error was multipliedby the condition number, and was significant

1

cond(

)^

(^

max

maximum stretchmaximum shrink

min

i

i

i

i

A

A

A

A

−