Forward Divided Difference
Topic: Differentiation
Major: General Engineering
Authors: Autar Kaw, Sri Harsha Garapati
5/21/2008 [Link] 1
Definition
lim f ( x + Δx ) − f ( x )
f ′( x ) =
Δx → 0 Δx
.
y Slope at xi
f(x)
xi x
2 [Link]
Forward Divided Difference
f (x + Δx ) − f (x )
f ′( x ) ≅
Δx
f (x)
x x + Δx
x
f (x i + Δ x ) − f (x i )
f ′( x i ) ≅
Δ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 forward 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 )
a (ti ) ≅
Δt
ti = 16
4 [Link]
Example (contd.)
Δt = 2
t i +1 = t i + Δt = 16 + 2 = 18
ν (18) − ν (16 )
a (16 ) =
2
⎡ 14 × 10 4 ⎤
ν (18) = 2000 ln ⎢ ⎥ − 9.8(18) = 453.02m / s
⎣ 14 × 10 4
− 2100(18 ) ⎦
⎡ 14 ×10 4 ⎤
ν (16) = 2000 ln ⎢ ⎥ − 9.8(16)
= 392.07m / s
⎣14 ×10 − 2100(16) ⎦
4
5 [Link]
Example (contd.)
Hence
ν (18) −ν (16)
a(16) = = 453.02 − 392.07 = 30.475m / s 2
2
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 − 30.475
= ×100
29.674
= 2.6993%
7 [Link]
Effect Of Step Size
f ( x ) = 9e 4x
Value of f ' (0.2) Using forward difference method.
h f ' (0.2) Ea εa % Significant Et εt %
digits
0.05 88.69336 -8.57389 10.70138
0.025 84.26239 -4.430976 5.258546 0 -4.14291 5.170918
0.0125 82.15626 -2.106121 2.563555 1 -2.03679 2.542193
0.00625 81.12937 -1.0269 1.265756 1 -1.00989 1.260482
0.003125 80.62231 -0.507052 0.628923 1 -0.50284 0.627612
0.001563 80.37037 -0.251944 0.313479 2 -0.25090 0.313152
0.000781 80.24479 -0.125579 0.156494 2 -0.12532 0.156413
0.000391 80.18210 -0.062691 0.078186 2 -0.06263 0.078166
0.000195 80.15078 -0.031321 0.039078 3 -0.03130 0.039073
9.77E-05 80.13512 -0.015654 0.019535 3 -0.01565 0.019534
4.88E-05 80.12730 -0.007826 0.009767 3 -0.00782 0.009766
8 [Link]
Effect of Step Size in Forward
Divided Difference Method
92 Initial step size=0.05
88
f'(0.2)
84
80
76
0 1 2 3 4 5 6 7 8 9 10 11 12
Num ber of tim es step size halved, n
9 [Link]
Effect of Step Size on
Approximate Error
Number of times step size halved, n
0
0 2 4 6 8 10 12
-1
-2
Ea
-3
-4
Initial step size=0.05
-5
10 [Link]
Effect of Step Size on Absolute
Relative Approximate Error
6
5
Initial step size=0.05
4
|Ea| %
0
0 1 2 3 4 5 6 7 8 9 10 11 12
Num ber of tim es step size halved, n
11 [Link]
Effect of Step Size on Least
Number of Significant Digits
Correct
4
Initial step size=0.05
Least number of significant digits
3
correct
0
1 2 3 4 5 6 7 8 9 10 11
Num ber of tim es step size halved, n
12 [Link]
Effect of Step Size on True Error
Num ber of tim es step size halved, n
0
0 2 4 6 8 10 12
-3
Et
-6
-9 Initial step size=0.05
Initial step size=0.05
13 [Link]
Effect of Step Size on Absolute
Relative True Error
Initial step size=0.05
12
10
8
|Et| %
0
1 2 3 4 5 6 7 8 9 10 11
Number of times step size halved, n
14 [Link]