Central Divided Difference
Topic: Differentiation
Major: General Engineering
Authors: Autar Kaw, Sri Harsha Garapati
5/21/2008 [Link] 1
Definition
lim f ( x ) − f ( x − Δx )
f ′( x ) =
Δx → 0 Δx
.
y Slope at xi
f(x)
xi x
2 [Link]
Central Divided Difference
f (x + Δx ) − f (x − Δx )
f ′( x ) ≅
2 Δx
f (x)
x − Δx x x + Δx
x
f (x i + Δ x ) − f (x i − Δ x )
f ′( x i ) ≅
2Δx
3 [Link]
Example
Example:
The velocity of a rocket is given by
⎡ 14 × 10 4 ⎤
ν (t ) = 2000 ln ⎢ ⎥ − 9 . 8 t , 0 ≤ t ≤ 30
⎣ 14 × 10 4
− 2100 t ⎦
where ν given in m/s and t is given in seconds. Use central difference approximation of
the first derivative of ν(t ) to calculate the acceleration at t = 16s. Use a step size of
Δt = 2s.
Solution:
ν (ti +1 ) −ν (ti − 1)
a (ti ) ≅
2 Δt
ti = 16
4 [Link]
Example (contd.)
Δt = 2
t i +1 = t i + Δt = 16 + 2 = 18
ti −1 = ti − Δt = 16 − 2 = 14
ν (18) −ν (14 ) ν (18) −ν (14 )
a (16 ) = =
2( 2) 4
⎡ 14 × 10 4 ⎤
ν (18) = 2000 ln ⎢ ⎥ − 9.8(18) = 453.02m / s
⎣14 × 10 − 2100(18)⎦
4
⎡ 14 ×10 4 ⎤
ν (14) = 2000 ln ⎢ ⎥ − 9.8(14) = 334.24m / s
⎣14 × 10 4
− 2100(14 ) ⎦
5 [Link]
Example (contd.)
Hence
ν (18) −ν (14)
a(16) = = 453.02 − 334.24 = 29.695m / s 2
4
The exact value of a(16) can be calculated by differentiating
⎡ 14 × 10 4 ⎤
ν (t ) = 2000 ln ⎢ ⎥ − 9.8t
⎣14 × 10 − 2100t ⎦
4
as
a(t ) =
d
[ν (t )] = − 4040 − 29.4t
dt − 200 + 3t
a(16) = 29.674m / s 2
6 [Link]
Example (contd.)
The absolute relative true error is
TrueValue − ApproximateValue
εt = ×100
TrueValue
29 .674 − 29 .695
= × 100
29 .674
= 0.070769 %
7 [Link]
Effect Of Step Size
f ( x ) = 9e 4x
Value of f ' (0.2) Using Central Divided Difference difference method.
h f ' (0.2) Ea εa % Significant Et εt %
digits
0.05 80.65467 -0.53520 0.668001
0.025 80.25307 -0.4016 0.500417 1 -0.13360 0.16675
0.0125 80.15286 -0.100212 0.125026 2 -0.03339 0.041672
0.00625 80.12782 -0.025041 0.031252 3 -0.00835 0.010417
0.003125 80.12156 -0.00626 0.007813 3 -0.00209 0.002604
0.001563 80.12000 -0.001565 0.001953 4 -0.00052 0.000651
0.000781 80.11960 -0.000391 0.000488 5 -0.00013 0.000163
0.000391 80.11951 -9.78E-05 0.000122 5 -0.00003 4.07E-05
0.000195 80.11948 -2.45E-05 3.05E-05 6 -0.00001 1.02E-05
9.77E-05 80.11948 -6.11E-06 7.63E-06 6 0.00000 2.54E-06
4.88E-05 80.11947 -1.53E-06 1.91E-06 7 0.00000 6.36E-07
8 [Link]
Effect of Step Size in Central
Divided Difference Method
95
Initial step size=0.05
f'(0.2)
85
75
1 3 5 7 9 11
Num ber of tim es the step size is halved, n
9 [Link]
Effect of Step Size on
Approximate Error
Num ber of steps involved, n
0
1 3 5 7 9 11
E(a)
-1 Initial step size=0.05
10 [Link]
Effect of Step Size on Absolute
Relative Approximate Error
0.6
Initial step size=0.05
0.5
0.4
|E(a)|,%
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10 11 12
Num ber of steps involved, n
11 [Link]
Effect of Step Size on Least
Number of Significant Digits Correct
8 Initial step size=0.05
Least number of significant digits
7
6
5
correct
4
3
2
1
0
1 2 3 4 5 6 7 8 9 10 11
Num ber of steps involved, n
12 [Link]
Effect of Step Size on True Error
Num ber of steps involved, n
0.0
0 2 4 6 8 10 12
-0.1
-0.2
E(t)
-0.3
-0.4
-0.5
-0.6
Initial step size=0.05
13 [Link]
Effect of Step Size on Absolute
Relative True Error
0.8
0.7
Initial step size=0.05
0.6
0.5
|Et| %
0.4
0.3
0.2
0.1
0
1 2 3 4 5 6 7 8 9 10 11
Num ber of tim es step size halved,n
14 [Link]