Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 8

Deret Taylor

+ +

' '
+
'
+ =
!
) (
) (
! 2
) (
) ( ) )( ( ) ( ) (
0
0
) (
2
0
0 0 0 0
n
x x
x f
x x
x f x x x f x f x f
n
n
... ) (
!
) (
.... ) (
! 2
) ( ' '
) (
! 1
) ( '
) ( ) (
2
+ + + + + =
n
n
a x
n
a f
a x
a f
a x
a f
a f x f
n
n
i
n
i i i i
R
n
x
x f
x
x f
x
x f x f x f +
A
+ +
A
' '
+
A
'
+ =
+
!
) (
! 2
) (
! 1
) ( ) ( ) (
2
1

i i
x x x = A
+1
Kesalahan yang dihasilkan dari penggunaan
suatu aproksimasi pengganti prosedur
matematika yang eksak
Contoh: approksimasi dengan deret Taylor
Kesalahan:
) 1 (
) 1 (
)! 1 (
) (
+
+
A
+
=
n
n
n
x
n
f
R

Kesalahan pemotongan
Aproksimasi orde ke nol (zero-order appr.)
) ( ) (
1 i i
x f x f ~
+
Aproksimasi orde ke satu (first-order appr.)
! 1
) ( ) ( ) (
1
x
x f x f x f
i i i
A
'
+ ~
+
Aproksimasi orde ke dua (second-order appr.)
! 2
) (
! 1
) ( ) ( ) (
2
1
x
x f
x
x f x f x f
i i i i
A
' '
+
A
'
+ =
+
Recall the Taylor Series
( ) ( ) ( )
( ) ( )
( )
f x f x f x h
f x
h
f x
h
f x
n
h R
where h step size x x
i i i
i i
n
i n
n
i i
+
+
+
+
~ + + +
+
= =
1
2 3
1
2 3
'
' '
!
' ' '
!
!
. . . . . .
Finite difference method -1
The Taylor series
+ + + + =
+
' ' '
3
' '
2
'
1
3 2
i i i i i
f
!
x
f
!
x
xf f f
A A
A
(1)
(2)
Forward
difference
+
A
+
A
+ =
A

+ ' ' '


2
' '
'
1
! 3 ! 2
i i i
i i
f
x
f
x
f
x
f f
i i+1 i-1
Backward
difference

A
+
A
=
A

' ' '


2
' ' ' 1
! 3 ! 2
i i i
i i
f
x
f
x
f
x
f f
i+1 i i-1
Central
Difference
turunkan juga!

+
A
+
A
+ =
A

+ ' ' ' '


4
' ' '
2
' 1 1
! 5 6 2
i i i
i i
f
x
f
x
f
x
f f i i+1 i-1
+ + =

' ' '


3
' '
2
'
1
3 2
i i i i i
f
!
x
f
!
x
xf f f
A A
A
First-oder difference
Finite difference method -3
High-oder finite difference
To reduce the truncation error of finite difference method, high-order finite
difference method is frequently employed

2 1 1 2
d
d
+ +
+ + + + =
i i i i i
i
ef df cf bf af
x
f
i i+1 i-2 i-1 i+2
Taylor series of five points are,
+ + + + + =
+ + + + + =
=
+ + + =
+ + + =
+
+

' ' ' '


4
' ' '
3
' '
2
'
2
' ' ' '
4
' ' '
3
' '
2
'
1
' ' ' '
4
' ' '
3
' '
2
'
1
' ' ' '
4
' ' '
3
' '
2
'
2
! 4
) 2 (
! 3
) 2 (
! 2
) 2 (
) 2 (
! 4 ! 3 ! 2
! 4 ! 3 ! 2
! 4
) 2 (
! 3
) 2 (
! 2
) 2 (
) 2 (
i i i i i i
i i i i i i
i i
i i i i i i
i i i i i i
f
h
f
h
f
h
f h f f
f
h
f
h
f
h
hf f f
f f
f
h
f
h
f
h
hf f f
f
h
f
h
f
h
f h f f
(1)
(2)
(3)
(4)
(5)
(5)
By substituting (2)(5) into Eq.(1), we have,
h
Finite difference method -4
+ + + + +
+ + + + + + +
+ + + + + + + =
' ' ' '
4 4 4 4
' ' '
3 3 3
3 ' ' 2 2 2 2
'
)
! 4
) 2 (
! 4 ! 4 ! 4
) 2 (
(
)
6
8
6 6 6
8
( ) 2 5 . 0 5 . 0 2 (
) 2 2 ( ) (
i
i i
i i
i
f e
h
d
h h
a
h
f e
h
d
h
b
h
a h f e h d h b h a h
f eh dh bh ah f e d c b a
dx
df
The coefficient for the first derivative must be 1 and the others
must be zero . By solving 5 linear equations, we get,
h
f f f f
dx
df
h
e
h
d c
h
b
h
a
i i i i i
12
8 8
12
1
,
12
8
, 0 ,
12
8
,
12
1
2 1 1 2 + +
+ +
=
= = = = =
(7)
(8)
The order of precision is 4
th
.
Finite difference method -5
Comparison of finite difference method
x f(x)
0 0
1 1
2 8
3 27
4 64
f(x)=x
3
, x=1,x=2 , analytical solution f (2)=12
Forward finite
difference
19
1
8 27
1
=

+
x
f f
i i
A
Backward finite
difference
7
1
1 8
1
=


x
f f
i i
A
Central
difference
13
2
1 27
2
1 1
=

+
x
f f
i i
A
4
th
order finite
Central difference
12
12
8 8
2 1 1 2
=
+ +
+ +
h
f f f f
i i i i
Exercise: Calculate above four types of finite
differences under condition of f(x)=x, x=1, x=2

You might also like