Numerical Differentiation - Summary PDF
Numerical Differentiation - Summary PDF
Types of Differentiation:
Forward expansion of Taylor series:
''
' f ( xi ) 2 h=step size
f ( xi 1 ) f ( xi ) f ( xi ) h h ...
2!
' f ( xi 1 ) f ( xi ) first forward
f ( xi ) O (h)
h difference
Backward expansion of Taylor series
''
' f ( xi ) 2
f ( xi 1 ) f ( xi ) f ( xi ) h h ...
2!
f ( xi ) f ( xi 1 ) first backward
'
f ( xi ) O (h) difference
h
' f ( xi 1 ) f ( xi 1 ) 2 centered
f ( xi ) O (h )
2h difference
Higher-accuracy Differentiation Formulas:
High-accuracy diffentiation formulas can be obtained by adding
more terms in Taylor expansion.
Forward Taylor series expansion:
''
' f ( xi ) 2
f ( xi 1 ) f ( xi ) f ( xi ) h h ...
2
or
''
' f ( xi 1 ) f ( xi ) f ( xi ) 2
f ( xi ) h O (h )
h 2
'' f ( xi 2
) 2 f ( xi 1 ) f ( xi )
f ( xi ) 2
h
Then,
' f ( xi 1 ) f ( xi ) f ( xi 2
) 2 f ( xi 1 ) f ( xi ) 2
f ( xi ) 2
h O (h )
h 2h
or,
' f ( xi ) 4 f ( xi 1 ) 3 f ( xi ) 2
forward
2
f ( xi ) O (h ) scheme
2h
' 3 f ( xi ) 4 f ( xi 1 ) f ( xi 2 ) 2 backward
f ( xi ) O (h ) scheme
2h
' f ( xi 2
) 8 f ( xi 1 ) 8 f ( xi 1 ) f ( xi 2 ) 4 centered
f ( xi ) O (h )
12 h scheme
EX: Calculate the approximate derivative of
4 3 2
f ( x) 0 .1 x 0 . 15 x 0 .5 x 0 . 25 x 1 .2
4 1
D D ( h2 ) D ( h1 )
3 3
at x=0.5.
4 1
D ( 0 .5 ) ( 0 . 934375 ) ( 1) 0 . 9125 t
0%
3 3
Derivatives of Unequally Spaced Data
In the previous discussion, both finite difference approximations
and Richardson extrapolation reqires evenly distributed data. So,
these methods are more suitable to evaulate functions.
Emprically derived data, experimental or from field surveys, are
usually not even.
One way is to fit a second-order Lagrange interpolating polynomial
to each set of three data points. Derivative of the polynomial:
' 2x xi xi 1
2x xi 1
xi 1
2x xi 1
xi
f ( x) f ( xi 1 ) f ( xi ) f ( xi 1 )
( xi 1
x i )( x i 1
xi 1 ) ( xi x i 1 )( x i xi 1 ) ( xi 1
x i 1 )( x i 1
xi )
Using above formula, any point in the range of three data points
can be evaluated.
This equation has the same accuracy of high-accuracy centered
difference approximation even though data is not need to be
equally spaced.
Derivatives and Integrals for Data with Error:
Differentiation process amplifies the error:
y dy/dt
x x
As a remedy, fit a smoother function (low-order polynomial) to the
uncertain data.
On the other hand, integration process reduces the error.
(Succusive negative and positive errors cancel out during
integration). No further action is required.