Hampiran Numerik Turunan Hampiran Numerik Turunan FungsiFungsi
Pertemuan 9
Matakuliah : METODE NUMERIK ITahun : 2008
Bina Nusantara
Hampiran Numerik Turunan FungsiHampiran Numerik Turunan Fungsi
Tujuan:• Menghitung turunan fungsi secara numerik
jika nilai fungsi (data) empirik diketahui X0, X1, X2, …,Xn
• Sebagai penunjang untuk penyelesaian persamaan diferensial pada masalah nilai awal dan nilai batas
Bina Nusantara
Pendekatan Numerik Turunan Fungsi
Suatu fungsi f(x) dapat diekspansikan dengan Deret Taylor di sekitar x=x0
)(!
)()(''
!2
)()('.)()( 0
)(
30
2
00 xfk
xxf
xxfxxfxf k
k
k
∆x = x-x0
)('.)()( 00 xfxxfxf Aproksimasi order 1:
Sisanya menjadi error pemotongan atau O(∆X2)
Bina Nusantara
Finite Difference Approximations• Given a smooth fnc• Consider Taylor expansion
• Forward difference formula (1st order accurate!)
RRCf ,
...2
)()()()(
...2
)()()()(
2
2
hxf
hxfxfhxf
hxf
hxfxfhxf
hxfhxf
xf)()(
)(
Bina Nusantara
• Backward difference formula (2nd formula, 1st order accurate!)
• Centered difference formula (1-2, 2nd order accurate!)
• Centered 2nd order
hhxfhxf
xf2
)()()(
hhxfxf
xf)()(
)(
22
)()(2)()(
h
hxfxfhxfxf
Bina Nusantara
Rumus-rumus hampiran numerik turunan fungsi
1. Hampiran Selisih Maju (Forward-divided-diffrence)
h
xfhxfxf
)()()( 00
0'
h
xfhxfhxfxf
2
)(3)(4)2()( 000
0'
2000
0
)()(2)2()("
h
xfhxfhxfxf
20000
0
)(2)(5)2(4)3()("
h
xfhxfhxfhxfxf
,galat: O(h2)
,galat: O(h)
,galat: O(h2)
,galat: O(h)
Bina Nusantara
2. Hampiran Selisih Mundur (Backward-divided-diffrence)
h
hxfxfxf
)()()( 00
0'
h
hxfhxfxfxf
2
)2()(4)(3)( 000
0'
2000
0
)2()(2)()("
h
hxfhxfxfxf
20000
0
)3()2(4)(5)(2)("
h
hxfhxfhxfxfxf
,galat: O(h2)
,galat: O(h)
,galat: O(h2)
,galat: O(h)
Bina Nusantara
3. Hampiran Selisih Pusat (Centre-divided-diffrence)
h
hxfhxfxf
2
)()()( 00
0'
h
hxfhxfhxfhxfxf
12
)2()(8)(8)2()( 0000
0'
2000
0
)()(2)()("
h
hxfxfhxfxf
200000
0 12
)2()(16)(30)(16)2()("
h
hxfhxfxfhxfhxfxf
,galat: O(h4)
,galat: O(h2)
,galat: O(h4)
,galat: O(h2)
Bina Nusantara
Contoh:
1. Tentukan nilai hampiran turunan pertama fungsi berikut pada x=0.5 dengan ukuran langkah h = 0.25 untuk ketelitian yang maksimum
432 1.015.05.025.02.1)( xxxxxf Jawaban:
x0-2h = 0,…………………f(x0-2h) = 1.2x0-h = 0.25,…………….. f(x0-h) = 1.103516x0 = 0.5; …………….. f(x0) = 0.925x0+h = 0.75,……………..f(x0+h) = 0.6363281x0+2h = 1,…………….. …f(x0+2h) = 0.2
Bina Nusantara
%82.5859375.0
)25.0(2
)925.0(3)6363281.0(42.02
)(3)(4)2()( 000
0'
erelatifgalatdengan
h
xfhxfhxfxf
a. Forward divided diffrence
%77.3.878125.0
)25.0(2
2.1)035156.1(4)925.0(32
)2()(4)(3)( 000
0'
rrelatifgalatdengan
h
hxfhxfxfxf
b. Backward divided diffrence
Bina Nusantara
%0.9125.0
)25.0(12
2.1)035156.1(8)6363281.0(82.012
)2()(8)(8)2()( 0000
0'
rrelatifgalatdengan
h
hxfhxfhxfhxfxf
c. Centre divided diffrence
Bina Nusantara
2. Diberikan data dalam bentuk tabel sebagai berikut:
x f(x)
1.3 3.669
1.5 4.482
1.7 5.474
1.9 6.686
2.1 8.166
2.3 9.974
2.5 12.182
a. Hitung f’(1.7) dengan hampiran galat O(h4)b. Hitung f’(1.4) dengan hampiran selisih pusat dengan galat O(h2)c. Hitung f’(1.3); f”(1.3); f’(1.7) dan f”(1.7)