Hampiran Numerik Turunan Fungsi

You might also like

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

Matakuliah : METODE NUMERIK I

Tahun : 2008

Hampiran Numerik Turunan Fungsi


Pertemuan 9
Hampiran 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

(x)
2 
(x) ( k )
k
f ( x)  f ( x0 )  x. f ' ( x0 )  f ' ' ( x0 )   f ( x0 )
2! k 3 k!

Aproksimasi order 1: f ( x)  f ( x0 )  x. f ' ( x0 )


∆x = x-x0
Sisanya menjadi error pemotongan atau O(∆X2)

Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
Bina Nusantara
Finite Difference Approximations
• Given a smooth fnc f  C  R, R 
• Consider Taylor expansion
f ( x ) 2
f ( x  h )  f ( x )  f ( x ) h  h  ...
2
f ( x ) 2
f ( x  h)  f ( x )  f ( x ) h  h  ...
2

• Forward difference formula (1st order accurate!)


f ( x  h)  f ( x )
f ( x) 
h

Bina Nusantara
• Backward difference formula (2nd formula, 1st order accurate!)
f ( x )  f ( x  h)
f ( x) 
h
• Centered difference formula (1-2, 2nd order accurate!)
f ( x  h)  f ( x  h)
f ( x) 
2h
• Centered 2nd order
f ( x  h)  2 f ( x )  f ( x  h)
f ( x ) 
2h 2

Bina Nusantara
Rumus-rumus hampiran numerik turunan fungsi
1. Hampiran Selisih Maju (Forward-divided-diffrence)
f ( x 0  h)  f ( x 0 ) ,galat: O(h)
f ( x0 ) 
'

h
 f ( x 0  2h)  4 f ( x 0  h)  3 f ( x 0 ) ,galat: O(h2)
f ( x0 ) 
'

2h
f ( x 0  2 h)  2 f ( x 0  h )  f ( x 0 ) ,galat: O(h)
f " ( x0 ) 
h2
 f ( x0  3h)  4 f ( x0  2h)  5 f ( x0  h)  2 f ( x0 ) ,galat: O(h2)
f " ( x0 ) 
h2

Bina Nusantara
2. Hampiran Selisih Mundur (Backward-divided-diffrence)

f ( x 0 )  f ( x 0  h) ,galat: O(h)
f ( x0 ) 
'

h
3 f ( x 0 )  4 f ( x 0  h )  f ( x 0  2 h) ,galat: O(h2)
f ( x0 ) 
'

2h
f ( x 0 )  2 f ( x 0  h)  f ( x 0  2h) ,galat: O(h)
f " ( x0 ) 
h2
2 f ( x0 )  5 f ( x0  h)  4 f ( x0  2h)  f ( x0  3h) ,galat: O(h2)
f " ( x0 ) 
h2

Bina Nusantara
3. Hampiran Selisih Pusat (Centre-divided-diffrence)

f ( x 0  h)  f ( x 0  h) ,galat: O(h2)
f ( x0 ) 
'

2h
 f ( x0  2h)  8 f ( x0  h)  8 f ( x0  h)  f ( x0  2h) ,galat: O(h4)
f ( x0 ) 
'

12h
f ( x 0  h)  2 f ( x 0 )  f ( x 0  h) ,galat: O(h2)
f " ( x0 ) 
h2
 f ( x0  2h)  16 f ( x0  h)  30 f ( x0 )  16 f ( x0  h)  f ( x0  2h)
f " ( x0 ) 
12h 2
,galat: O(h4)

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

f ( x)  1.2  0.25x  0.5 x  0.15x  0.1x


2 3 4

Jawaban:
x0-2h = 0,…………………f(x0-2h) = 1.2
x0-h = 0.25,…………….. f(x0-h) = 1.103516
x0 = 0.5; …………….. f(x0) = 0.925
x0+h = 0.75,……………..f(x0+h) = 0.6363281
x0+2h = 1,…………….. …f(x0+2h) = 0.2

Bina Nusantara
a. Forward divided diffrence
 f ( x 0  2h)  4 f ( x 0  h)  3 f ( x 0 )
f ( x0 ) 
'

2h
 0.2  4(0.6363281)  3(0.925)

2(0.25)
 0.859375 dengan galat relatif  e  5.82 %
b. Backward divided diffrence
3 f ( x 0 )  4 f ( x 0  h)  f ( x 0  2h)
f ( x0 ) 
'

2h
3(0.925)  4(1.035156)  1.2

2(0.25)
 0.878125. dengan galat relatif  r  3.77 %
Bina Nusantara
c. Centre divided diffrence

 f ( x 0  2h )  8 f ( x 0  h )  8 f ( x 0  h )  f ( x 0  2h )
f ( x0 ) 
'

12h
 0.2  8(0.6363281)  8(1.035156)  1.2

12(0.25)
 0.9125. dengan galat relatif  r  0 %

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)
Bina Nusantara

You might also like