DOC PREVIEW
CSUN ME 501B - Homework Solutions

This preview shows page 1-2 out of 7 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

College of Engineering and Computer ScienceMechanical Engineering DepartmentMechanical Engineering 501BSeminar in Engineering AnalysisSpring 2009 Class: 14443 Instructor: Larry CarettoMarch 23 Homework Solutions1. 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 arehxfhxfhxfxfhhxfhxfxf2)(2)()()(2)()()(For x = 1 and h = 0.1, these expressions give the following results for f(x) = sin(x). 84077.00001.0841471.0783327.0891207.001.0)1sin(2)01.01()01.01sin()sin(549402.002.0783327.0891207.0)01.0(2)01.01()01.01sin()sin(222fdxxdfdxxdThe 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.Results for x =1 First Derivative Second Derivativeh sin(x - h) sin(x) sin(x + h) Numeric Exact Error Numeric Exact Error0.1 0.783327 0.841471 0.891207 0.539402 0.540302 9.00E-04 -0.84077 -0.84147 7.01E-040.01 0.836026 0.841471 0.846832 0.540293 0.540302 9.00E-06 -0.84146 -0.84147 7.01E-060.001 0.84093 0.841471 0.842011 0.540302 0.540302 9.01E-08 -0.84147 -0.84147 7.01E-08Results for x =0.01 First Derivative Second Derivativeh sin(x - h) sin(x) sin(x + h) Numeric Exact Error Numeric Exact Error0.1 -0.08988 0.01 0.109778 0.998284 0.99995 1.67E-03 -0.00999 -0.01 8.33E-060.01 0 0.01 0.019999 0.999933 0.99995 1.67E-05 -0.01 -0.01 8.33E-080.001 0.009 0.01 0.011 0.99995 0.99995 1.67E-07 -0.01 -0.01 8.34E-100.0001 0.0099 0.01 0.0101 0.99995 0.99995 1.67E-09 -0.01 -0.01 8.11E-110.00001 0.00999 0.01 0.01001 0.99995 0.99995 1.67E-11 -0.01 -0.01 1.99E-08There 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 Mail Code Phone: 818.677.6448E-mail: [email protected] 8348 Fax: 818.677.7062second 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 canbe 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.  ninininiTfTTfT 21111For the value of f = 0.1 computed here we have the following numerical equation to implement. ninininiTTTT 8.01.0111We can look at two approaches to the solution. In the first approach we will ignore symmetry andsimply solve the entire region 0 ≤ x ≤ 1. In this case we are solving for Ti values from i = 0 at x = 0 to i = 10 at x = 1. Since the boundary temperatures, T0 and T10 are zero, the equations for T1 and T9 can be written as follows:nnnnnnTTTTTT981912118.01.08.01.0 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 expressedas ∂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    xxxTxxTxTx25.05.005.0This 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 symmetry-plane 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.   nnnnnnnnnTTTTTTTTT54544546158.02.08.01.08.01.0 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 Mail Code Phone: 818.677.6448E-mail: [email protected] 8348 Fax: 818.677.7062March 23 homework solutions ME 501B, Spring 2009, L. S. Caretto Page 3 Table 1 -- Solutions to Problem 5, Page 646 in Hoffman Ignoring Symmetryx = 0.0 x = 0.1 x = 0.2 x = 0.3 x = 0.4 x = 0.5 x = 0.6 x = 0.7 x = 0.8 x = 0.9 x = 1.0t = 0.0 0 20 40 60 80 100 80 60 40 20 0t = 0.1 0 20 40 60 80 96 80 60 40 20 0t = 0.2 0 20 40 60 79.6 92.8 79.6 60 40 20 0t = 0.3 0 20 40 59.96 78.96 90.16 78.96 59.96 40 20 0t = 0.4 0 20 39.996 59.864 78.18 87.92 78.18 59.864 39.996 20 0t = 0.5 0 19.9996 39.9832 59.7088 77.3224 85.972 77.3224 59.7088 39.9832 19.9996 0Table 2 – Solution to Problem 5, Page 646 Considering Symmetryx = 0.0 x = 0.1 x = 0.2 x = 0.3 x = 0.4 x = 0.5t = 0.0 0 20 40 60 80 100t = 0.1 0 20 40 60 80 96t = 0.2 0 20 40


View Full Document

CSUN ME 501B - Homework Solutions

Download Homework Solutions
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Homework Solutions and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Homework Solutions 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?