College of Engineering and Computer Science Mechanical Engineering Department Mechanical Engineering 501B Seminar in Engineering Analysis Spring 2009 Class: 14443 Instructor: Larry Caretto March 9 Homework Solutions 1. Kreyszig, page 546, problem 2. Find u(x,t) on a string of length, L = 1 and c2 = 1, when the initial velocity is zero, and the initial deflection with small k (say 0.01) is k[sin x – (1/3) sin 3x]. From slide 456 of the lecture presentation for February 23, the solution to the wave equation for a vibrating string with zero initial velocity is. nct nx u( x, t ) Bn cos sin L L n 1 [1] The value for Bn is given by the following equation from slide 44 of the same lecture presentation. 2 mx Bm f ( x ) sin dx L0 L L [2] Setting L = π and applying the equation for Bm to the initial deflection in this case, f(x) = k(sin x – 0,5 sin 2x) gives. 2 2 m x f ( x ) sin dx k (sin x 0.5 sin 2 x ) sin mx dx L0 0 L L Bm 2k k sin x sin mxdx sin 2 x sin mxdx m1 0 0 2 2 m2 2k k [3] In equation [3] we recognize that the initial conditions are orthogonal to the eigenfunctions. Because of this, the Bm coefficients are nonzero only if m = 1 or m = 2. In these cases we use the result that sin 0 2 mxdx 2 for integer m. Substituting c = 1, B1 = k and B2 = -k/2 into the general solution of equation [1] gives the solution for this problem as k u( x, t ) k cos t sin x cos 2t sin 2 x 2 Engineering Building Room 1333 E-mail: lcaretto@csun.edu Mail Code 8348 [4] Phone: 818.677.6448 Fax: 818.677.7062 Solutions to March 9 homework 2. ME501B, L. S. Caretto, Spring 2009 Page 2 Kreyszig, page 546, problem 4. Find u(x,t) on a string of length, L = 1 and c2 = 1, when the initial velocity is zero, and the initial deflection with small k (say 0.01) is kx(1 – x2). This problem is done in exactly the same way as the previous problem; the solution is given by equation [1] above with the Bn coefficients given by equation [2]. For given length, L = π, and the initial conditions of this problem, f(x) = 0.1x(π2 – x2), the expression for Bm becomes. 2 2 mx 2 2 f ( x ) sin dx 0.1x( x ) sin mx dx L0 0 L L Bm [5] The integration for these initial conditions may be expressed as a combination of two separate integrals as shown below. 0.2 2 0.2 2 cos m 0.2 2 ( 1) m sin mx x cos mx x sin mx dx 0 . 2 0 m 2 m 0 m m 0.2 x 3 cos mx 3x 2 sin mx 6 sin mx 6 x cos mx x sin mx dx 0 m m2 m4 m 3 0 0.2 [6] 3 0.2 3 cos m 6 cos m 0.2 2 ( 1) m 1.2( 1) m m m3 m m3 [7] We subtract the result in equation [7] from the result in equation [6] to get the value of B m. Bm 2 2 2 0.1x( x ) sin mx dx 0 0.2 2 x sin mxdx 0.2 0 x 3 sin mx dx 0 0.2 2 ( 1) m 0.2 2 ( 1) m 1.2( 1) m 1.2( 1) m m m m 3 m3 [8] The MATLAB commands to perform this integration and the result are shown below. >> B=0.2/pi*int('x*(pi^2-x^2)*sin(m*x)',0,pi) B = -4587328911378127/36028797018963968*(m^2*pi^2*sin(pi*m)3*sin(pi*m)+3*pi*m*cos(pi*m))/m^4 >> pretty(B) 2 2 4587328911378127 m pi sin(pi m) - 3 sin(pi m) + 3 pi m cos(pi m) - ----------------- ------------------------------------------------36028797018963968 4 m >> Reducing the expression from MATLAB shows that this code gives the same result for B m as the one found by direct integration. Substituting the expression for Bm into equation [1] and setting L = π and c = 1 gives the desired solution. Solutions to March 9 homework ME501B, L. S. Caretto, Spring 2009 Page 3 ( 1)n cos nt sin nx n3 n 1 u( x, t ) 1.2 3. [9] Kreyszig, page 547, problem 12. Find the deflection u(x,t) of a string of length, L = π and c2 = 1, for zero initial displacement and “triangular” initial velocity, u t(x,0) = 0.01x if 0 ≤ x ≤ π/2 and ut(x,0) = 0.01(π – x) if π/2 ≤ x ≤ π. Here we start with the general solution to the wave equation for the case of zero displacements. This equation is derived from the general solution on slide 45 of the February 23 lecture presentation by setting Bn = 0 for zero initial displacement. (See the equation for Bn on slide 44 to see that Bn = 0 for zero initial displacements.) nct nx u ( x, t ) An sin sin L L n 1 [10] The equation for the An coefficients is also taken from slide 44. 2 mx g ( x ) sin dx mc 0 L L Am [11] Setting L = π and c = 1 and substituting the given initial velocity in equation [11] gives. 2 2 mx Am g ( x ) sin dx mc 0 m L L /2 2 0 (0.01x) sin mxdx m / 20.01( x) sin mxdx [12] The first integral is found as follows. 2 m /2 (0.01x ) sin mxdx 0 /2 0.02 sin mx x cos mx m m 2 m 0 0.02 sin m / 2 0 m m2 m / 2cosm / 2 0 0.02 sin m m cos m m m 3 2 2 [13] 2 The second integral is 2 m 0.02 cos mx sin mx x cos mx 0.01( x ) sin mxdx m m / 2 m2 m / 2 /2 0.02 m m m m m cos cos m sin m sin m cos mx cos 3 m 2 2 2 2 [14] 0.02 m cos m3 2 m m cos m m m sin m 2 2 Solutions to March 9 homework ME501B, L. S. Caretto, Spring 2009 0.02 m m m cos sin 3 m 2 2 2 Page 4 0.01 m 0.02 m 2 cos 3 sin m 2 m 2 Adding the two integrals gives Am. 2 Am m /2 2 0 (0.01x) sin mxdx m 0.02 m sin m3 2 m 2 m cos 2 0.01( x) sin mxdx /2 0.01 m 2 cos m 2 0.02 m 3 sin m 2 0.04 m 3 sin m 2 [15] The MATLAB commands and result for this problem are shown below. >> syms m x >>pretty(simplify( 0.02/(m*pi)*(int('x*sin(m*x)',0,pi/2)+int('(pix)*sin(m*x)',pi/2,pi)))) 2 sin(1/2 pi m) - sin(pi m) 1/50 --------------------------3 pi m The result for Am = (.004/m3π)sin(mπ/2) will cycle with the sine term as the remainder when m is divided by 4 (m mod 4) ranges from 0 to 3. The general result for this term is 0 0.04 m 3 Am 0 0.04 3 m m mod 4 0 m mod 4 1 m mod 4 2 m mod 4 3 [16] We can write the result when this expression for Am is substituted into equation [1] (with Bm equal to zero) by defining a new index, m = 2n + 1 which will cover all odd numbers as n ranges from zero to infinity. A factor of (-1)n will give the correct sign. With this modification, the solution for this problem becomes. u ( x, t ) 4. 0.04 ( 1)n (2n 1) n 0 3 sin( 2n 1)t sin( 2n 1) x [17] Kreyszig, page 552, problem 5. Longitudinal Vibrations of an Elastic Bar or Rod. These vibrations in the direction of the x axis are governed by the wave equation u tt = c2yxx, c2 = E/. If the rod is fastened at one end, x = 0, and free at the other, x = L, we have u(0,t) = 0 and ux(L,t) = 0 (because the force at the free end is zero). Show that the motion corresponding to initial displacement u(x,0) = 0 and initial velocity zero matches the equation given in the text. From slide 38 of the February 23 lecture notes, the general separation of variables solution for the wave equation is. Solutions to March 9 homework ME501B, L. S. Caretto, Spring 2009 Page 5 u( x, t ) Asin( ct ) B cos(ct )C sin( x) D cos(x) [19] In order to have u(0,t) = 0 we must have D = 0 to eliminate the cosine term. To evaluate the gradient boundary condition at x = L, we can take the x derivative of equation [19] after setting D = 0. u ( x, t ) A sin( ct ) B cos( ct ) C cos( x ) x [20] To match the condition that ∂u/∂x is zero at x = L, we must have cos(λL) = 0. This will be true if λL is an odd multiple of π/2. That is we must have 2n 1 [21] 2 where n is an integer greater than or equal to zero. We can rewrite our general solution in equation [19] as the sum of all possible eigenfunctions, combining constants AC and BC into two separate constants A n and Bn. u( x, t ) An sin( n ct ) Bn cos( n ct )sin( n x ) [22] n 0 Taking the time derivative of this equation will give us the velocity. u ( x, t ) n An cos( n ct ) Bn sin( n ct )sin( n x ) t n 0 [23] At t = 0, the velocity is zero. This gives the following result. u ( x,0) 0 n An cos(0) Bn sin( 0)sin( n x ) n An sin( n x ) t n 0 n 0 [24] The only way we can satisfy this initial condition is by setting all values of A n to zero. For the initial displacement, we can use an eigenfunction expansion of equation [22] (with An set to zero). n 0 n 0 u( x,0) f ( x ) Bn cos(0) sin( n x ) Bn sin( n x ) [25] If we multiply this equation by sin(λmx)dx and integrate from 0 to L we obtain the following result from the orthogonality of the eigenfunctions. 1 1 We have the usual result for the sin2 integral: Solutions to March 9 homework L ME501B, L. S. Caretto, Spring 2009 L L 0 n 0 0 f ( x ) sin( m x )dx Bn sin( n x ) sin( m x )dx Bm sin 2 (m x )dx 0 Page 6 Bm L 2 [26] This gives the result for Bm shown below. L Bm 2 f ( x ) sin( m x )dx L 0 [27] With An = 0, our solution in equation [22] becomes u( x, t ) Bn cos( n ct ) sin( n x ) [28] n 0 Other than a difference in notation, this solution (along with equation [21] for λ and equation [27] for Bm) match the solution given in the text. 5. Show that Laplace’s equation is elliptic, the heat equation is parabolic, the wave equation is hyperbolic, and the Tricomi equation , yu xx +uyy = 0 is of mixed type (elliptic in the upper half plane and hyperbolic in the lower half plane). The classification of equations is based on the general equation shown below. A 2u 2u 2u u u B C D x, y, u, , 0 2 2 x xy y x y [18] The equation is elliptic, parabolic, or hyperbolic if B2 – 4AC is less than, equal to, or greater than zero. Laplace’s equation, 2u 2u 0 , has the form of equation [18] with A = C = 1 and B = D x 2 y 2 = 0. Thus, for this equation, B2 – 4AC = 02 – (1)(1) = -1, which is less than zero. Thus Laplace’s equation is elliptic. The diffusion or heat equation, 1 u 2u 0 , has the form of equation t x 2 1 u , A = 1, and B = C = 0. Thus, B2 – 4AC = 02 – (1)(0) = 0, indicating that this t 2 2u 2 u c 0. equation is parabolic. We can write the wave equation in the following form: t 2 x 2 [18] with D = This has the general form of equation [18] with A = 1, B = D = 0, and C = -c2. Here, B2 – 4AC = 02 – (1)(-c2) = c2, indicating that the wave equation is hyperbolic. The Tricomi equation, L sin 0 L L x L L 0 2(2n 1)x sin dx L 0 2 2 2 4(2n 1) 2 (2n 1)x 2(2n 1)L L L sin 0 4(2n 1) L 2 Solutions to March 9 homework y ME501B, L. S. Caretto, Spring 2009 Page 7 2u 2u 0 , has the general form of equation [18] with A = y, B = D = 0, and C = 1. Here, x 2 y 2 B2 – 4AC = 02 – (1)(y) = –y. When y is positive, B2 – 4AC is negative indicating that the equation is elliptic. When y is negative, B2 – 4AC is negative indicating that the equation is hyperbolic. Thus the Tricomi is hyperbolic in the lower half plane and elliptic in the upper half plane. Along the horizontal (y = 0) axis, the equation is parabolic.