Você está na página 1de 3

Topic 12.

4: Higher-Order Derivatives
https://ece.uwaterloo.ca/~dwharder/NumericalAnalysis/12Differentiation/higher/complete.html[15-Aug-14 7:51:41 PM]
Look for people, keywords, and in Google:
Topic 12.4: Higher-Order Derivatives
Introduction Notes Theory HOWTO Examples Engineering Error Questions Matlab Maple
Given three or more equally-spaced points, we can find an interpolating polynomial passing through those
points, find the 2nd, 3rd, or even higher derivative of that polynomial, and evaluate the derivative at a point
to get an approximation of the derivative at that point.
Background
Useful background for this topic includes:
5. Interpolation
13.1 Centred Divided-Difference Formulae
References
Bradie, Section 6.2, Numerical Differentiation, Part II, p.443.
Mathews, Section 6.2, Numerical Differentiation Formulas, p.339.
Chapra, Section 23.1, High-accuracy Differentiation Formaulas, p.632.
Interactive Maplet
A Differentiation Formula Generator
To generate the formula for higher derivatives, select 2nd, 3rd, etc. instead of 1st in the third drop-down
box.
Theory
The theory for finding the nth-order derivatives is the same as that for finding simple derivatives: Given a
sequence of equally spaced points (either around or preceding a given point x
0
), find the interpolating
polynomial of the appropriate degree, differentiate the interpolating polynomial n times (instead of once) and
evaluate that interpolating polynomial at the point.
For the sake of completeness, we will list the centred and backward divided-difference formulae here. In each
case, the format of Richardson extrapolation we found could be used to improve the approximations for the
O(h
2
) formulae on this page.
Centred Divided-Difference Formulae
For each derivative, centred divided-difference formulae are O(h
2
) and O(h
4
), respectively.
Second Derivatives (3 and 5 point interpolations)
Third Derivatives (5 and 7 point interpolations)
Fourth Derivatives (5 and 7 point interpolations)
Fifth Derivatives (7 and 9 point interpolations)
Backward Divided-Difference Formulae
For each derivative, backward divided-difference formulae are O(h) and O(h
2
), respectively. Note that in all
cases, the O(h) formula is equivalent to the corresponding O(h
2
) centred divided-difference formula, only
shifted by h.
Second Derivatives (3 and 4 point interpolations)
Third Derivatives (4 and 5 point interpolations)
Search
Topic 12.4: Higher-Order Derivatives
https://ece.uwaterloo.ca/~dwharder/NumericalAnalysis/12Differentiation/higher/complete.html[15-Aug-14 7:51:41 PM]
Fourth Derivatives (5 and 6 point interpolations)
Fifth Derivatives (6 and 7 point interpolations)
HOWTO
Problem
Approximate a higher derivative of a univariate function f(x) at a point x
0
. We will assume that we are given
a sequence of points (x
i
, f(x
i
)) around the point of interest (either before or around). We will not look at
iteration because the process of Richardson extrapolation converges significantly faster.
Assumptions
We need to assume the function has an nth derivative if we are to bound the error on our approximation.
Tools
We will use interpolation.
Process
If we are to evaluate the second derivative at the point (x
i
, f(x
i
)) and have access to the two surrounding
points, (x
i 1
, f(x
i 1
)) and (x
i + 1
, f(x
i + 1
)), then we may find the interpolating polynomial, differentiate it
twice, and evaluate that derivative at x
i
:
This is simply another form of the formula
where h is the distance between the points, that is, h = x
i
- x
i 1
.
If we have access to two points on either side of x
i
, we can calculate
where h = x
i
- x
i 1
.
This is another form of the formula:
We could perform the same operations with higher derivatives, however, it should be noted that to calculate
the nth derivative, we require at least n + 1 points.
Examples
Example 1
Given the data points ..., 3.2, 3.3, 3.4, 3.5, 3.6, ... which measure the rotation of a satellite dish at points in
time, with angles 1.05837 1.15775 1.25554 1.35078 1.44252, approximate the acceleration of the angle at
time 3.4 using both the 2nd-order and 4th-order centred divided-difference formulae for the 2nd derivative.
(1.35078 2 1.25554 + 1.15775)/0.1
2
= 0.255 and (-1.44252 + 16 1.35078 30 1.25554 +
16 1.15775 1.05837)/(12 0.1
2
) = 0.2550833333 .
Thus, 0.25508333333 is the more accurate answer, but even the 2nd-order formula is reasonably close.
Engineering
To be completed.
Error
2nd-Order Centred Divided-Difference Formula
To determine the error for the 2nd-order centred divided-difference formula for the second derivative, we
need only look at the two Taylor series approximations:
Topic 12.4: Higher-Order Derivatives
https://ece.uwaterloo.ca/~dwharder/NumericalAnalysis/12Differentiation/higher/complete.html[15-Aug-14 7:51:41 PM]
and
Add these two equations and transfer the 2f(x) to the left-hand side to get
If we divide both sides by h
2
and make the approximation that:
then we can rearrange the equation as
Thus, the error is O(h
2
).
4th-Order Centred Divided-Difference Formula
A similar sum may be used to find the error of the 4th-order divided difference formula. If you add the linear
combination -f(x + 2h) + 8 f(x + h) - 8 f(x - h) + f(x - 2h) of the 5th-order Taylor series approximations,
then, after dividing by 12h, we are left with the error term:
If we divide through by -1/30 and factor out the h
4
, we get
Now, examining the contents of the parentheses, we note that the coefficients 2/3 - 1/6 - 1/6 + 2/3 = 1, and
therefore, the contents of the parentheses is an approximation of the average of f
(5)
(x) on the interval [x -
2h, x + 2h], and thus, we may approximate the error by
Thus, the error is O(h
4
).
Questions
Question 1
Approximate the rate-of-change of the current at the midpoint of the incoming data ..., 7.2, 7.3, 7.4, 7.5,
7.6, ... where the charge on a capacitor these times is 0.00242759 0.00241500 0.00240247 0.00239001
0.00237761.
Answer: -0.000007 and -0.0000071667.
Matlab
In Matlab, you would approximate the derivative numerically:
>> ( si n( 1. 7 ) - si n( 1. 3 ) ) / 0. 4
which would approximate the actual derivative of cos(1.5).
Maple
Maple calculates derivatives symbolically:
> di f f ( si n( x) , x ) ;
cos( x)
For more help on the diff routine, enter:
? di f f
Copyright 2005 by Douglas Wilhelm Harder. All rights reserved.
Department of Electrical and Computer Engineering
University of Waterloo
200 University Avenue West
Waterloo, Ontario, Canada N2L 3G1
+1 519 888 4567


http://www.ece.uwaterloo.ca/~ece104/

Você também pode gostar