hw3_solS09

hw3_solS09 - EE 103, Spring '09, Prof SEJ: HW 3 Sol....

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

View Full Document Right Arrow Icon
EE 103, Spring ’09, Prof SEJ: HW 3 Sol. Page 1 of 11 Applied Numerical Computing Instructor: Prof. S. E. Jacobsen HW 3 Solution Students: Distributed HW solutions are a component of the course and should be fully understood. SEJ Prob 1: (a) LU proceeds by “row”, “column”, “row”, … 1 st row of U 11 12 13 21 22 23 31 32 33 11 22 23 12 13 33 12 13 () 1( 0 0 ) 4(2 1 ) 10 24 2 0 1 34 1 0 0 4 (2 , 1 ) ( , ) ( 0 ,0 ) 0 (,) ( 2 , 1 ) uu u u u u            Now, 1 st column of L: 21 11 31 32 21 31 22 23 32 33 20 1 30 1/2 3/4 0 0 ) 4( 2 1 ) ) 2 1 / 2 0 1 3 / 4 0 u u 
Background image of page 1

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

View Full DocumentRight Arrow Icon
EE 103, Spring ’09, Prof SEJ: HW 3 Sol. Page 2 of 11 Second row of U: 22 23 32 33 22 23 32 33 22 23 32 22 32 32 22 33 33 10 42 1 / 2 (2 ,1 ) 41 3 / 4 53 / 2 5/2 7/4 2 (,)( 5 , 3 / 2 ) 5 / 2 1 / 2 3 1 nd rd uu u u column of L u row of u        U  0 4 2 1 1 / 210 05 3 / 2 3/4 1/2 1 0 0 1 A (b) To find the inverse of A, we proceed as follows: We solve each of the 3 systems 11 1 22 2 33 3 .. , , , Ax e i e LUx e to obtain x Ax e i e LUx e to obtain x Ax e i e LUx e to obtain x  by forward and backward substitution. While you were asked to do so by hand, the following are the results you should have obtained. %form the 3 unit vectors e1=[1 0 0]'; e2=[0 1 0]'; e3=[0 0 1]'; %obtain x1 y=forw(L,e1) y = 1 1/2 1 x1=back(U,y) x1 = 1/5 -2/5 -1
Background image of page 2
EE 103, Spring ’09, Prof SEJ: HW 3 Sol. Page 3 of 11 %obtain x2 y=forw(L,e2) y = 0 1 1/2 x2=back(U,y) x2 = 3/10 -7/20 -1/2 %obtain x3 y=forw(L,e3) y = 0 0 1 x3=back(U,y) x3 = 2/5 -3/10 -1 Ainv=[x1 x2 x3] Ainv = 1/5 3/10 2/5 -2/5 -7/20 -3/10 -1 -1/2 -1 %check A*Ainv 1 0 0 0 1 0 0 0 1 (c) Recall, by email message to the class the problem was changed and IGE was to be used with row interchanges if necessary. The following is the result. A = -4 -2 -1 3 4 -1 2 -4 2 %row interchange not needed; IGE pivot %in first column. P1=eye(3,3); E1=EMatP(1,A(:,1)) %SEJ is using a code E1 = 1 0 0 3/4 1 0 1/2 0 1 A1=E1*P1*A A1 = -4 -2 -1 0 5/2 -7/4 0 -5 3/2 %row interchange required; interchange %second and third rows
Background image of page 3

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

View Full DocumentRight Arrow Icon
EE 103, Spring ’09, Prof SEJ: HW 3 Sol. Page 4 of 11 P2=PMat(3,2,3) %SEJ is using a code P2 = 1 0 0 0 0 1 0 1 0 A11=P2*A1 %an intermediate matrix A11 = -4 -2 -1 0 -5 3/2 0 5/2 -7/4 %generate E2 E2=EMatP(2,A11(:,2)) %SEJ's code E2 = 1 0 0 0 1 0 0 1/2 1 A2=E2*A11 A2 = -4 -2 -1 0 -5 3/2 0 0 -1 %check U=E2*P2*E1*P1*A U = -4 -2 -1 0 -5 3/2 0 0 -1 %observe that E2*P2*E1*P1 is not
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

hw3_solS09 - EE 103, Spring '09, Prof SEJ: HW 3 Sol....

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

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