Presentation is loading. Please wait.

Presentation is loading. Please wait.

Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.

Similar presentations


Presentation on theme: "Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00."— Presentation transcript:

1 Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00

2 2 22 Lecture 27 Schedule  The last homework HW5 and the last project are due on Tuesday November 24!!  Students who have opted for research projects instead of the final should present their projects on Tuesday December 1 st  We’ll have a class review on Thursday December 3 rd.  The final is scheduled for Thursday December 10, 10 AM to 12:50 PM. Last time:  More accurate estimation of integrals (chapter 18) Romberg integration Gauss quadrature Adaptive quadrature Today:  Numerical differentiation (chapter 19). Next Time – Projects presentations

3 3 Finite differences and derivatives Finite differences: As  x approaches zero, the finite difference approaches the derivative of the function y=f(x):

4 4 Numerical differentiation formulas Taylor series expansion can be used to generate high-accuracy formulas for derivatives by using linear algebra to combine the expansion around several points.  forward finite-difference,  backward finite-difference, and  centered finite-difference.

5 5 Forward finite-difference

6 6 Backward finite-difference

7 7 Centered finite-difference

8 8 Richardson extrapolation As with integration, the Richardson extrapolation can be used to combine two lower- accuracy estimates of the derivative to produce a higher-accuracy estimate. For the cases where there are two O(h 2 ) estimates and the interval is halved (h 2 =h 1 /2), an improved O(h 4 ) estimate may be formed using: For the cases where there are two O(h 4 ) estimates and the interval is halved (h 2 =h 1 /2), an improved O(h 6 ) estimate may be formed using: For the cases where there are two O(h 6 ) estimates and the interval is halved (h 2 =h 1 /2), an improved O(h 8 ) estimate may be formed using:

9 9 Unequally spaced data One way to calculated derivatives of unequally spaced data is to determine a polynomial fit and take its derivative at a point. Example: use a second-order Lagrange polynomial to fit three points and takke its derivative yields:

10 10 Data errors and numerical integration and differentiation Numerical differentiation  tends to amplify errors in data, Numerical integration  tends to smooth data errors. One approach for taking derivatives of data with errors is to fit a smooth, differentiable function to the data and take the derivative of the function.

11 11 Built-in functions for numerical differentiation diff(x)  Returns the difference between adjacent elements in x diff(y)./diff(x)  Returns the difference between adjacent values in y divided by the corresponding difference in adjacent values of x fx = gradient(f, h)  Determines the derivative of the data in f at each of the points.  h is the spacing between points; if omitted h=1.  Uses forward difference for the first point, backward difference for the last point, and centered difference for the interior points.  The result is the same size as the original data.  Gradient can also be used to find partial derivatives for matrices. [fx, fy] = gradient(f, h)


Download ppt "Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00."

Similar presentations


Ads by Google