Presentation is loading. Please wait.

Presentation is loading. Please wait.

Numerical Differentiation

Similar presentations


Presentation on theme: "Numerical Differentiation"— Presentation transcript:

1 Numerical Differentiation
Forward, Backward, Central Differences Lagrange Estimation

2 Numerical Derivatives
In this section we will see how to estimate the value of a derivative based on knowing only certain function values. This is typical for many applications not to know the exact function you are dealing with but rather a set of values for it. The methods that are used tend to separate themselves into methods for values of the independent variables that are equally spaced and those that are not. Equally Spaced Data Points If we consider three values for x: xi-1, xi, and xi+1 with xi-1 < xi < xi+1 we can form the slopes of various secant lines with the corresponding y values yi-1=f(xi-1), yi=f(xi) and yi+1=f(xi+1) to estimate the derivative. Forward Differences Backward Differences xi-1 xi xi+1 yi-1 yi yi+1 f(x)

3 Central Difference xi-1 xi xi+1 yi-1 yi yi+1 f(x) If we assume the data are evenly spaced so that xi-xi-1 = h = xi+1-xi the formulas below become: Forward Difference Backward Difference Central Difference If you look in each of these formulas we are only using two pieces of information. This means we are probably not as accurate as we can be. What if we would like to estimate the value of the derivative at xi-1 but make use of all three data points?

4 Three-Point Difference Formulas for Derivatives (Evenly spaced points)
The two formulas below estimate the value of the derivatives at the endpoints making use of all three points most often giving a more accurate value for the derivative. Three-Point Forward Difference Three-Point Backward Difference Both of these formulas come from writing out the Lagrange Interpolating polynomial for these three points, taking the derivative then plugging in the value you want.

5 Consider the data being equally spaced by h:

6 Unequally-Spaced Data Points
In many situations the data points are not equally spaced. To estimate the value of the derivative we use the Lagrange Polynomial just like before. In this situation notice that the derivative can be estimated at any point. Higher Order Derivatives All the previous formulas we have derived are to estimate the first derivative. What if we want to estimate the second derivative?

7 Second derivative estimates rely on writing out the Taylor Series for a modified version of the function f(x). We write out the Taylor Series for f(x+h) treating x as a constant and h as the variable and expanding at the point 0. add !

8 Example: Find estimates for the derivative with the data set given to the right. We notice the x values are evenly spaced. Two-Point Estimates: i xi yi 1 3 2 5 4 7 Forward Backward Central Three Point Estimates: Forward Backward Second Derivative (h=2)


Download ppt "Numerical Differentiation"

Similar presentations


Ads by Google