Вы находитесь на странице: 1из 14

8/7/2012 http://numericalmethods.eng.usf.

edu 1
Central Divided Difference
Major: All Engineering Majors

Authors: Autar Kaw, Sri Harsha Garapati

http://numericalmethods.eng.usf.edu
Numerical Methods for STEM undergraduates



http://numericalmethods.eng.usf.edu 2
Definition
i
x



.
( )
( ) ( )
x
x x f x f
x
x f
A
A
A
=
'
0
lim
f(x)
Slope at
x
y
i
x

http://numericalmethods.eng.usf.edu 3
Central Divided Difference
x x A +
x
x
( )
( ) ( )
x
x x f x x f
x f
A
A A +
~
'
2
( )
( ) ( )
x
x x f x x f
x f
i i
i
A
A A +
~
'
2
) (x f
x x A

http://numericalmethods.eng.usf.edu 4
Example
Example:
The velocity of a rocket is given by
( ) 30 0 , 8 . 9
2100 10 14
10 14
ln 2000
4
4
s s
(



= t t
t
t v
where
v
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 . 16s t =
Use a step size of
. 2s t = A
( )
( ) ( )
t
t t
t a
i i
i
A

~
+
2
1
1
v v
Solution:
16 =
i
t

http://numericalmethods.eng.usf.edu 5
2 = t
t t t
i i

1
+ =
+
18 2 16 = + =
( )
( ) ( ) ( ) ( )
4
14 18
) 2 ( 2
14 18
16
v v v v
=

= a

( )
( )
( ) 18 8 . 9
18 2100 10 14
10 14
ln 2000 18
4
4



= v s m/ 02 . 453 =
( )
( )
( ) 14 8 . 9
14 2100 10 14
10 14
ln 2000 14
4
4



= v s m/ 24 . 334 =

Example (contd.)
t t t
i i
A =
1
14 2 16 = =

http://numericalmethods.eng.usf.edu 6
Hence



The exact value of ( ) 16 a can be calculated by differentiating
( ) t
t
t 8 . 9
2100 10 14
10 14
ln 2000
4
4



= v
as
Example (contd.)
( )
2
/ 695 . 29 24 . 334 02 . 453
4
) 14 ( ) 18 (
16 s m a = =

=
v v
| |
2
/ 674 . 29 ) 16 (
3 200
4 . 29 4040
) ( ) (
s m a
t
t
t
dt
d
t a
=
+

= = v

http://numericalmethods.eng.usf.edu 7
The absolute relative true error is

Example (contd.)
100

=
TrueValue
eValue Approximat TrueValue
t
c
% 070769 . 0
100
674 . 29
695 . 29 674 . 29
=

=

http://numericalmethods.eng.usf.edu 8
Effect Of Step Size
x
e x f
4
9 ) ( =
Value of

) 2 . 0 (
'
f
Using Central Divided Difference difference method.
h
) 2 . 0 (
'
f
a
E
a
c %
Significant
digits
t
E
t
c %
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


http://numericalmethods.eng.usf.edu 9
Effect of Step Size in Central
Divided Difference Method

75
85
95
1 3 5 7 9 11
Number of times the step size is halved, n
f
'
(
0
.
2
)
Initial step size=0.05

http://numericalmethods.eng.usf.edu 10
Effect of Step Size on
Approximate Error
-1
0
1 3 5 7 9 11
Number of steps involved, n
E
(
a
)
Initial step size=0.05

http://numericalmethods.eng.usf.edu 11
Effect of Step Size on Absolute
Relative Approximate Error



0
0.1
0.2
0.3
0.4
0.5
0.6
0 1 2 3 4 5 6 7 8 9 10 11 12
Number of steps involved, n
|
E
(
a
)
|
,
%
Initial step size=0.05

http://numericalmethods.eng.usf.edu 12
Effect of Step Size on Least
Number of Significant Digits Correct
0
1
2
3
4
5
6
7
8
1 2 3 4 5 6 7 8 9 10 11
Number of steps involved, n
L
e
a
s
t


n
u
m
b
e
r

o
f

s
i
g
n
i
f
i
c
a
n
t

d
i
g
i
t
s

c
o
r
r
e
c
t
Initial step size=0.05

http://numericalmethods.eng.usf.edu 13
Effect of Step Size on True Error
-0.6
-0.5
-0.4
-0.3
-0.2
-0.1
0.0
0 2 4 6 8 10 12
Number of steps involved, n
E
(
t
)
Initial step size=0.05

http://numericalmethods.eng.usf.edu 14
Effect of Step Size on Absolute
Relative True Error
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
1 2 3 4 5 6 7 8 9 10 11
Number of times step size halved,n
|
E
t
|

%
Initial step size=0.05

Вам также может понравиться