Lecture 21

# Lecture 21 - Tridiagonal Matrix Forward elimination Back...

This preview shows pages 1–5. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Tridiagonal Matrix Forward elimination Back substitution n 3 2 k r f e r r g f e f f 1 k 1 k k k k 1 k 1 k k k k , , , = - =- =---- 1 2 3 2 n 1 n k f x g r x f r x k 1 k k k k n n n , , , , , -- =- = = + Use factor = e k / f k- 1 to eliminate subdiagonal element Apply the same matrix operations to right hand side 1 1 1 1 ' ' 2 2 2 2 ' ' 3 3 3 3 ' ' ' ' 1 1 1 1 ' ' i i i i n n n n n n n f g x r f g x r f g x r f g x r f g x r f x r---- = O O O M M O O O M M Tridiagonal Matrix Special case of banded matrix with bandwidth = 3 Save storage, 3 n instead of n n Hand Calculations: Tridiagonal Matrix - = ------ 5 3 2 5 3 x x x x 25 1 5 5 2 1 1 5 2 2 1 4 3 2 1 . . . . =-- =- = =--- =- = =--- =- = =--- =- = - =--- =- = =--- =- = 4 1 1 5 5 3 r f e r r 1 5 1 5 25 1 g f e f f 1 1 1 1 2 r f e r r 1 1 1 1 2 g f e f f 1 3 1 2 5 r f e r r 1 2 1 2 5 g f e f f 3 3 4 4 4 3 3 4 4 4 1 1 2 2 3 2 2 3 3 3 1 1 2 2 2 1 1 2 2 2 ) ( . . ) . ( . . ) ( ) ( ) ( ) ( 1 1 2 2 3 f x g r x 2 1 3 1 1 f x g r x 3 1 4 5 1 f x g r x 4 1 4 f r x 1 2 1 1 1 2 3 2 2 2 3 4 3 3 3 4 4 4 =--- =- = =--- =- = =-- =- = = = = ) )( ( ) )( ( ) )( . ( (a) Forward elimination (b) Back substitution MATLAB M-file: Tridiag One loop; Operation count: ~8n NOT 2 n 3 /3 No modification on g [e,f,g,r] = example...
View Full Document

## Lecture 21 - Tridiagonal Matrix Forward elimination Back...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online