Assignment 2 solutions

Assignment 2 solutions - MIT OpenCourseWare...

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

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

Unformatted text preview: MIT OpenCourseWare http://ocw.mit.edu 18.085 Computational Science and Engineering I Fall 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. 18.085 - Mathematical Methods for Engineers I Prof. Gilbert Strang Solutions - Problem Set 2 Section 1.3 7) Suppose A is rectangular (m by n) and C is symmetric (m by m) matrix i) (AT C A)T = AT C T (AT )T = AT CA � AT CA is symmetry # (AT )n×m (C )m×m (A)m×n � AT CA is (n × n) # . . �. � a1 ii) Let A = ⎭ . . . � � . . . a2 . . . . . . a3 . . . ⎢ . . .⎧ an ⎧ ⎨ . . . . . . a1 . . . ... .. . . . a2 . . . ... since C = C T (symmetric) Since aT ai = a2 → 0, we conclude that i i AT A has no negative numbers on its diagonal # � ⎬ 13 A= 32 � ⎬ �⎬ 10 1 3 = 31 0 −7 �⎬ ⎬ �⎬ � 0 13 10 1 = 01 31 0 −7 � �� � � �� � � �� � L D LT # � � AT A = � · · · a T 2 ⎭ · · · aT n �T a1 a1 �. �. . =� . � ⎭. . ... · · · aT · · · 1 ⎧� ⎧ ··· ⎧� ⎨⎭ ··· ... aT a2 2 ⎢� ⎢ . . .⎧ an ⎧ ⎨ . . . ⎢ ⎧ ⎧ ⎧ ⎧ ⎨ . aT an n 1 A= = ⎬ ⎬ ⎬ 1b bc 10 b1 � 21 A=⎭1 2 01 � 1 = ⎭ 1/2 0 � 1 = ⎭ 1/2 0 � Section 1.4 �⎬ �⎬ � 10 1 0 1b = 01 b1 0 c − b2 � �� � � �� � � �� � L D LT �⎬ 1 b 0 c − b2 � # � ⎢ 00 1 0⎨ 2/3 1 ⎢ 00 1 0⎨ 2/3 1 �� � L ⎢ 0 1 ⎨ 2 ⎢ 21 0 ⎭ 0 3/2 1/2 ⎨ 0 0 4/3 � ⎢� ⎢ 20 0 1 1/2 0 ⎭ 0 3/2 0 ⎨ ⎭ 0 1 2/3 ⎨ 0 0 4/3 00 1 � �� �� �� � D LT � 3) −u �� = � (x − 1/3) + � (x − 2/3) General Fixed-Fixed Solution � (1 − a)x , x � a u= (1 − x)a , x → a −u �� = � (x − 1/3) � (1 − 1/3)x , x � 1/3 u= (1 − x)1/3 , x → 1/3 −u �� = � (x − 2/3) � (1 − 2/3)x , x � 2/3 u= (1 − x)2/3 , x → 2/3 Combining two single-load solutions: ⎡ ⎥(1 − 1/3)x + (1 − 2/3)x , x � 1/3 ⎣ u = (1 − x)1/3 + (1 − 2/3)x , 1/3 � x � 2/3 ⎥ ⎤ (1 − x)1/3 + (1 − x)2/3 , x → 2/3 ⎡ ⎥x for x � 1/3 ⎣ = 1/3 for 1/3 � x � 2/3 ⎥ ⎤ 1 − x for x → 2/3 # 2 Second Method ⎡ ⎥Ax + B ⎣ u(x) = C x + D ⎥ ⎤ Ex + F u(0) = 0 A · 0+B =0 �B =0 0 , x � 1/3 , 1/3 � x � 2/3 , x → 2/3 # � A(1/3) +� = C (1/3) + D B A = C + 3D A−1 =C C (2/3) + D = E (2/3) + F 2C + 3D = 2E + 3F C −1 =E E (1) + F = 0 E = −F � 1 � 3 � 2 � 5 � 6 � 4 �� � 2 3 C C � + 3D − 1 = � 1 D= 3# �� � 6 4 2C + 3(1/3) = 2E + 3(−E ) 2C + 1 = −E � 7 � −2×� 7 5 1 + 3 = −3E E = −1 # C = 1 + E = 1 + (−1) � C = 0# E = −F � F = 1# A − 1 = C A = 1 + 0 � A = 1# ⎡ ⎥x ⎣ � u(x) = 1/3 ⎥ ⎤ 1−x , x � 1/3 , 1/3 � x � 2/3 , x → 2/3 3 5) Free-Free condition u(x) = −R(x − a) + C x + D u � (1) = 0 u � (0) = 0 u � (0) = 0 + C = 0 � C = 0 u � (1) = −1 + C = 0 �C =1 � There are no solutions for C and D C cannot be 0 and 1 at the same time 7) f (x) = � (x − 1/3) − � (x − 2/3) u � (1) = 0 u � (0) = 0, ⎡ ⎥Ax + B ⎣ u(x) = C x + D ⎥ ⎤ Ex + F , x � 1/3 , 1/3 � x � 2/3 , x → 2/3 # u � (0) = A = 0 # �0 A �� �(1/3) + B = C (1/3) + D 3B = C + 3D A −1 = C � C = −1 # � 2 C (2/3) + D = E (2/3) + F 2C + 3D = 2E + 3F C +1 = E E = 0# d (Ex + F ) = 0 dx E =0 From � 3 2C + 3D = 3F 3D = 3F − 2C = 3F + 2 D = F + 2/3 From � 2 3B = −1 + 3D B= −1 + 3F + 2 3 = F + 1/3 ⎩ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ � � 3 redundant, less one equation 4 F can take any value F ≤ R ⎡ , x � 1/3 ⎥F + 1/3 ⎥ ⎣ u(x) = −x + F + 2/3 , 1/3 � x � 2/3 ⎥ ⎥ ⎤ F , x → 2/3 � infinitely many solutions for u(x) # ⎡ ⎣0 , x�0 ���� = � (x) 12) u , C (x) = x3 ⎤ , x→0 6 u(x) = C (x) + Ax3 + B x2 + Gx + D Given that u(1) = 0 u(−1) = 0 u �� (−1) u �� (1) = 0 =0 Cubic spline C (x) is a particular solution for u u(1) = 1 +A+B+G+D =0 6 A+B+G+D =− 1 6 � 1 � 2 u(−1) = 0 + (−A) + B − G + D = 0 A−B+G−D =0 u �� (1) = 1 + 6A(1) + 2B = 0 6A + 2B = −1 u �� (−1) = 0 − 6A + 2B = 0 � B = 3A A=− − − 1 12 1 12 1 1 B =− 4# 12 # ⎪ ⎫ 1 1 +− +G+D =− 4 6 ⎪ ⎫ 1 −− +G−D =0 4 1 6 1 6 D= 1 6# � 3 G+D = G−D =− �G=0 , � u(x) = C (x) − 1 3 12 1 x− x+ 12 4 6# 5 Section 1.5 ⎬ � 2 −1 1) K = 2 −1 1 Q= ∗ 2 � ⎬ � 1 1 10 �= 1 −1 03 � ⎬ �⎬ �⎬ 1 1 1 1 10 1 1 ∗ Q�QT = ∗ 03 1 −1 2 1 −1 2 � ⎬ �⎬ 11 3 1 1 = 1 −3 1 −1 2 � ⎬ 1 4 −2 = 4 2 −2 � ⎬ 2 −1 = 2 −1 ⎬ =K# 4) >> K = toeplitz([2 − 1 zeros(1, 3)]); >> [Q, E ] = eig(K ); >> [DST = Q � diag([−1 − 1 DST = 0.2887 0.5000 0.5000 0.5774 0.5000 0.0000 0.2887 0.5774 1 −1 1]) ⎩ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ 0.5774 −0.0000 −0.5774 0.2887 −0.5000 0.5000 −0.0000 −0.5000 −0.5000 0.5000 −0.5000 0.2887 0.5000 −0.5000 −0.0000 0.5774 −0.5000 >> J K = [1 : 5]� � [1 : 5]; ans = 0.2887 0.5000 0.5774 0.5000 0.5000 >> sin(JK � pi/6)/sqrt(3) 0.5774 0.0000 0.5000 −0.5000 −0.0000 0.2887 −0.5000 0.0000 −0.5774 0.5774 ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ 0.5000 0.2887 ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ −0.5000 −0.5000 ⎥ ⎥ ⎥ ⎥ ⎥ −0.0000 0.5774 ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ 0.5000 −0.5000 ⎥ ⎥ ⎥ � −0.5000 0.2887 DST = sin(JK � pi/6)/sqrt(3) 6 >> DST � ans = 0.2887 0.5000 0.5000 0.5774 0.5000 ⎩ 0.2887 ⎥ ⎥ ⎥ ⎥ ⎥ −0.5000 ⎥ ⎥ ⎥ ⎥ ⎥ 0.5774 ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ −0.5000 ⎥ ⎥ ⎥ ⎥ ⎥ 0.2887 ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦ 0.5774 −0.0000 −0.5774 −0.0000 0.5000 −0.5000 0.0000 0.2887 −0.5000 0.5000 −0.0000 −0.5000 0.5000 0.5774 −0.5000 >> inv(DST ) ans = 0.2887 0.5000 0.5000 0.5774 DST � = inv(DST ) 0.5774 −0.0000 −0.5774 0.2887 −0.5000 2 −1 0.5774 ⎢ 0.5000 −0.0000 0.5000 −0.5000 −0.0000 7) � � −1 2 −1 0 C4 = � � 0 −1 2 −1 ⎭ −1 0 −1 2 [Q, E ] = eig(C4 ) � 1/2 ∗ 1/ 2 � 0 −1 ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ 0.5000 0.2887 ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ −0.5000 −0.5000 ⎥ ⎥ ⎥ ⎥ ⎥ −0.0000 0.5774 ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ 0.5000 −0.5000 ⎥ ⎥ ⎥ ⎥ � −0.5000 0.2887 ⎥ ⎧ ⎧ ⎧ ⎧ ⎨ � � 1/2 0 � Q=� ∗ ⎭ 1/2 −1/ 2 1/2 0 � �1 i F =� � 1 i2 ⎭ 1 i3 � 1 1 1 i2 i4 i6 1 0 ∗ 1/ 2 0 ∗ −1/ 2 ⎢ � 1 −1/2 ⎧ 1/2 ⎧ ⎧ ⎧ −1/2 ⎨ 1/2 1 ⎢ � � E=� � ⎭ 1 ⎧ ⎧ ⎧ ⎧ ⎨ ⎢ � 0 2 0 2 0 4 ⎧ ⎧ ⎧ ⎧ ⎨ ⎢ 1 ⎧� i3 ⎧ � 1 i −1 −i ⎧=� � 1 −1 6⎧ 1 −1 i⎨ ⎭ 9 i 1 −i −1 i f1 = a 1 q1 + a 2 q2 + a 3 q3 + a 4 q4 f2 = b 1 q1 + b 2 q2 + b 3 q3 + b 4 q4 f3 = c 1 q1 + c 2 q2 + c 3 q3 + c 4 q4 f4 = d 1 q1 + d 2 q2 + d 3 q3 + d 4 q4 7 [f1 f2 f3 f4 ] = [q1 q2 q3 q4 ] � a1 b1 c1 d1 � � a 2 b2 c2 � �a b c ⎭3 3 3 a 4 b4 c4 � �� denote by fi and qi are the column i of their respective matrix F = QA Q−1 QA = Q−1 F A = Q−1 F From MATLAB � 2 0 ∗ � �0 2 A=� ∗ � 2i ⎭0 0 � 1 ⎧ d2 ⎧ ⎧ d3 ⎧ ⎨ d4 � A ⎢ 0 0 −2 0 0 ∗ 0 2 ∗ 0 − 2i 0 ⎢ ⎧ ⎧ ⎧ ⎧ ⎨ # 0 9) � � −1 1 0 �− = � � 0 −1 1 ⎭ 0 0 −1 �− T �− 1 −1 0 � 1 −1 =⎭0 0 0 � = ⎭ −1 � 2 −1 � 0 ⎢ ⎧ ⎧ ⎧ ⎧ ⎨ 4×3 � � 1 0 ⎧ � −1 0 ⎨� 1 ⎭ 1 −1 1 −1 0 −1 0 0 2 ⎢ ⎢ � 1 0 0 ⎢ ⎧ ⎧ ⎧ ⎧ ⎨ 0 −1 ⎧ 2 −1 ⎨ = K3 ⎢ # �− �− T � 1 0 � � −1 1 � =� ⎭ 0 −1 0 � ⎢ 0 0 ⎧ 1 −1 0 ⎧� ⎧ ⎧ 1 −1 0⎨ ⎧⎭ 0 1⎨ 0 0 1 −1 0 −1 0 8 � � −1 2 −1 0 =� � 0 −1 2 −1 ⎭ 0 0 −1 1 � ⎧ eig(K3 ) = ⎭ 2.0000 ⎨ 3.4142 [u s v ] = svd(�− ) � 1.8478 1.4142 � 0.5858 ⎢ � 1 −1 0 0 ⎢ ⎧ ⎧ ⎧ = B4 ⎧ ⎨ # s=⎭ ⎢ 0.7654 ⎧ ⎨ 2 �1 = 1.84782 = 3.4142 = �3 2 �2 = 1.41422 = 2 = �2 2 �3 = 0.76542 = 0.5858 = �1 � The eigenvalues of K3 are the squared singular values � 2 of �− # 9 ...
View Full Document

Ask a homework question - tutors are online