BackSolve - j + u j,j +1 y j +1 + ... + u jn y n = b j ,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Solving Square Triangular Systems When you were taught Gaussian Elimination, you were probably taught to stop the elimination process when you achieved an “upper triangular form”, at which point you could solve the system by backward substitution. By upper triangular we mean that all matrix entries below the main diagonal are 0’s. Let’s teach a computer to solve the upper triangular system of linear equations Uy = b , where U R n × n . It is called backward substitution because the last equation has the form u nn y n = b n , and can be solved as y n = b n /u nn . Now since we know y n , the penultimate equation u n - 1 ,n - 1 y n - 1 + u n - 1 ,n y n = b n - 1 can be solved as y n - 1 = ( b n - 1 - u n - 1 ,n y n ) /u n - 1 ,n - 1 . And so we count backward, from n down to 1, finding one solution coefficient at each equation. In pseudocode: for j = n : -1 : 1 do the following: find y(j) end for j So let’s see how to implement “find y(j)”. The j th equation is u jj y
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: j + u j,j +1 y j +1 + ... + u jn y n = b j , and since at this point we know y j +1 ,...,y n , we can solve this for y j : y j = ( b j-n X i = j +1 u ji y i ) / u jj . The pseudocode now might be for j = n : -1 : 1 do the following: y(j) = ( b(j) - u(j,j+1:n) * y(j+1:n) ) / u(j,j) end for j That’s it! It is that simple: y(j) = (scalar - dot product ) / scalar Of course this only works when the diagonal of U has no zero elements; but that is precisely when U is nonsingular. Therefore (in exact arithmetic, at least), this method always returns the solution when a unique solution exists. What about finite precision arithmetic? It does remarkably well, in fact if ¯ y is the computed solution, then there exists a matrix E such that ( U + E )¯ y = b, where | E | ≤ n μ | U | + O( μ 2 )...
View Full Document

This note was uploaded on 12/18/2010 for the course PHYS 5073 taught by Professor Mark during the Fall '10 term at Arkansas.

Ask a homework question - tutors are online