College of Engineering and Computer Science Mechanical Engineering Department Mechanical Engineering 501B Seminar in Engineering Analysis Spring 2009 Class 14443 Instructor Larry Caretto March 23 Homework Solutions 1 Evaluate the first and second derivatives of sin x at x 1 radian using second order central difference expressions Use step sizes of h 0 1 0 01 and 0 001 Compute the error for each numerical result and use the relationship between the error and the step size to infer the order of the error Repeat the calculation of the first derivative for x 0 01 radian using step sizes of 0 001 and 0 0001 What order do your results imply at this point Comment on any differences between the results to this problem and the previous one The second order central difference equations for the first and second derivatives are f x f x h f x h 2h f x f x h f x h 2 f x 2h For x 1 and h 0 1 these expressions give the following results for f x sin x d sin x sin 1 0 01 f 1 0 01 0 891207 0 783327 0 549402 dx 2 0 01 0 02 d 2 sin x sin 1 0 01 f 1 0 01 2 sin 1 0 891207 0 783327 0 841471 0 84077 dx 2 0 0001 0 01 2 The exact values of the first and second derivatives are 0 539402 and 0 841471 This gives an error of 0 000900 and 0 000701 in the first and second derivative respectively The results of all the calculations are shown in the table below h 0 1 0 01 0 001 h 0 1 0 01 0 001 0 0001 0 00001 Results for x 1 sin x h sin x 0 783327 0 841471 0 836026 0 841471 0 84093 0 841471 Results for x 0 01 sin x h sin x 0 08988 0 01 0 0 01 0 009 0 01 0 0099 0 01 0 00999 0 01 sin x h 0 891207 0 846832 0 842011 sin x h 0 109778 0 019999 0 011 0 0101 0 01001 First Derivative Second Derivative Numeric Exact Error Numeric Exact Error 0 539402 0 540302 9 00E 04 0 84077 0 84147 7 01E 04 0 540293 0 540302 9 00E 06 0 84146 0 84147 7 01E 06 0 540302 0 540302 9 01E 08 0 84147 0 84147 7 01E 08 First Derivative Second Derivative Numeric Exact Error Numeric Exact Error 0 998284 0 99995 1 67E 03 0 00999 0 01 8 33E 06 0 999933 0 99995 1 67E 05 0 01 0 01 8 33E 08 0 99995 0 99995 1 67E 07 0 01 0 01 8 34E 10 0 99995 0 99995 1 67E 09 0 01 0 01 8 11E 11 0 99995 0 99995 1 67E 11 0 01 0 01 1 99E 08 There is no difference between the results for x 1 and x 0 01 for the values of h given in the table Both sets of calculations show that the error decreases by a factor of 100 as the step size decreases by a factor of 10 This is the expected behavior for a second order error At smaller step sizes shown in the table for x 0 01 we start to see roundoff error in the results for the Jacaranda Engineering Room 3333 E mail lcaretto csun edu Mail Code 8348 Phone 818 677 6448 Fax 818 677 7062 second derivative At a step size of 0 0001 the error only decreases by a factor of 10 instead of 100 At a step size of 0 00001 the error actually increases when the step size is decreased 2 Hoffman page 646 problem 5 By hand calculation determine the solution of the example heat diffusion problem by the FTCS method at t 0 5 for x 0 1 cm and t 0 1 s Information about the example problem shown on page 600 can be found from the text tables and figures with the results It has the following data inputs 0 01 cm2 s boundary temperatures of zero a range for x as 0 x 1 and a triangular initial temperature profile that can be inferred from Table 10 2 on page 601 to have the following equations T x 0 200x for 0 x 0 5 and T x 0 200 200x for 0 5 x 1 In this problem we are asked to use x 0 1 cm and t 0 1 s so f t x 2 01 0 1 0 1 2 0 1 The FTCS method which we have called the explicit method in class has the following finite difference equation Ti n 1 f Ti n 1 Ti n 1 1 2 f Ti n For the value of f 0 1 computed here we have the following numerical equation to implement Ti n 1 0 1 Ti n 1 Ti n 1 0 8Ti n We can look at two approaches to the solution In the first approach we will ignore symmetry and simply solve the entire region 0 x 1 In this case we are solving for T i values from i 0 at x 0 to i 10 at x 1 Since the boundary temperatures T 0 and T10 are zero the equations for T1 and T9 can be written as follows T1n 1 0 1T2n 0 8T1n T9n 1 0 1T8n 0 8T9n Applying these equations for five time steps gives the results shown in Table 1 on the next page We see that we have obtained a symmetric result as we expected We can take advantage of this symmetry to reduce the work required for the calculations To do this we solve only from x 0 to x 0 5 with a symmetry boundary condition at x 0 5 This symmetry condition is expressed as T x 0 at x 0 5 If we represent this zero derivative by a second order central difference expression for the first derivative we have 0 T x x 0 5 T x 0 5 x T x 0 5 x 2 x This equation tells us that the two temperatures on either side of the symmetry plane are equal In this problem with x 0 1 this tells us that T6 the temperature to the right of the symmetryplane temperature T5 is the same as T4 the temperature to the left Thus we can write our general finite difference equation for T5 as follows T5n 1 0 1 T6n T4n 0 8T5n 0 1 T4n T4n 0 8T5n 0 2T4n 0 8T5n Applying this equation for the same five time steps gives the results shown in Table 2 below These are seen to be exactly the same results as those obtained by ignoring symmetry Jacaranda Engineering Room 3333 E mail lcaretto csun edu Mail Code 8348 Phone 818 677 6448 Fax 818 677 7062 March 23 homework solutions t 0 0 t 0 1 t 0 2 t 0 3 t 0 …
View Full Document