Lecture 7 Numerical Differentiation
Lecture 7 Numerical Differentiation
College of Engineering
Lecture 07 - Numerical Differentiation
Lecture Objectives:
At the end of this topic the students should be able to:
Understand the application of high-accuracy numerical differentiation
formulas for equispaced data.
Know how to evaluate derivatives for unequally spaced data
Understand how Richardson extrapolation is applied for numerical
differentiation.
The graphical definition of a derivative: as Δx approaches zero in going from (a) to (c), the
difference approximation becomes a derivative.
1
EE 103: Numerical Methods and Analysis
Republic of the Philippines
CAMARINES NORTE STATE COLLEGE
F. Pimentel Avenue, Brgy. 2, Daet, Camarines Norte – 4600, Philippines
College of Engineering
where y and f(x) are alternative representatives for the dependent variable and x is the
independent variable. If Δx is allowed to approach zero, as occurs in moving from a to c, the
difference becomes a derivative:
where dy∕dx [which can also be designated as y′ or f′(xi)] is the first derivative of y with
respect to x evaluated at xi.
The second derivative represents the derivative of the first derivative,
Thus, the second derivative tells us how fast the slope is changing. It is commonly referred
to as the curvature, because a high value for the second derivative means high curvature.
or
where h is called the step size—that is, the length of the interval over which the
approximation is made, xi+1 − xi.
Graphical depiction of (a) forward, (b) backward, and (c) centered finite-difference
approximations of the first derivative.
2
EE 103: Numerical Methods and Analysis
Republic of the Philippines
CAMARINES NORTE STATE COLLEGE
F. Pimentel Avenue, Brgy. 2, Daet, Camarines Norte – 4600, Philippines
College of Engineering
b. Backward Difference
c. Centered Difference
3
EE 103: Numerical Methods and Analysis
Republic of the Philippines
CAMARINES NORTE STATE COLLEGE
F. Pimentel Avenue, Brgy. 2, Daet, Camarines Norte – 4600, Philippines
College of Engineering
Example: Use forward and backward difference approximations of O(h) and a centered difference
approximation of O(h2) to estimate the first derivative of ( ) at x = 3 with h = 0.25. Repeat the
computation using h = 0.125. (note: the true value can be determined by getting the derivative of the given
equation)
( )
for h = 0.125
when x = 0.4 at h= 0.4. Compare the result with the exact solution.
4
EE 103: Numerical Methods and Analysis