11 - Solving linear systems Naive Gaussian elimination...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Solving linear systems Naive Gaussian elimination Pivoting Sparse/banded matrices Performance Gaussian elimination Dhavide Aruliah UOIT MATH 2070U c D. Aruliah (UOIT) Gaussian elimination MATH 2070U 1 / 33 Solving linear systems Naive Gaussian elimination Pivoting Sparse/banded matrices Performance Gaussian elimination 1 Solving linear systems of equations Easy-to-solve systems 2 Naive Gaussian elimination 3 Pivoting 4 Sparse and banded matrices 5 Performance of algorithms Using cputime to time programs Timed comparison of backslash vs. invert-and-multiply Operation counts c D. Aruliah (UOIT) Gaussian elimination MATH 2070U 2 / 33 Solving linear systems Naive Gaussian elimination Pivoting Sparse/banded matrices Performance Linear systems of equations Rule for matrix multiplication permits representation of linear systems of equations using matrices and vectors e.g., linear system of equations 2 x 1 + x 2 + x 3 = 4 4 x 1 + 3 x 2 + 3 x 3 + x 4 = 11 8 x 1 + 7 x 2 + 9 x 3 + 5 x 4 = 29 6 x 1 + 7 x 2 + 9 x 3 + 8 x 4 = 30 can be written as [ A ] { x } = { b } with 2 1 1 4 3 3 1 8 7 9 5 6 7 9 8 | {z } [ A ] x 1 x 2 x 3 x 4 | {z } { x } = 4 11 29 30 | {z } { b } c D. Aruliah (UOIT) Gaussian elimination MATH 2070U 4 / 33 Solving linear systems Naive Gaussian elimination Pivoting Sparse/banded matrices Performance Solving linear systems of equations in M ATLAB Want to solve n n system of linear equations [ A ] { x } = { b } Backslash operator does this in MATLAB: >> A = [ 1 3 ; 4 7 ] >> b = [ 4; 11 ] >> x = A \ b Read x = A \ b as { x } = [ A ]- 1 { b } x = A \ b = x = mldivide(A,b) matrix left divide c D. Aruliah (UOIT) Gaussian elimination MATH 2070U 5 / 33 Solving linear systems Naive Gaussian elimination Pivoting Sparse/banded matrices Performance Solving linear systems in M ATLAB Present goal: to understand what \ does I Gaussian elimination I Pivoting See doc mldivide matrix left division Solution of [ A ] { x } = { b } Never solve linear systems by computing [ A ]- 1 and { x } = [ A ]- 1 { b } ! Use backslash ( mldivide ) or some solver enclosing sensible algorithms c D. Aruliah (UOIT) Gaussian elimination MATH 2070U 6 / 33 Solving linear systems Naive Gaussian elimination Pivoting Sparse/banded matrices Performance Easy systems Diagonal system example Solve the linear system of equations 2 3- 4 x 1 x 2 x 3 = 5 9 1 2 x 1 = 5 x 1 = 5 2 3 x 2 = 9 x 2 = 9 3 = 3- 4 x 3 = 1 x 3 =- 1 4 Equations are completely decoupled c D. Aruliah (UOIT) Gaussian elimination MATH 2070U 7 / 33 Solving linear systems Naive Gaussian elimination Pivoting Sparse/banded matrices Performance Easy systems Diagonal systems Given vector { b } = [ b 1 , . . . , b n ] T R n and diagonal matrix [ D ] = diag ( { d } ) with { d } = [ d 1 , . . . , d n ] T R n , wish to solve linear system of equations [ D ]...
View Full Document

This note was uploaded on 06/20/2011 for the course MATH 2070 taught by Professor Aruliahdhavidhe during the Winter '10 term at UOIT.

Page1 / 28

11 - Solving linear systems Naive Gaussian elimination...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online