This preview shows pages 1–4. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 18.085 Problem Set 2 Robert Yi February 17, 2011 Section 1.1: 12, 26. Section 1.2: 14. Section 1.3: 8, 10. Section 1.4: 7, 8, 12. Section 1.5: 2, 13, 23, 29 Section 1.1 12. Carry out elimination on the 4 by 4 circulant matrix C 4 to reach an upper triangular U (or try [ L,U ] = lu ( C ) in MATLAB). Two points to notice: The last entry of U is because C is singular. The last column of U has new nonzeros. Explain why this fillin happens. Entering in the code [ L,U ] = lu ( C ) in MATLAB gives C = [ 2 1 0 1 ; 1 2 1 0 ; 0 1 2 1; 1 0 1 2 ] C = 2111 211 2111 2 >> [L, U]=lu(C) L = 1.00000.5000 1.00000.6667 1.00000.50000.33331.0000 1.0000 U = 2.00001.00001.0000 1.50001.00000.5000 1.33331.3333 0.0000 U is our upper triangular matrix, achieved via row reduction. The last entry of U is 0 (and hence the entire row) because C is singular. To preserve singularity, the fillin must occur to make the row still add to one. 1 26. For which vectors v is toeplitz ( v ) a circulant matrx (cyclic diagonals)? Lets write the form of a generic circulant n by n matrix. We get For an n by n matrix, we have n 1 n 2 n 3 ... n n n n n 1 n n 1 n n 1 n n . . . n n 2 . . . . . . n 2 n 3 ... n 1 But for a toeplitz matrix, we need this to be symmetric. So our restriction is n 2 = n n , n 3 = n n 1 , n 4 = n n 2 , etc. Or in other words, aside from the first entry of vector v , which has no restriction, the rest of the vector must be symmetric about its middle term (or lack thereof). E.g. in the vector [2 10 1], the vector, aside from the first entry 2, is symmetric about 0, the center of the remaining vector. Section 1.2 14 Part (a). Solve u 00 = 12 x 2 with freefixed conditions u (0) = 0 and u (1) = 0 . The complete solution involves integrating f ( x ) = 12 x 2 twice, plus Cx + D . Solving this without finite differences, but directly gives us u 00 = 12 x 2 u = 4 x 3 + C, and u (0) = 0 = C u = x 4 + D, and u (1) = 0 = 1 + D D = 1 u = x 4 + 1 Part (b). With h = 1 n +1 and n = 3 , 7 , 15 , compute the discrete u 1 ,...,u n using T n : u i +1 2 u i + u i 1 h 2 = 12( ih ) 2 with u = 0 and u n +1 = 0 Compare u i with the exact answer at the center point x = ih = 1 / 2 . Is the error proportional to h or h 2 ? The MATLAB code for constructing matrix T and vector v , and solving for u is n=3; h=1/(n+1); Tn = toeplitz([2 1 zeros(1,n2)]); Tn(1,1) = 1; v=[1:n]; for i=1:n; v(i) = 12*(v(i)*h)^2; end u=(Tn/(h^2))\v 2 For n = 3, the output from MATLAB is: u = 0.9375 0.8906 0.6563 For x = ih = 1 / 2, or i = 1 / 2 1 / 4 = 2,...
View
Full
Document
This note was uploaded on 06/16/2011 for the course MATH 18.085 taught by Professor Staff during the Winter '10 term at MIT.
 Winter '10
 staff

Click to edit the document details