Numerical Differentiation

Slides:



Advertisements
Similar presentations
Splines and Piecewise Interpolation
Advertisements

Part 1 Chapter 4 Roundoff and Truncation Errors PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
Part 2 Chapter 6 Roots: Open Methods
Part 2 Chapter 6 Roots: Open Methods
CISE301_Topic61 SE301: Numerical Methods Topic 6 Numerical Differentiation Lecture 23 KFUPM Read Chapter 23, Sections 1-2.
Part 5 Chapter 19 Numerical Differentiation PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
EE3561_Unit 6(c)AL-DHAIFALLAH14351 EE 3561 : Computational Methods Unit 6 Numerical Differentiation Dr. Mujahed AlDhaifallah ( Term 342)
NUMERICAL DIFFERENTIATION AND INTEGRATION
High Accuracy Differentiation Formulas
2. Numerical differentiation. Approximate a derivative of a given function. Approximate a derivative of a function defined by discrete data at the discrete.
Lecture 18 - Numerical Differentiation
CE33500 – Computational Methods in Civil Engineering Differentiation Provided by : Shahab Afshari
Chapter 19 Numerical Differentiation §Estimate the derivatives (slope, curvature, etc.) of a function by using the function values at only a set of discrete.
Initial-Value Problems
Polynomial Interpolation
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 181 Interpolation Chapter 18 Estimation of intermediate.
Chapter 17 Objectives Recognizing that Newton-Cotes integration formulas are based on the strategy of replacing a complicated function or tabulated data.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 181 Interpolation.
Dr. Jie Zou PHY Chapter 7 Numerical Differentiation: 1 Lecture (I) 1 Ref: “Applied Numerical Methods with MATLAB for Engineers and Scientists”, Steven.
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 23 Numerical Differentiation.
Numerical Differentiation:1* Lecture (II)
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Numerical Differentiation and Integration Standing.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Numerical Differentiation and Integration ~ Newton-Cotes.
Numerical Integration Formulas
Derivatives and Differential Equations
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Numerical Differentiation and Integration Part 6 Calculus.
Part 4 Chapter 17 Polynomial Interpolation PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Numerical Differentiation and Integration ~ Integration.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Today’s class Numerical Differentiation Finite Difference Methods Numerical Methods Lecture 14 Prof. Jinbo Bi CSE, UConn 1.
MECN 3500 Inter - Bayamon Lecture Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Chap. 11 Numerical Differentiation and Integration
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Truncation Errors and the Taylor Series Chapter 4.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 5 Integration and Differentiation.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapters 22 and 23.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 21 Numerical Differentiation.
Part 3 Chapter 9 Gauss Elimination
Part 3 Chapter 12 Iterative Methods
Linear Algebraic Equations and Matrices
High Accuracy Differentiation Formulas
Polynomial Interpolation
Matrix Inverse and Condition
Applied Numerical Methods
Chapter 18.
Linear Algebraic Equations and Matrices
Boundary-Value Problems
Numerical Integration Formulas
Copyright © The McGraw-Hill Companies, Inc
NUMERICAL DIFFERENTIATION AND INTEGRATION
Part 2 Chapter 6 Roots: Open Methods
Chapter 18.
Roundoff and Truncation Errors
Chapter 3 Image Slides Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 23.
Mathematical Modeling, Numerical Methods, and Problem Solving
Numerical differentiation
General Linear Least-Squares and Nonlinear Regression
Numerical Differentiation Chapter 23
Splines and Piecewise Interpolation
MATH 2140 Numerical Methods
Part 3 Chapter 10 LU Factorization
Roots: Bracketing Methods
Numerical Integration of Functions
SKTN 2393 Numerical Methods for Nuclear Engineers
Copyright © The McGraw-Hill Companies, Inc
CHAPTER 6 SKELETAL SYSTEM
Roundoff and Truncation Errors
Roots: Bracketing Methods
Part 2 Chapter 7 Optimization
Part 2 Chapter 6 Roots: Open Methods
Presentation transcript:

Numerical Differentiation Part 5 Chapter 21 Numerical Differentiation PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Chapter Objectives Understanding the application of high-accuracy numerical differentiation formulas for equispaced data. Knowing how to evaluate derivatives for unequally spaced data. Understanding how Richardson extrapolation is applied for numerical differentiation. Recognizing the sensitivity of numerical differentiation to data error. Knowing how to evaluate derivatives in MATLAB with the diff and gradient functions. Knowing how to generate contour plots and vector fields with MATLAB.

Differentiation The mathematical definition of a derivative begins with a difference approximation: and as x is allowed to approach zero, the difference becomes a derivative:

High-Accuracy 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. Three categories for the formula include forward finite-difference, backward finite-difference, and centered finite-difference.

Forward Finite-Difference

Backward Finite-Difference

Centered Finite-Difference

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(h2) estimates and the interval is halved (h2=h1/2), an improved O(h4) estimate may be formed using: For the cases where there are two O(h4) estimates and the interval is halved (h2=h1/2), an improved O(h6) estimate may be formed using: For the cases where there are two O(h6) estimates and the interval is halved (h2=h1/2), an improved O(h8) estimate may be formed using:

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. As an example, using a second-order Lagrange polynomial to fit three points and taking its derivative yields:

Derivatives and Integrals for Data with Errors A shortcoming of numerical differentiation is that it tends to amplify errors in data, whereas 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.

Numerical Differentiation with MATLAB MATLAB has two built-in functions to help take derivatives, diff and gradient: 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

Numerical Differentiation with MATLAB fx = gradient(f, h) Determines the derivative of the data in f at each of the points. The program uses forward difference for the first point, backward difference for the last point, and centered difference for the interior points. h is the spacing between points; if omitted h=1. The major advantage of gradient over diff is gradient’s 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)

Visualization MATLAB can generate contour plots of functions as well as vector fields. Assuming x and y represent a meshgrid of x and y values and z represents a function of x and y, contour(x, y, z) can be used to generate a contour plot [fx, fy]=gradient(z,h) can be used to generate partial derivatives and quiver(x, y, fx, fy) can be used to generate vector fields