vt 3 8 10(3) 22m/s
Afdal, Jurusan Fisika Universitas Andalas 2021
Contoh pendiferensialan analitik:
Kecepatan jatuh seorang penerjun payung memenuhi persamaan:
gm t
c
dv
vt 1 e m
a (t ) ...
c dt
Tentukan persamaan percepatan penerjun setaip saat. Tentukan
percepatan penerjun 10 s setelah melompat.
t (s) v (m/s)
Contoh kasus 0,0 0,00
Tentukan percepatan setiap saat dari data 10,0 227,04
kecepatan setiap saat sebuah roket seperti
15,0 362,78
pada tabel.
Percepatan tidak dapat ditentukan 20,0 517,35
dengan pendiferensialan numerik. 22,5 602,97
30,0 901,67
8
6 y=f(x)=2x
4 y= f(x)=x*x
2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
x
• Pada fungsi y = f (x) = 3, nilai y tidak berubah walaupun nilai x
bertambah (laju perubahan y terhadap x adalah nol)
• Pada fungsi y = f (x) = 2x, nilai y bertambah 2 bila nilai x bertambah 1
(laju perubahan y terhadap x adalah 2)
• Bagaimana dengan fungsi y = f (x) = x*x ??
Afdal, Jurusan Fisika Universitas Andalas 2021
Buat garis singgung pada kurva, dan hitung kemiringan (gradien) nya!
18
16
14
12
10
y = f(x)= 3
y
8
y=f(x)=2x
6
y= f(x)=x*x
4
2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
x garis singgung
• Pada fungsi y = f (x) = 3, garis singgung berupa garis datar (tidak miring
atau kemiringan = nol, di titik manapun).
• Pada fungsi y = f (x) = 2x, garis singgung berupa garis miring
(kemiringan garis singgung = 2, di titik manapun).
Kemiringan garis singgung pada kurva = laju perubahan fungsi
Afdal, Jurusan Fisika Universitas Andalas 2021
Bagaimana menentukan laju Nilai rata-rata fungsi dalam selang
perubahan fungsi yang tidak waktu x = 2 dan x = 4:
linier (kurva lengkung ) ini? y f x f f xi f 4 f 2
Misalnya
x x f xi 42
f x x 2 y 16 4 12
6
18
x 4 2 2
16
y f x
Nilai ini sama dengan kemiringan
garis potong pada kurva (garis
14
12
biru).
10
y
8
Nilai rata-rata fungsi dalam selang
6
waktu x = 2 dan x = 3:
y f x f f xi 9 4 5
4
2 5
x x f xi 3 2 1
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
Nilai ini sama dengan kemiringan
x
garis potong pada kurva (garis
merah).
Afdal, Jurusan Fisika Universitas Andalas 2021
Tentukan nilai f’(x) di x = 2
f x x f x x x x 2
2
f ' x lim lim lim (2 x x) 2 x
x 0 x x 0 x x 0
18
f ' x 2 x f ' 2 2 * 2 4
16
14
12
Gradien (kemiringan = m)
10 garis singgunga pada kurva
di titik (2, 4) adalah
y
8
6
4 y 8 0 8
m 4
2 x 3 1 2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
f x x f x f x
f x lim
'
x 0 x
f dx x x x
f ' x lim
x 0 x dt
Untuk x yang berhingga, f x x f x
turunan dapat diaproksimasi f x
'
x
dengan
Skema Beda Maju (forward-difference)
f x x f x untuk menghitung turunan pertama
f x
'
t
f ( x h) f ( x) hf '( x)
f ( x h) f ( x) hf ' ( x)
h2 h3
f ( x h) f ( x) hf ' ( x) f ' ' ( x) f ' ' ' ( x) ...
2! 3!
1 1 f 2 f 1 4 1
f ' 1 3
1 1
2 4
f 3 f 2 9 4
3 9 f ' 2 5
1 1
4 16
f 4 f 3 16 9
5 25 f ' 3 7
1 1
f 5 f 4 25 16
f 4
'
9
Dengan skema beda maju 1 1
(forward-difference)
f 6 f 5 ? 25
f ( x h) f ( x ) f ' 5 ? (Tdk bisa dihitung !)
f '( x) 1 1
h
Afdal, Jurusan Fisika Universitas Andalas 2021
f ( x h ) f ( x h)
Dengan skema beda tengah f '( x)
2h
f 1 f 1 1 ?
f ' 0 ? Tidak bisa dihitung
2(1) 2
f 2 f 0 4 0
f ' 1 2
2(1) 2
f 3 f 1 9 1
f ' 2 4
2(1) 2
f '
3 f 4 f 2 16 4 6
2(1) 2
f 5 f 3 25 9
f ' 4 8
2(1) 2
f 6 f 4 ? 16
f 5
'
? (Tdk bisa dihitung !)
2(1) 2
Afdal, Jurusan Fisika Universitas Andalas 2021
f'(x)
x f(x)
FD BD CD Seharusnya
0 0 1 -- -- 0
1 1 3 1 2 2
2 4 5 3 4 4
3 9 7 5 6 6
4 16 9 7 8 8
5 25 -- 9 -- 10
CD lebih teliti!
Jadi, gunakan CD, kecuali untuk data pertama gunakan FD dan
untuk data terakhir gunakan BD.
Afdal, Jurusan Fisika Universitas Andalas 2021
Pseudo-code Diferensial Numerik (untuk data diketahui)
Bisa juga dibaca dari file data.
Pelajari kembali operasi file data
dalam Pascal.
f ( x 2h) f ( x) 2hf ' ( x) 2h 2 f ' ' ( x) 43 h 3 f ' ' ' ( x) ... (2)
4 1 2 :
4 f ( x h) f x 2h 4 f ( x) f x 4hf ' ( x) 2hf ' ( x) 23 h 3 f ' ' ' ( x)
Bila dipotong sampai suku yang sebanding dengan h3
( Ingat, skema FD sebelumnya hanya dipotong sampai suku yang sebanding dengan h2 )
f x 2 h 4 f ( x h ) 3 f ( x )
f ' ( x)
2h
Afdal, Jurusan Fisika Universitas Andalas 2021
f'(x)
x f(x)
FD BD CD Seharusnya FD lebih teliti
0 0 1 -- -- 0 0
1 1 3 1 2 2
2 4 5 3 4 4
3 9 7 5 6 6 6
4 16 9 7 8 8
5 25 -- -- -- 10
f ( x 2h) f ( x) 2hf ' ( x) 2h 2 f ' ' ( x) 43 h 3 f ' ' ' ( x) ... (2)
4 1 2 :
4 f ( x h) f x 2h 3 f ( x) 2hf ' ( x) 23 h 3 f ' ' ' ( x)
Bila dipotong sampai suku yang sebanding dengan h3
( Ingat, skema FD sebelumnya hanya dipotong sampai suku yang sebanding dengan h2 )
f x 2h 4 f ( x h) 3 f ( x)
f ' ( x)
2h
Afdal, Jurusan Fisika Universitas Andalas 2021
f'(x)
x f(x)
FD BD CD Seharusnya
0 0 1 -- -- 0
1 1 3 1 2 2
2 4 5 3 4 4
3 9 7 5 6 6
4 16 9 7 8 8
5 25 -- -- -- 10
f x 2 h 4 f ( x h ) 3 f ( x ) f 0 4 f (1) 3 f (2)
f ' ( x) f ' (2)
2h 2(1)
1 2 :
2h 3
f ( x h) f ( x h) 2hf ' ( x) f ' ' ' ( x) ...
3!
f ( x h) f ( x h ) 1 2
f ' ( x) h f ' ' ' ( x) ...
2h 6
f ( x h) f ( x h)
f ' ( x) kh 2 ..... (A)
2h
f ( x 2h) f ( x) 2hf ' ( x) 2h 2 f ' ' ( x) 43 h 3 f ' ' ' ( x) ... (4)
3 4 :
f ( x 2h) f x 2h 4hf ' ( x) 83 h 3 f ' ' ' ( x) ...
f ( x 2h) f x 2h 4 2
f ' ( x) 6 h f ' ' ' ( x) ...
4h
f ( x 2h) f x 2h
f ' ( x) 4kh 2 ... (B)
4h
4 f ( x h ) 4 f x h f ( x 2 h ) f x 2 h
4 f ' ( x) f ' ( x)
2h 4h
8 f ( x h) 8 f x h f ( x 2h) f x 2h
3 f ' ( x)
4h 4 h
f x 2h 8 f x h 8 f ( x h) f ( x 2h)
f ' ( x)
12h
Skema Ekstrapolasi Richardson
untuk menghitung turunan pertama
f ( x ) f ( x h)
f '( x)
h
f x 2 h 8 f x h 8 f ( x h ) f ( x 2 h )
f ' ( x)
12h
f ( x h) f ( x )
f '( x)
h
f ( x h) f ( x h )
f '( x)
2h
f ( x ) f ( x h)
f '( x)
h
f x 2 h 8 f x h 8 f ( x h ) f ( x 2 h )
f ' ( x)
12h
f ( x h) f ( x )
f '( x)
h
f ( x h) f ( x h )
f '( x)
2h
f ( x ) f ( x h)
f '( x)
h
f x 2 h 8 f x h 8 f ( x h ) f ( x 2 h )
f ' ( x)
12h
Soal Latihan
Cara Pertama:
Hitung turunan pertama dengan metode yang sudah
dijelaskan sebelumnya,
kemudian turunkan hasilnya sekali lagi.
Central difference:
h2 h3
f ( x h) f ( x) hf ' ( x) f ' ' ( x) f ' ' ' ( x) ... (1)
2! 3!
h2 h3
f ( x h) f ( x) hf ' ( x) f ' ' ( x) f ' ' ' ( x) ... (2)
2! 3!
1 2 :
f ( x h) f ( x h) 2 f ( x) h 2 f ' ' ( x) h 4 f ' ' ' ' ( x) / 12 ..
f ( x h) 2 f ( x ) f ( x h)
f ' ' ( x)
h2
Forward Difference
h2 h3
f ( x h) f ( x) hf ' ( x) f ' ' ( x) f ' ' ' ( x) ... (1)
2! 3!
f ( x 2h) f ( x) 2hf ' ( x) 2h 2 f ' ' ( x) 43 h 3 f ' ' ' ( x) ... (2)
2h 2 2h 3
2 (1) 2 f ( x h) 2 f ( x) 2hf ' ( x) f ' ' ( x) f ' ' ' ( x) ... (3)
2! 3!
3 2 :
2 f ( x h) f ( x 2h) f ( x) h 2 f ' ' ( x) Ch 3 f ' ' ' ( x) ...
Bila dipotong sampai suku yang sebanding dengan h4
2 f ( x h ) f ( x 2h) f ( x ) h 2 f ' ' ( x )
f ( x ) 2 f ( x h) f ( x 2 h)
f ' ' ( x)
h2
Backward Difference
h2 h3
f ( x h) f ( x) hf ' ( x) f ' ' ( x) f ' ' ' ( x) ... (1)
2! 3!
f ( x 2h) f ( x) 2hf ' ( x) 2h 2 f ' ' ( x) 43 h 3 f ' ' ' ( x) ... (2)
2h 2 2h 3
2 (1) 2 f ( x h) 2 f ( x) 2hf ' ( x) f ' ' ( x) f ' ' ' ( x) ... (3)
2! 3!
3 2 :
2 f ( x h) f ( x 2h) f ( x) h 2 f ' ' ( x) Ch 3 f ' ' ' ( x) ...
f ( x ) 2 f ( x h) f ( x 2h)
f ' ' ( x)
h2
Contoh
f'(x)
x f(x)
FD BD CD Seharusnya
0 0 2
1 1 2
2 4 2
3 9 2
4 16 2
f ( x h) 2 f ( x ) f ( x h)
f ' ' ( x)
h2
f (1 1) 2 f (1) f (1 1)
f ' ' (1)
12
f ( x 3h) f ( x) 3hf ' ( x) 92 h 2 f ' ' ( x) 276 h3 f ' ' ' ( x) ... (3)
f x 3h 4 f x 2h 5 f x h 2 f x
f ' ' x
h2
f 1 3 4 f 1 2 5 f 1 1 2 f 1
f ' ' 1
12
h2 h3 h4
f ( x h) f ( x) hf ' ( x) f ' ' ( x) f ' ' ' ( x) f ' ' ' ' ( x) ... (2)
2! 3! 4!
1 2 :
2 2h 4
f ( x h) f ( x h) 2 f ( x ) h f ' ' ( x ) f ' ' ' ' ( x)
4!
f ( x h ) 2 f x f ( x h ) 2 h 2
f ' ' ( x) 2
f ' ' ' ' ( x)
h 4!
f ( x h ) 2 f x f ( x h ) 2
f ' ' ( x) 2
kh ... (C)
h
Afdal, Jurusan Fisika Universitas Andalas 2021
f ( x 2h) f ( x) 2hf ' ( x) 2h 2 f ' ' ( x) 43 h 3 f ' ' ' ( x) 16
4! h 4 f ' ' ' ' ( x)
f ( x 2 h ) 2 f ( x ) f x 2 h 8 2
f ' ' ( x) 2
4! h f ' ' ' ' ( x) ...
4h
f ( x 2 h ) 2 f ( x ) f x 2 h 2
f ' ' ( x) 2
4 kh ... (D)
4h
4 f ( x h) 8 f x 4 f ( x h) f ( x 2h) 2 f ( x) f x 2h
4 f ' ' ( x) f ' ' ( x) 2
2
h 4 h
16 f ( x h) 32 f x 16 f ( x h) f ( x 2h) 2 f ( x) f x 2h
3 f ' ' ( x) 2
2
4h 4 h
f ( x 2h) 16 f ( x h) 30 f ( x) 16 f ( x h) f ( x 2h)
f ' ' ( x)
12h 2
f ( x h) f ( x h) f ( x h) f ( x h )
f '( x) f '( x )
2h 2h
f 3 f 1 27 1 f 2,1 f 1,9 9,261 6,859
f ' 2 13 f ' 2 12,01
2(1) 2 2(0,1) 0,2
Analitik: f ' x 3 x 2 Error untuk h = 1 adalah 1
f x x 3
f ' 2 3 2 2 12 Error untuk h = 0,1 adalah 0,01
Afdal, Jurusan Fisika Universitas Andalas 2021
Effect Of Step Size
f ( x) 9e 4 x f ' ( x) 36e 4 x f ' (2) 36e 4( 0, 2) 80,119473
'
Value of f (0.2) Using backward divided difference method.
http://numericalmethods.eng.usf.edu
Effect of Step Size on Approximate Error
2
Ea
0
1 3 5 7 9 11
http://numericalmethods.eng.usf.edu
Effect Of Step Size
f ( x ) 9e 4 x f ' ( x) 36e 4 x f ' (2) 36e 4( 0, 2) 80,119473
'
Value of f (0.2) Using central divided difference method.
http://numericalmethods.eng.usf.edu
Effect of Step Size on Approximate Error
http://numericalmethods.eng.usf.edu
Example 1
The velocity of a rocket is given by
14 10 4
t 2000 ln 4 9.8t ,0 t 30
14 10 2100t
Use forward difference approximation of the first derivative of νt to calculate the
acceleration at t 16 s . Use a step size of t 2 s .