Central Divided Difference: Topic: Differentiation
Central Divided Difference: Topic: Differentiation
Topic: Differentiation
y Slope at xi
f(x)
xi x
2 http://numericalmethods.eng.usf.edu
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 http://numericalmethods.eng.usf.edu
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 http://numericalmethods.eng.usf.edu
Example (contd.)
Δt = 2
t i +1 = t i + Δt = 16 + 2 = 18
ti −1 = ti − Δt = 16 − 2 = 14
⎡ 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 http://numericalmethods.eng.usf.edu
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 http://numericalmethods.eng.usf.edu
Example (contd.)
The absolute relative true error is
TrueValue − ApproximateValue
εt = ×100
TrueValue
29 .674 − 29 .695
= × 100
29 .674
= 0.070769 %
7 http://numericalmethods.eng.usf.edu
Effect Of Step Size
f ( x ) = 9e 4x
8 http://numericalmethods.eng.usf.edu
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 http://numericalmethods.eng.usf.edu
Effect of Step Size on
Approximate Error
10 http://numericalmethods.eng.usf.edu
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 http://numericalmethods.eng.usf.edu
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 http://numericalmethods.eng.usf.edu
Effect of Step Size on True Error
-0.2
E(t)
-0.3
-0.4
-0.5
-0.6
Initial step size=0.05
13 http://numericalmethods.eng.usf.edu
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 http://numericalmethods.eng.usf.edu