Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 21 Numerical Differentiation.

Similar presentations


Presentation on theme: "Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 21 Numerical Differentiation."— Presentation transcript:

1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 21 Numerical Differentiation

2 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 2 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.

3 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. First Let’s Review A little We were first introduced to numerical differentiation in Chapter 4 – section 4.3.4 3

4 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 Numerical Differentiation First forward difference

5 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5 Numerical Differentiation First backward difference

6 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 6 Numerical Differentiation First centered difference

7 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Consider some data 7 Time, sDistance, mVelocity, m/s Forward difference Backward difference Centered difference 00 15 215 330 450 575 6105

8 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Consider some data 8 Time, sDistance, mVelocity, m/s Forward difference Backward difference Centered difference 005 1510 215 33020 45025 57530 6105

9 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Consider some data 9 Time, sDistance, mVelocity, m/s Forward difference Backward difference Centered difference 005 15105 215 10 3302015 4502520 5753025 610530

10 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Consider some data 10 Time, sDistance, m Velocity, m/s Forward difference Backward difference Centered difference Actual 005 151057.5 215 1012.5 330201517.5 450252022.5 575302527.5 610530

11 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Consider some data 11 Time, sDistance, m Velocity, m/s Forward difference Backward difference Centered difference Actual 0052.5 151057.5 215 1012.5 330201517.5 450252022.5 575302527.5 61053032.5

12 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. What if you wanted to find the acceleration, based on this data? 12 Time, sDistance, mVelocity,m/sAcceleration Forward difference 0055 15105 215 5 330205 450255 57530 6105

13 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 13 h hh h h h Equation 4.24

14 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Now that we’ve reviewed let’s look at some more sophisticated methods for finding derivatives – in chapter 21 14

15 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 15 High Accuracy Differentiation Formulas High-accuracy divided-difference formulas can be generated by including additional terms from the Taylor series expansion. Solve for

16 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 16 Inclusion of the 2 nd derivative term has improved the accuracy to O(h 2 ). Similar improved versions can be developed for the backward and centered formulas as well as for the approximations of the higher derivatives.

17 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 17

18 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 18

19 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 19

20 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 20 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.

21 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 21 For centered difference approximations with O(h 2 ). The application of this formula yields a new derivative estimate of O(h 4 ). Recall that Richardson extrapolation was used in Romberg integration

22 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 22 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.

23 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 23 Derivatives and Integrals for Data with Errors Differentiation tends to amplify errors Integration tends to smooth out errors

24 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 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 24

25 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 25

26 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 26

27 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 27

28 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 28

29 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 29

30 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 30 gradient can be used to calculate partial derivatives

31 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 31

32 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Summary Higher Order Derivative Approximations Richardson Extrapolation Built-In MATLAB functions –diff –gradient Quiver Plots 32


Download ppt "Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 21 Numerical Differentiation."

Similar presentations


Ads by Google