200 likes | 775 Views
Numerical Differentiation. Forward, Backward, Central Differences Lagrange Estimation. f(x). y i +1. y i. y i -1. x i +1. x i -1. x i. Numerical Derivatives
E N D
Numerical Differentiation Forward, Backward, Central Differences Lagrange Estimation
f(x) yi+1 yi yi-1 xi+1 xi-1 xi 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. Backward Differences Forward Differences
f(x) yi+1 yi yi-1 xi+1 xi-1 xi Central Difference If we assume the data are evenly spaced so that xi-xi-1 = h = xi+1-xi the formulas below become: Central Difference Backward Difference Forward 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?
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.
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?
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 !
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: Central Forward Backward Three Point Estimates: Forward Second Derivative (h=2) Backward