320 likes | 357 Views
Chapter 21 Numerical Differentiation. Numerical Differentiation Chapter 21. Numerical differentiation has been introduced several times in this course. In this chapter more accurate formulas that retain more terms will be developed. First Let’s Review A little.
E N D
Chapter 21 Numerical Differentiation
Numerical DifferentiationChapter 21 • Numerical differentiation has been introduced several times in this course.In this chapter more accurate formulas that retain more terms will be developed.
First Let’s Review A little • We were first introduced to numerical differentiation in Chapter 4 – section 4.3.4
Numerical Differentiation First forward difference
Numerical Differentiation First backward difference
Numerical Differentiation First centered difference
What if you wanted to find the acceleration, based on this data?
h h h h h h Equation 4.24
Now that we’ve reviewed let’s look at some more sophisticated methods for finding derivatives – in chapter 21
High Accuracy Differentiation Formulas • High-accuracy divided-difference formulas can be generated by including additional terms from the Taylor series expansion. Solve for
Inclusion of the 2nd derivative term has improved the accuracy to O(h2). • Similar improved versions can be developed for the backward and centered formulas as well as for the approximations of the higher derivatives.
Richardson Extrapolation • We’ve looked at two ways to improve derivative estimates when employing finite divided differences: • Decrease the step size, or • Use a higher-order formula that employs more points. • A third approach, based on Richardson extrapolation, uses two derivative estimates to compute a third, more accurate approximation.
Recall that Richardson extrapolation was used in Romberg integration • For centered difference approximations with O(h2). The application of this formula yields a new derivative estimate of O(h4).
Derivatives of Unequally Spaced Data • Data from experiments or field studies are often collected at unequal intervals. One way to handle such data is to fit a second-order Lagrange interpolating polynomial. x is the value at which you want to estimate the derivative.
Derivatives and Integrals for Data with Errors Differentiation tends to amplify errors Integration tends to smooth out errors
Built-In Matlab Functions • diff • Assumes a spacing of 1 • gradient • Forward difference • Central difference • Backward difference • A single input assumes a spacing of 1 • Second field is available to specify the spacing
Summary • Higher Order Derivative Approximations • Richardson Extrapolation • Built-In MATLAB functions • diff • gradient • Quiver Plots