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 7 3.4, Problem 4. Show that u = r cos ∂ + r −1 cos ∂ solves Laplace’s equation (13), and express u in terms of x and y. Find v = (ux , uy ) and verify that v · n = 0 on the circle x2 + y 2 = 1. This is the velocity of flow past a circle in Figure 3.18. Show u = r cos ∂ + r −1 cos ∂ solves Laplace’s equation: Laplace’s equation in r, ∂ is: � 2 u 1 �u 1 �2u + + 2 2 = 0. 2 �r r �r r �∂ (13) Now, if u = r cos ∂ + r −1 cos ∂, then �u = cos ∂ − r−2 cos ∂ �r �2u = 2r−3 cos ∂ �r2 �u = −r sin ∂ − r−1 sin ∂ �∂ �2u = −r cos ∂ − r −1 cos ∂. �∂2 Plugging this into the left-hand side of (13), we get 1 1 1 2r−3 cos ∂ + (cos ∂ − r−2 cos ∂) + 2 (−r cos ∂ − r −1 cos ∂) = (2 − 1 − 1)r −3 cos ∂ + (1 − 1) cos ∂ = 0, r r r as desired. U in (x, y): Now, since x = r cos ∂, y = r sin ∂ � r = ⎛ x2 + y 2 , ∂ = tan−1 u = r cos ∂ + r−1 cos ∂ = x + So �y� x . So x x(1 + x2 + y 2 ) = . x2 + y 2 x2 + y 2 �u (x2 + y 2 ) · 1 − x(2x) y 2 − x2 =1+ = 1 + . �x (x2 + y 2 )2 (x2 + y 2 )2 �u −2xy = 0 + x(−1 · (x2 + y 2 )−2 · 2y) = 2 . �y (x + y 2 )2 So v= � 1+ y 2 − x2 −2xy , 2 2 2 2 (x + y ) (x + y 2 )2 � . v · n = 0: n = (x, y) is normal to the circle v = (1 + y 2 − x2 , −2xy) on the circle v · n = x − x3 − xy 2 = x − x(x2 + y 2 ) = 0 on the circle 1 sinh(�ky) 3.4, Problem 17. Verify that uk (x, y) = sin(�kx) solves Laplace’s equation for k = 1, 2, . . .. Its sinh(�k) boundary values on the unit square are u0 = sin(�kx) along y = 1 and ub = 0 on the three lower edges. z −z Recall that sinh (x) = e −e . 2 u = uk (x, y) = sin(�kx) 12 (e�ky − e−�ky ) 1 �k 2 (e �u e�ky − e−�ky = �k cos(�kx) · �k �x e − e−�k 2 � u e�ky − e−�ky 2 2 = −� k sin(�kx) · �x2 e�k − e−�k So − e−�k ) . �u �ke�ky + �ke−�ky = sin(�kx) · �y e�k − e−�k 2 2 2 �ky � u � k (e − e−�ky ) = sin(�kx) · �y 2 e�k − e−�k �2u �2u + 2 = 0. �x2 �y 3.6, Problem 6. Solve Poisson’s equation −uxx − uyy = 1 with u = 0 on the standard unit triangle T using Persson’s code with h = 0.25. The mesh information is in the lists p, t, and b (boundary nodes) : 15 nodes, 16 triangles, 12 boundary nodes (nodes numbered by rows). 1 15 (0, 1) 16 .75 13 (0, .75) 14 (.25, .75) 14 .5 .25 13 15 10 (0, .5) 11 (.25, .5) 9 11 8 10 12 6 (0, .25) 7 (.25, .25) 8 (.5, .25) 2 4 1 1 (0, 0) 0 12 (.5, .5) 6 3 5 2 (.25, 0) .25 9 (.75, .25) 3 (.5, 0) .5 2 7 4 (.75, 0) .75 5 (1, 0) 1 ⎤ � � � � � � � � � � � � � p=� � � � � � � � � � � � 0 .25 .5 .75 1 0 .25 .5 .75 0 .25 .5 0 .25 0 0 0 0 0 0 .25 .25 .25 .25 .5 .5 .5 .75 .75 1 ⎜ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎢ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ⎤ � � � � � � � � � � � � � � t=� � � � � � � � � � � � � 1 2 2 3 3 4 4 6 7 7 8 8 10 11 11 13 2 7 3 8 4 9 5 7 11 8 12 9 11 14 12 14 contourf(xx,yy,zz); 3 6 6 7 7 8 8 9 10 10 11 11 12 13 13 14 15 ⎜ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎢ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ⎤ � � � � � � � � � � b=� � � � � � � � � 1 2 3 4 5 6 9 10 12 13 14 15 ⎜ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎡ ⎢ 3.6, Problem 9. The square drawn below has 8 nodes rather than the usual 9 for biquadratic Q 2 . Therefore we remove the x2 y 2 term and keep U = a1 + a2 x + a3 y + a4 x2 + a5 xy + a6 y 2 + a7 x2 y + a8 xy 2 . Find the λ(x, y) which equals 1 at x = y = 0 and zero at all other nodes. � 1 ⎝ 0 ⎝ ⎝ 0 ⎝ ⎝ 0 ⎝ ⎝ 0 ⎝ ⎝ 0 ⎝ ⎞ 0 0 ⎟ ⎣ ⎣ ⎣ ⎣ ⎣ ⎣ ⎣ ⎣ ⎣ ⎣ ⎠ λ We solve for a to obtain �x=0, y=0 �x=1, y=0 �x=0, y=1 �x=.5, y=0 �x=0, y=.5 �x=.5, y=1 �x=1, y=.5 �x=1, y=1 � 1 0 0 0 ⎝ 1 1 0 1 ⎝ ⎝ 0 ⎝ 1 0 1 ⎝ 1 .5 0 .25 = ⎝ ⎝ ⎝ 1 0 .5 0 ⎝ ⎝ 1 .5 1 .25 ⎞ 1 1 .5 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 .25 0 0 .5 1 .25 .5 .5 .25 .5 .25 1 1 1 1 = xy � 1 ⎝ −3 ⎝ ⎝ −3 ⎝ ⎝ 2 a = xy\λ = ⎝ ⎝ 5 ⎝ ⎝ −2 ⎝ ⎞ −2 −2 ⎟� ⎣⎝ ⎣⎝ ⎣⎝ ⎣⎝ ⎣⎝ ⎣⎝ ⎣⎝ ⎣⎝ ⎣⎝ ⎣⎝ ⎠⎞ a1 a2 a3 a4 a5 a6 a7 a8 a ⎟ ⎣ ⎣ ⎣ ⎣ ⎣ ⎣. ⎣ ⎣ ⎣ ⎣ ⎠ Alternatively, we can use Method B and set λ(x, y) = a1 + a2 x + a3 y + a4 x2 + a5 xy + a6 y 2 + a7 x2 y + a8 xy 2 . Then 1 − 3x + 2x2 = λ(x, 0) = a1 + a2 x + a4 x2 , so that a1 = 1, a2 = −3, a4 = 2. Likewise, 1 − 3y + 2y 2 = λ(0, y) = a1 + a3 y + a6 y 2 , so that a1 = 1, a3 = −3, a6 = 2. But 0 = λ(x, 1) = a1 + a2 x + a3 + a4 x2 + a5 x + a6 + a7 x2 + a8 x, so that a1 + a 3 + a 6 = 0 a2 + a 5 + a 8 a4 + a 7 = 0 = 0. From this, we can conclude that a7 = −2 and a5 + a8 = 3. Finally, 0 = λ(1, y) = a1 + a2 + a3 y + a4 + a5 y + a6 y 2 + a7 y + a8 y 2 , so that a1 + a 2 + a 4 = 0 a3 + a 5 + a 7 a6 + a 8 = 0 = 0. 4 ⎟ ⎣ ⎣ ⎣ ⎣ ⎣ ⎣. ⎣ ⎣ ⎣ ⎣ ⎠ From this, we know that a8 = −2, a5 = 5. So again, � ⎝ ⎝ ⎝ ⎝ ⎝ a=⎝ ⎝ ⎝ ⎝ ⎝ ⎞ 1 −3 −3 2 5 −2 −2 −2 ⎟ ⎣ ⎣ ⎣ ⎣ ⎣ ⎣. ⎣ ⎣ ⎣ ⎣ ⎠ ⎥ 2 −1 −1 2 gives the oscillation frequencies for two unequal masses in a line of springs. 3.6, Problem 16. Find the eigenvalues of KU = �M U if K = M −1 KU KU det(M −1 K − �I) M M −1 K= 1 0 0 .5 ⎦ 2 −1 −.5 1 ⎦ = ⎥ −1 ⎥ ⎦ and M = = �M U = �U = 0 ⎦ � 0 �I = 0 � ⎥ 2−� −1 M K= −.5 ⎥ (2 − �)(1 − �) − (−1)(−.5) = 0 3 + 3 or − �2 − 3� + 1.5 = 0 2 � � = 5 −1 1−� � ⎦ 3−3 . 2 ⎥ 1 0 0 2 ⎦ . This