GROUP 1
O
RDINARY
D
IFFERENTIAL
DEPARTEMEN MATEMATIKA FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM INSTITUT PERTANIAN BOGOR 2016
E
QUATIONS
HELEN P. SYIFA N. A. DITA W. A. LILIK H. HIDAYATUL M. AGUSYARIF R. N. RIDHO A.P
ENDAHULUAN
SYIFA N. AINISA G54120031
DEPARTEMEN MATEMATIKA FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM INSTITUT PERTANIAN BOGOR 2016
Persamaan Differensial yang hanya memiliki satu variabel bebas.
Pendahuluan
PERSAMAAN DIFFERENSIAL
Gabungan dari fungsi yang tidak diketahui dengan turunannya. Kategori
Persamaan Differensial yang memiliki lebih dari
satu variabel bebas.
PD BIASA PD PARSIAL
PDB Orde 1 :
Turunan tertingginya adalah turunan pertama PDB Orde 2 :
Turunan kedua merupakan turunan tertingginya PDB Orde 3 :
Turunan ketiga merupakan turunan tertingginya Dan seterusnya
Persamaan diferensial biasa
Persamaan diferensial parsial
1.
𝑑𝑦
𝑑𝑥
= 𝑥 + 𝑦
2. 𝑦′ = 𝑥
2+ 𝑦
23.
𝑑𝑦
𝑑𝑥
+ 𝑥
2𝑦 − 𝑦 = 0
4. 𝑦
′′+ 𝑦
′𝑐𝑜𝑠𝑥 − 3𝑦 = 𝑠𝑖𝑛𝑥
𝜕
2𝑢
𝜕𝑥
2+
𝜕
2𝑢
𝜕𝑦
2= 6𝑥𝑦𝑒
𝑥+𝑦Persamaan diferensial
1.
PDB orde 1
2.PDP
3.Bukan PD
4.PDB orde 2
5.PDB orde 3
6.Bukan PD
7.PDP
8.PDB orde 1
5 2 2 ' x y y 0 2 x2y y dx dy ) 2 ( 3 ) ( ' '' y Cos x y Sin x y '' 1 ' 2 '' ' 2y y y 2 2 2 2 2 ) 1 ( ) ( 3 y u x x u t x Sin t u 4 ) ( ' x x2 x f ) ( ; 17 3 ' t3 t 5 y f t y y x xye y u x u 6 2 2 2 2Pendahuluan
PERSAMAAN DIFERENSIAL
Penerapan
Persamaan Diferensial
7
Pendahuluan
SOLUSI PDB
Solusi Analitik
Solusi Numerik
Salah satunya dengan teknik integral.
Menggunakan metode hampiran
Persamaan
diferensial
tidak dapat diselesaikan secara analitik
Metode Numerik
Metode Runge-Kutta Metode Euler
Metode Deret Taylor
Metode Heun Karl Heun Carl David Tolmé Runge Martin Wilhelm Kutta Leonhard Euler Brook Taylor
1
2
3
4
M
ETODE
N
UMERIK
DEPARTEMEN MATEMATIKA FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM INSTITUT PERTANIAN BOGOR 2016
Metode
Euler
Metode euler merupakan metode numerik paling sederhana dan diturunkan dari deret Taylor
Metode
Euler
𝑦
𝑖+1= 𝑦
𝑖+ ℎ𝑓(𝑥
𝑖, 𝑦
𝑖)
𝑑𝑦 𝑑𝑥 = 𝑦 ′ = 𝑓 𝑥, 𝑦 , 𝑦(𝑥 0) = 𝑦0 𝑦𝑟 = 𝑦(𝑥𝑟)dengan diberikan PDB orde satu
Misalkan
BENTUK UMUM
Metode euler dinyatakan sebagai
ℎ = 𝑏 − 𝑎 𝑛
13
• Deret Taylor : uraikan 𝑦(𝑥𝑟+1) disekitar 𝑥𝑟
• Dipotong sampai orde 3 :
• Karena 𝑦’(𝑥𝑟) = 𝑓(𝑥𝑟, 𝑦𝑟) dan 𝑥𝑟+1 − 𝑥𝑟 = ℎ, maka :
... ) ( '' ! 2 ) ( ) ( ' ! 1 ) ( ) ( ) ( 2 1 1 1 r r r r r r r r y x x x x y x x x y x y ) ( '' ! 2 ) ( ) ( ' ! 1 ) ( ) ( ) ( 2 1 1 1 r r r r r r r r y x x x x y x x x y x y
Metode
Euler
PENURUNAN
n r h O y x hf x y x y( r1) ( r) ( r, r) ( 2); 0,1,2,...,14
f(x,y) adalah persamaan differensial yang dapat digambarkan
sebagai gradien garis singgung di titik (x,y).
Garis singgung ditarik menyinggung titik (x0,y0) untuk
menemukan nilai y(x1), pada titik (x1,y1) ditarik lagi garis yang
menyinggung titik tersebut dengan fungsi f(x,y) untuk
mendapatkan f(x2) dan seterusnya.
Metode
Euler
0 1 2 3 4 5 6 7 8 0 0.5 1 1.5 2 2.5 3 3.5 4 y(x) dy/dx 15 (x1,y1) (x0,y0) (x2,y2) (x3,y3) (x4,y4) (x5,y5) (x6,y6) (x7,y7) (x8,y8)
Metode
Euler
0 1 2 3 4 5 6 7 0 0.5 1 y(x) yr Yr+1 sejati Yr+1 hampiran Yr sejati A B C galat h h y y AB BC x y y x f x y m r r r r r 1 ) , ( ) ( '
Metode
Euler
)
,
(
1 r r r ry
hf
x
y
y
r r r r y y y x hf ( , ) 1 17 • Galat Pemotongan • Galat Kumulatif ) ( ) ( ' ' 2 1 2 2 h O t y h Ep ) ( 2 ) ( '' ) ( ) ( '' 2 ) ( ) ( '' 2 ) ( '' 2 1 2 2 2 1 h O t hy a b t y h h a b y y nh t y h E n r kumulatif
Metode
Euler
GALAT
18
𝑑𝑦
𝑑𝑥
= 𝑥 + 𝑦 ; 𝑦(0) = 1
Berapa
𝑦(0.1) dengan langkah ℎ = 0.02 dan ℎ = 0.05, jika
diketahui fungsi asli adalah
𝑦 𝑥 = 𝑒
𝑥− 𝑥 − 1, langkah mana
yang lebih teliti ? (𝑎 = 0, 𝑏 = 0.1)
Metode
Euler
h = 0.02 x = 0 y(0) = 1 x = 0.02 y(0.02) = 1 + 0.02(0+1) = 1.02 x = 0.04 y(0.04) = 1.02 + 0.02(0.02+1.02) = 1.0408 x = 0.06 y(0.06) = 1.0408 + 0.02(0.04+1.0408) = 1.062416 x = 0.08 y(0.08) = 1.062416 + 0.02(0.06+1.062416) = 1.084864 x = 0.1 y(0.1) = 1.084864 + 0.02(0.08+1.084864) = 1.108162 𝑦 0.1 = 𝑒0.1 − 0.1 − 1 = 1.1103 h = 0.05 x = 0 y(0) = 1 x = 0.05 y(0.05) = 1 + 0.05(0+1) = 1.05 x = 0.1 y(0.1) = 1.05 + 0.05(0.05+1.05) = 1.1025
Metode
Euler
Penyelesaian Contoh Soal 1
Langkah h = 0.02 lebih teliti
Solusi Metode Euler 𝑦
′= 𝑥 + 𝑦 + 1, 𝑦 0 = 0
Contoh 2
Perbandingan penyelesaian eksak dan metode euler
Metode
Heun
Metode
Heun
• Predictor:
• Corrector:
• Bentuk umum persamaan metode Heun:
Metode
Heun
• Galat perlangkah metode Heun sama dengan galat kaidah
trapesium, yaitu:
• Galat longgokannya adalah:
Metode
Heun
Metode
Heun
Metode Heun dapat diperluas dengan meneruskan
langkahnya sebagai berikut:
Metode
Heun
Kondisi berhenti adalah bila
Dengan
adalah batas galat yang diinginkan. Jika iterasinya
dilakukan satu kali (sampai dengan
saja), maka
langkahnya dinamakan iterasi satu lemparan (one shot
Penyelesaian:
Metode
Heun
Metode
Heun
Metode
Heun
Metode
Deret Taylor
Metode
Deret Taylor
𝑦 𝑥
𝑟+1=
𝑖=0 ∞ℎ𝑦
𝑖𝑥
𝑟𝑖!
= 𝑦 𝑥
𝑟+ ℎ𝑦
′𝑥
𝑟+
ℎ
2𝑦
′′(𝑥
𝑟)
2!
+ ⋯ +
ℎ
𝑛𝑦
𝑛𝑥
𝑟𝑛!
+ ⋯
dengan ℎ = 𝑥
𝑟+1− 𝑥
𝑟dan 𝑟 = 0,1, … 𝑛
Diketahui PDB orde 1 yaitu
𝑑𝑦
𝑑𝑥 = 𝑦
′ = 𝑓(𝑥, 𝑦) dengan nilai awal 𝑦 𝑥
0 = 𝑦0.
Misalkan 𝑦 𝑥𝑟+1 adalah hampiran nilai 𝑦 di 𝑥𝑟+1 dengan 𝑟 = 0,1, … 𝑛.
𝑦 𝑥𝑟+1 diuraikan dengan deret Taylor di sekitar 𝑥𝑟:
Galat pemotongan
𝑦 𝑥
𝑟+1≈ 𝑦 𝑥
𝑟+ ℎ𝑦
′𝑥
𝑟+ ⋯ +
ℎ
𝑛
𝑦
𝑛𝑥
𝑟
𝑛!
Metode
Deret Taylor
Metode Deret Taylor Orde n
𝑦 𝑥𝑟+1 = 𝑦 𝑥𝑟 + ℎ𝑦′ 𝑥𝑟 + ⋯ +ℎ 𝑛𝑦 𝑛 𝑥 𝑟 𝑛! + ℎ𝑛+1𝑦 𝑛+1 𝑥𝑟 (𝑛 + 1)! + ⋯
Galat perlangkah setelah pemotongan ke n
𝐸
𝑃≈
ℎ
𝑛+1𝑓
𝑛+1𝑡
𝑛 + 1 !
, 𝑥
0< 𝑡 < 𝑥
𝑟+1= 𝑂(ℎ
𝑛+1)
𝐸
𝐾≈ 𝑛.
ℎ
𝑛+1𝑓
𝑛+1𝑡
𝑛 + 1 !
, 𝑎 < 𝑡 < 𝑏
=
𝑏−𝑎 ℎ.
ℎ𝑛+1𝑓 𝑛+1 𝑡 𝑛+1 != 𝑏 − 𝑎 .
ℎ𝑛𝑓 𝑛+1 𝑡 𝑛+1 != 𝑂(ℎ
𝑛)
Galat kumulatif
Metode
Deret Taylor
Metode
Deret Taylor
Diketahui PDB : 𝑑𝑦
𝑑𝑥 = 𝑥 + 𝑦 ; 𝑦 0 = 1.
Hitung 𝑦(0.1) dengan metode deret Taylor orde 4 (h=0.05). Nilai sejati solusi PDB yaitu y(0.1)=1.1103.
Jawaban: Banyak iterasi = 𝑛 = 𝑏−𝑎 ℎ = 0.1−0 0.05 = 2 Hampiran 𝑦 di 𝑥𝑟+1 : 𝑦𝑟+1 ≈ 𝑦 𝑥𝑟 + ℎ𝑦′ 𝑥𝑟 + ℎ 2𝑦 2 𝑥 𝑟 2 + ℎ3𝑦 3 𝑥𝑟 6 + ℎ4𝑦 4 𝑥𝑟 12
Contoh Soal
Metode
Deret Taylor
Iterasi 1 𝑥0 = 0 ; 𝑦0 = 1 𝑥1 = 𝑥0 + ℎ = 0.05 ; 𝑦1 =? 𝑦′ 𝑥0 = 𝑥 + 𝑦 = 0 + 1 = 1 𝑦 2 𝑥0 = 1 + 𝑥 + 𝑦 = 1 + 0 + 1 = 2 𝑦 3 𝑥0 = 1 + 𝑥 + 𝑦 = 1 + 0 + 1 = 2 𝑦 4 𝑥0 = 1 + 𝑥 + 𝑦 = 1 + 0 + 1 = 2 𝑦1 = 𝑦 0.05 = 𝑦 𝑥0 ≈ 𝑦 𝑥0 + ℎ𝑦′ 𝑥0 + ℎ2𝑦 2 𝑥0 2 + ℎ3𝑦 3 𝑥0 6 + ℎ4𝑦 4 𝑥0 12 𝑦1 = 1 + 0.05 + 0.05 2(2) 2 + 0.053(2) 6 + 0.054(2) 12 = 1.052542708 Mencari turunan 𝑦′ 𝑥 = 𝑥 + 𝑦 𝑦 2 𝑥 = 1 + 𝑦′ = 1 + 𝑥 + 𝑦 𝑦 3 𝑥 = 𝑑(1 + 𝑥 + 𝑦) 𝑑𝑥 = 1 + 𝑥 + 𝑦 𝑦 4 𝑥 = 𝑑(1 + 𝑥 + 𝑦) 𝑑𝑥 = 1 + 𝑥 + 𝑦Metode
Deret Taylor
Iterasi 2 𝑥1 = 0.05; 𝑦0 = 1.052542708 𝑥2 = 𝑥1 + ℎ = 0.1 ; 𝑦2 =? 𝑦′ 𝑥1 = 𝑥 + 𝑦 = 0.05 + 1.052542708 = 1.102542708 𝑦 2 𝑥1 = 1 + 𝑥 + 𝑦 = 1 + 0.05 + 1.052542708 = 2.102542708 𝑦 3 𝑥1 = 1 + 𝑥 + 𝑦 = 1 + 0.05 + 1.052542708 = 2.102542708 𝑦 4 𝑥1 = 1 + 𝑥 + 𝑦 = 1 + 0.05 + 1.052542708 = 2.102542708 𝑦2 = 𝑦 0.1 = 𝑦 𝑥1 ≈ 𝑦 𝑥1 + ℎ𝑦′ 𝑥1 + ℎ2𝑦 2 𝑥1 2 + ℎ3𝑦 3 𝑥1 6 + ℎ4𝑦 4 𝑥1 12 𝑦2 = 1.052542708 + 0.05 1.102542708 + 0.05 2 2.102542708 2 + 0.053(2.102542708) 6 + 0.054(2.102542708) 12 = 1.11034292Diperoleh hampiran nilai y(0.1) dengan metode deret Taylor orde 4 yaitu 1.11034292 Galat absolut = |nilai sejati-nilai hampiran |=|1.1103-1.11034292|=0.00004292
Metode
Runge-Kutte
HELEN PARKHURST(G551150041)
Metode Runge-Kutta adalah alternatif lain dari metode deret Taylor yang tidak membutuhkan perhitungan turunan.
Bentuk Umum Runge Kutte Orde-n:
𝑦𝑛+1 = 𝑦𝑟 + 𝑎1𝑘1 + 𝑎2𝑘2 + ⋯ + 𝑎𝑛𝑘𝑛 , 𝑎1, 𝑎2, … , 𝑎𝑛 = ketetapan Dimana: 𝑘1 = ℎ𝑓 𝑥𝑟, 𝑦𝑟 𝑘2 = ℎ𝑓 𝑥𝑟 + 𝑝1ℎ, 𝑦𝑟 + 𝑞11𝑘1 𝑘3 = ℎ𝑓 𝑥𝑟 + 𝑝2ℎ, 𝑦𝑟 + 𝑞21𝑘1 + 𝑞22𝑘2 … 𝑘𝑛 = ℎ𝑓 𝑥𝑟 + 𝑝𝑛−1ℎ, 𝑦𝑟 + 𝑞𝑛−1,1𝑘1 + 𝑞𝑛−1,2𝑘2 + ⋯ + 𝑞𝑛−1,𝑛−1𝑘𝑛−1
Galat langkah Metode Runge-Kutte orde-n: 𝑂 ℎ𝑛+1 Galat longgokan Metode Runge-Kutte orde-n: 𝑂 ℎ𝑛
Bentuk Umum, Runge Kutte Orde-1:
𝑘1 = ℎ𝑓 𝑥𝑟, 𝑦𝑟
𝑦𝑟+1 = 𝑦𝑟 + 𝑎1𝑘1 ; . . . (i)
Dengan menggunakan Rumus Taylor
𝑦𝑟+1 = 𝑦𝑟 + ℎ 1!𝑦′𝑟 + ℎ2 2! 𝑦′′𝑟 + ℎ3 3! 𝑦′′′𝑟 𝑦𝑟+1 = 𝑦𝑟 + ℎ𝑓 𝑥𝑟, 𝑦𝑟 + 𝑂(ℎ2) . . . (ii)
Melalui persamaan (i) dan (ii) diperoleh 𝑎1 = 1
Sehingga diperoleh: 𝑦𝑟+1 = 𝑦𝑟 + 𝑘1 𝑦𝑟+1 = 𝑦𝑟 + ℎ𝑓 𝑥𝑟, 𝑦𝑟
Galat Langkah Runge-Kutta: 𝐸 = ℎ2
2! 𝑦"𝑟 = 𝑂 ℎ 2 Galat Longgokan Runge-Kutta:
𝐸𝑡𝑜𝑡 = 𝑖=1 𝑛 ℎ2 2! 𝑦"𝑟 = 𝑛 ℎ 2 2! 𝑦"𝑟 = 𝑥𝑟+1 − 𝑥𝑟 ℎ − ℎ2 2! 𝑦"𝑟 = 𝑥𝑟+1 − 𝑥𝑟 ∙ ℎ 2!𝑦"𝑟 = 𝑂 ℎ EULER
Metode
Runge-Kutta
Bentuk Metode Runge-Kutta Orde satu: 𝑘1 = ℎ𝑓(𝑥𝑟, 𝑦𝑟) 𝑦𝑟+1 = 𝑦𝑟+(𝑎1𝑘1)
Yang termasuk ke dalam metode Runge-Kutta orde satu adalah metode Euler
𝑘1 = ℎ𝑓(𝑥𝑟, 𝑦𝑟)
𝑦𝑟+1 = 𝑦𝑟+ℎ𝑓1
Dalam hal ini 𝑎1 = 1
Metode
Runge-Kutte
Orde 2-Orde 3
AGUSYARIF REZKA NUHA (G551150171)
LILIK HARDIANTI (G5511502510
Bentuk Metode Runge-Kutta Orde satu:
𝑘
1= ℎ𝑓(𝑥
𝑟, 𝑦
𝑟)
𝑦
𝑟+1= 𝑦
𝑟+(𝑎
1𝑘
1)
Yang termasuk ke dalam metode Runge-Kutta orde satu
adalah metode Euler
𝑘
1= ℎ𝑓(𝑥
𝑟, 𝑦
𝑟)
𝑦
𝑟+1= 𝑦
𝑟+ℎ𝑓
1Dalam hal ini 𝑎
1= 1
Perhatikan deret taylor untuk 𝑦
𝑟+1sebagai berikut:
𝑦
𝑟+1= 𝑦
𝑟+ ℎ𝑦
𝑟′+
1
2
ℎ
2
𝑦
𝑟′′
+ ⋯
Bentuk 𝑦
𝑟′diubah menjadi bentuk 𝑓(𝑥
𝑟, 𝑦
𝑟)
Perhatikan bahwa
𝑦
𝑟′= 𝑓(𝑥
𝑟, 𝑦
𝑟)
𝑦
𝑟′′= 𝑓
𝑥𝑥
𝑟, 𝑦
𝑟+ 𝑓(𝑥
𝑟, 𝑦
𝑟) 𝑓
𝑦(𝑥
𝑟, 𝑦
𝑟)
Sehingga deret Taylor untuk 𝑦𝑟+1 dapat diubah sebagai berikut:
𝑦𝑟+1 = 𝑦𝑟 + ℎ𝑓 𝑥𝑟, 𝑦𝑟 + 1
2ℎ 2[𝑓
𝑥 𝑥𝑟, 𝑦𝑟 + 𝑓(𝑥𝑟, 𝑦𝑟) 𝑓𝑦(𝑥𝑟, 𝑦𝑟) + ...
Perhatikan bentuk umum Metode Runge-Kutta
Orde 2 yang menggunakan kombinasi linear 2 fungsi untuk menyatakan
𝑦𝑟+1 :
𝑦𝑟+1 = 𝑦𝑟+𝑎1𝑘1+𝑎2)
dengan:
𝑘1 = ℎ𝑓 𝑥𝑟, 𝑦𝑟
𝑘2 = ℎ𝑓 𝑥𝑟 + 𝑝1ℎ, 𝑦𝑟 + 𝑞11𝑘1
akan mencari nilai dari 𝑎1, 𝑎2, 𝑝1, 𝑞11agar persamaan
𝑦𝑟+1 = 𝑦𝑟+𝑎1𝑘1+𝑎2𝑘2 akurat.
Ekspansi taylor untuk fungsi dua peubah 𝑘2 sebagai berikut:
𝑘2 = ℎ[𝑓 + 𝑝1ℎ𝑓𝑥(𝑥𝑟, 𝑦𝑟) + 𝑞11𝑘1𝑓𝑦(𝑥𝑟, 𝑦𝑟]
𝑘2 = ℎ[𝑓(𝑥𝑟, 𝑦𝑟) + 𝑝1ℎ𝑓𝑥(𝑥𝑟, 𝑦𝑟) + 𝑞11ℎ𝑓(𝑥𝑟, 𝑦𝑟)(𝑓𝑦(𝑥𝑟, 𝑦𝑟)]
diperoleh:
𝑘2 = ℎ[𝑓(𝑥𝑟, 𝑦𝑟) + ℎ(𝑝1𝑓𝑥(𝑥𝑟, 𝑦𝑟) + 𝑞11𝑓(𝑥𝑟, 𝑦𝑟)(𝑓𝑦 𝑥𝑟, 𝑦𝑟 )]
Subtitusi nilai 𝑘1, dan 𝑘2 ke bentuk umum runge-kutta orde 2
𝑦𝑟+1 = 𝑦𝑟+𝑎1ℎ𝑓(𝑥𝑟, 𝑦𝑟)+𝑎2ℎ𝑓(𝑥𝑟, 𝑦𝑟) + 𝑎2ℎ2𝑝1𝑓𝑥(𝑥𝑟, 𝑦𝑟) + 𝑎2ℎ2𝑞11𝑓(𝑥𝑟, 𝑦𝑟)𝑓𝑦 𝑥𝑟, 𝑦𝑟 +…
𝑦𝑟+1 = 𝑦𝑟 + 𝑎1 + 𝑎2 ℎ𝑓 𝑥𝑟, 𝑦𝑟 +
𝑎2ℎ2 𝑝1𝑓𝑥 𝑥𝑟, 𝑦𝑟 + 𝑞11𝑓 𝑥𝑟, 𝑦𝑟 𝑓𝑦 𝑥𝑟, 𝑦𝑟 + ⋯
Sehingga diperoleh persamaan-persamaan berikut: h𝑓 𝑥𝑟, 𝑦𝑟 = 𝑎1 + 𝑎2 ℎ𝑓 𝑥𝑟, 𝑦𝑟 𝑎1 + 𝑎2 = 1 1 2 ℎ 2𝑓 𝑥 𝑥𝑟, 𝑦𝑟 = 𝑎2𝑝1ℎ2𝑓𝑥 𝑥𝑟, 𝑦𝑟 𝑎2𝑝1= 1 2 1 2ℎ 2𝑓 𝑦 𝑥𝑟, 𝑦𝑟 𝑓 𝑥𝑟, 𝑦𝑟 =𝑎2𝑞11ℎ2𝑓𝑦 𝑥𝑟, 𝑦𝑟 𝑓 𝑥𝑟, 𝑦𝑟 𝑎2𝑞11 = 1 2
Karena sistem persamaan terdiri atas 3 prsamaan dengan 4 peubah acak yang tidak diketahui maka solusinya banyak.
Solusi hanya dapat diperoleh dengan memberikan sebuah peubah
dengan sebuah harga. Misalkan ditentukan 𝑎2 = t, t ∈ 𝑅, maka
𝑎1 = 1 − 𝑎2 = 1 − 𝑡 𝑝1 = 1 2𝑎2 = 1 2𝑡 𝑞11 = 1 2𝑎2 = 1 2𝑡
Dengan memberikan nilai t = 1
2, diperoleh
𝑎1 = 𝑎2 = 1
2 , 𝑝1 = 𝑞11 = 1
Sehingga bentuk Metode Runge-Kutta orde 2 adalah sebagai berikut: 𝑘1 = ℎ𝑓 𝑥𝑟, 𝑦𝑟 𝑘2 = ℎ𝑓 𝑥𝑟 + ℎ, 𝑦𝑟 + 𝑘1 𝑦𝑟+1 = 𝑦𝑟+1 2 (𝑘1+𝑘2)
Metode Runge-Kutta Orde 3 berbentuk: 𝑘1 = ℎ𝑓 𝑥𝑟, 𝑦𝑟 𝑘2 = ℎ𝑓 𝑥𝑟 + 1 2ℎ, 𝑦𝑟 + 1 2 𝑘1 𝑘3 = ℎ𝑓 𝑥𝑟 + ℎ, 𝑦𝑟 − 𝑘1 + 2𝑘2 𝑦𝑟+1 = 𝑦𝑟 + 1 6 (𝑘1 + 4𝑘2 + 𝑘3)
Galat per langkah metode R-K orde tiga adalah O(ℎ4)
Galat kumulatif metode R-K orde tiga adalah O(ℎ3)
Bentuk ekspansi taylor untuk 𝑓(𝑥 + 𝑐, 𝑦 + 𝑑) dengan galat O(ℎ3) ialah:
𝑓 𝑥 + 𝑐, 𝑦 + 𝑑 = 𝑓 + 𝑐𝑓𝑥 + 𝑑𝑓𝑦 + 1
2 (𝑐
2𝑓
𝑥𝑥 + 2𝑐𝑑𝑓𝑥𝑦 + 𝑑2𝑓𝑦𝑦)
Bentuk umum metode runge-kutta orde y ialah:
𝑦
𝑟+1= 𝑦
𝑟+𝑎
1𝑘
1+𝑎
2𝑘
2+ 𝑎
3𝑘
3Dengan: 𝑘1 = ℎ𝑓 𝑥𝑟, 𝑦𝑟 𝑘2 = ℎ𝑓 𝑥𝑟 + 𝑝1ℎ, 𝑦𝑟 + 𝑞11𝑘1 = ℎ 𝑓 + ℎ(𝑝1𝑓𝑥 + 𝑞11𝑓𝑓𝑦 + ℎ2 2 (𝑝1 2𝑓 𝑥𝑥 + 2𝑝1𝑞11𝑓𝑓𝑥𝑦 + 𝑞112 𝑓2𝑓𝑦𝑦)] 𝑘3 = ℎ𝑓 𝑥𝑟 + 𝑝2ℎ, 𝑦𝑟 + (𝑞21𝑘1 + 𝑞22𝑘2 = ℎ[𝑓 + 𝑝2ℎ𝑓𝑥 + 𝑞21ℎ𝑓𝑓𝑦 + 𝑞22𝑘2𝑓𝑦 + ℎ2 2 (𝑝2 2𝑓 𝑥𝑥 + 2𝑝2𝑞21𝑓𝑓𝑥𝑦 + 𝑞212 𝑓2𝑓𝑦𝑦)
Metode
Runge-Kutta Orde 3
+1
2(2𝑝2ℎ𝑞22𝑘2𝑓𝑥𝑦 + 2𝑞21𝑞22ℎ𝑘2𝑓𝑓𝑦𝑦 + 𝑞22 2 𝑘
𝑘3 = ℎ[𝑓 + 𝑝2ℎ𝑓𝑥 + 𝑞21ℎ𝑓𝑓𝑦 + ℎ2 2 (𝑝2 2𝑓 𝑥𝑥 + 2𝑝2𝑞21𝑓𝑓𝑥𝑦 + 𝑞212 𝑓2𝑓𝑦𝑦) +𝑞22𝑓𝑦𝑘2 + 1 2(2𝑝2 ℎ𝑞22𝑓𝑥𝑦 + 2𝑞21𝑞22ℎ𝑓𝑓𝑦𝑦)𝑘2 + 1 2𝑞22 2 𝑓 𝑦𝑦𝑘22]
Metode
Runge-Kutta Orde 3
Subtitusi nilai 𝑘2, diperoleh:
𝑘3 = ℎ[𝑓 + ℎ{𝑝2𝑓𝑥 + 𝑞21 + 𝑞22 𝑓𝑓𝑦} + ℎ 2 2 {𝑝2 2𝑓 𝑥𝑥 + 2𝑝2(𝑞21+ 𝑞22)𝑓𝑓𝑥𝑦 +ℎ2(𝑝1𝑞22𝑓𝑥𝑦 + 𝑞11𝑞22𝑓𝑓𝑦2) + ℎ2 2 (𝑞21 + 𝑞22) 2𝑓2𝑓 𝑦𝑦]
Subtitusi nilai 𝑘1, 𝑘2, 𝑑𝑎𝑛𝑘3 ke bentuk umum runge-kutta orde 3 diperoleh: 𝑦𝑟+1 = 𝑦𝑟 + ℎ𝑓(𝑎1 + 𝑎2 + 𝑎3) +ℎ2𝑓𝑥(𝑎2𝑝1 + 𝑎3𝑝2) +ℎ2𝑓𝑓𝑦{𝑎2𝑞11 + 𝑎3 𝑞21 + 𝑞22 } +ℎ3𝑓𝑓𝑡𝑡(1 2 𝑎2𝑝1 2 + 𝑎 3𝑝22 ) +ℎ3𝑓𝑓𝑥𝑦{𝑎2𝑝1𝑞11 + 𝑎3𝑝2 𝑞21 + 𝑞22 } +ℎ3𝑓2𝑓𝑦𝑦 1 2{𝑎2𝑞11 2 + 𝑎 3 𝑞21 + 𝑞22 2} +ℎ3𝑓𝑥𝑦(𝑎3𝑝1𝑞22) +ℎ3𝑓𝑓𝑦2(𝑎3𝑞11𝑞22)
𝑦𝑟+1 dalam deret taylor 𝑦𝑟+1 = 𝑦𝑟 + ℎ𝑦′ + ℎ2 2 𝑦 ′′ + ℎ3 6 𝑦 ′′′ = 𝑦𝑟 + ℎ𝑓 + ℎ2 2 𝑓 ′ + ℎ3 6 𝑓 ′′ = 𝑦𝑟 +ℎ𝑓 + ℎ2 2 𝑓𝑥 + 𝑓𝑦𝑓 +ℎ3 6 (𝑓𝑥𝑥 + 2𝑓𝑓𝑥𝑦 +𝑓 2𝑓 𝑦𝑦 + 𝑓𝑥𝑓𝑦 + 𝑓𝑓𝑦2)
diperoleh 𝑎1 = 𝑎3 = 1 6 , 𝑎2 = 4 6, 𝑝1 = 1 2 , 𝑝2 = 1 𝑞11 = 1 2, 𝑞21 = −1, 𝑞22 = 2
Jadi bentuk metode runge-kutta orde 3 ialah:
𝑘1 = ℎ𝑓 𝑥𝑟, 𝑦𝑟 𝑘2 = ℎ𝑓 𝑥𝑟 + 1 2 ℎ, 𝑦𝑟 + 1 2 ℎ 𝑘3 = ℎ𝑓 𝑥𝑟 + ℎ, 𝑦𝑟 − 𝑘1 + 2𝑘2 𝑦𝑟+1 = 𝑦𝑟 + 1 6 [𝑘1 + 4𝑘2 + 𝑘3]
Runge
Kutta
Orde 2
Diketahui PDB:
; / dx x y dy
Hitung y (0.10) dengan metode Runge Kutta orde 2 dan orde 3 (h = 0.02)
y(0) = 1 Diketahui: 02 . 0 10 . 0 0 ) , ( 0 h b x a y x y x f Maka n = (0.10 - 0)/0.02 = 5 langkah ) ( ) ( ) , ( 2 2 1 1 1 1 11 1 2 1 k a k a y y f k q hf p f h k y x hf k r r y x r r
Contoh Soal
Runge
Kutta
Orde 2
1 ; 1 ; ) , ( y x f f y x y x f Langkah 1: 0204 . 1 ) 0208 . 0 ( 5 . 0 ) 02 . 0 ( 5 . 0 1 ) ( 0208 . 0 )) 1 )( 02 . 0 ( 1 ) 1 )( 02 . 0 ( 1 1 ( 02 . 0 ) ( 02 . 0 ) 1 ( 02 . 0 ) , ( 2 2 1 1 0 1 1 11 1 2 0 0 1 k a k a y y f k q hf p f h k y x hf k y x ? 02 . 0 1 ; 1 0 1 1 0 0 y x f y x 1 5 . 0 11 1 2 1 q p a a Misal pilih:Runge
Kutta
Orde 2
1 ; 1 ; ) , ( y x f f y x y x f Langkah 1: 0204 . 1 ) 0206 . 0 )( 3 / 2 ( ) 02 . 0 )( 3 / 1 ( 1 ) ( 0206 . 0 )) 1 )( 02 . 0 )( 4 / 3 ( ) 1 )( 02 . 0 )( 4 / 3 ( 1 ( 02 . 0 ) ( 02 . 0 ) 1 ( 02 . 0 ) , ( 2 2 1 1 0 1 1 11 1 2 0 0 1 k a k a y y f k q hf p f h k y x hf k y x ? 02 . 0 1 ; 1 0 1 1 0 0 y x f y x 4 / 3 3 / 2 ; 3 / 1 11 1 2 1 q p a a Misal pilih:Runge
Kutta
Orde 2
x y f k1 k2 (1) k2 (2) 0 1 1 0,02 0,0208 0,0206 0,02 1,0204 1,0404 0,020808 0,021624 0,02142 0,04 1,041616 1,081616 0,021632 0,022465 0,022257 0,06 1,063665 1,123665 0,022473 0,023323 0,02311 0,08 1,086563 1,166563 0,023331 0,024198 0,023981 0,10 1,110327 1,21327Runge
Kutta
Orde 3
Diketahui PDB:
; / dx x y dy
Hitung y (0.10) dengan metode Runge Kutta orde 2 dan orde 3 (h = 0.02)
y(0) = 1 Diketahui: 02 . 0 10 . 0 0 ) , ( 0 h b x a y x y x f Maka n = (0.10 - 0)/0.02 = 5 langkah ) 4 ( 6 1 ) 2 , ( ) 2 1 , 2 1 ( ) , ( 3 2 1 1 2 1 3 1 2 1 k k k y y k k y h x hf k k y h x hf k y x hf k r r r r r r r r
Contoh Soal
Runge
Kutta
Orde 3
Langkah 1: ? 02 . 0 1 ; 1 0 1 1 0 0 y x f y x 020403 . 1 ) 020816 . 0 ) 0204 . 0 ( 4 02 . 0 ( 6 1 1 ) 4 ( 6 1 020816 . 0 ) 0408 . 1 ( 02 . 0 ) 0208 . 1 , 02 . 0 ( 02 . 0 ) 2 , ( 0204 . 0 ) 02 . 1 ( 20 . 0 ) 01 . 1 , 01 . 0 ( 02 . 0 ) 2 1 , 2 1 ( 02 . 0 ) 1 ( 02 . 0 ) 1 , 0 ( 02 . 0 ) , ( 3 2 1 0 1 2 1 0 0 3 1 0 0 2 0 0 1 k k k y y f k k y h x hf k f k y h x hf k f y x hf kRunge
Kutta
Orde 2
x y f k1 k2 k3 0 1 1 0,02 0,0204 0,020816 0,02 1,020403 1,040403 0,20808 0,021216 0,021641 0,04 1,041622 1,081622 0,021632 0,022049 0,022482 0,06 1,063673 1,123673 0,022473 0,022898 0,02334 0,08 1,086574 1,166557 4 0,023331 0,023765 0,024215 0,10 1,110342 1,210342Metode
Runge Kutta Orde 4
Metode
Runge Kutta Orde 4
Bentuk Umum Range-Kutta orde-4 ialah : 𝑦𝑟+1 = 𝑦𝑟 + 𝑎1𝑘1 + 𝑎2𝑘2 + 𝑎3𝑘3 + 𝑎4𝑘4 Dengan 𝑎1, 𝑎2, … , 𝑎𝑛 adalah tetapan, dan 𝑘1 = ℎ𝑓(𝑥𝑟, 𝑦𝑟)
𝑘2 = ℎ𝑓(𝑥𝑟 + 𝑝1ℎ, 𝑦𝑟 + 𝑞11𝑘1)
𝑘3 = ℎ𝑓(𝑥𝑟 + 𝑝2ℎ, 𝑦𝑟 + 𝑞21𝑘1 + 𝑞22𝑘2)
𝑘4 = ℎ𝑓(𝑥𝑟 + 𝑝3ℎ, 𝑦𝑟 + 𝑞31𝑘1 + 𝑞32𝑘2 + 𝑞33𝑘3)
Galat perlangkah metode Runge-Kutta orde-n : 𝑂(ℎ𝑛+1) Galat longgokan metode Runge-Kutta orde-n : 𝑂(ℎ𝑛)
Metode
Runge Kutta Orde 4
Dipunyai suatu persamaan 𝑦′(𝑥) = 𝑓(𝑥, 𝑦(𝑥)) ⟺ 𝑦′(𝑥) 𝑥𝑟 +1 𝑥𝑟 𝑑𝑥 = 𝑓 𝑥, 𝑦(𝑥) 𝑥𝑟 +1 𝑥𝑟 𝑑𝑥 ⟺ 𝑦(𝑥𝑟+1) − 𝑦(𝑥𝑟) = 𝑓 𝑥, 𝑦(𝑥) 𝑥𝑟 +1 𝑥𝑟 𝑑𝑥 ⟺ 𝑦𝑟+1 − 𝑦𝑟 = 𝑓 𝑥, 𝑦(𝑥) 𝑥𝑟 +1 𝑥𝑟 𝑑𝑥
Metode
Runge Kutta Orde 4
Dengan menggunakan Aturan Simpson 1 maka diperoleh nilai dari
𝑦𝑟+1 = 𝑦𝑟 + 𝑓 𝑥, 𝑦(𝑥) 𝑥𝑟 +1 𝑥𝑟 𝑑𝑥 ≈ 𝑦𝑟 + ℎ 6 𝑓(𝑥𝑟, 𝑦𝑟) + 4𝑓 𝑥𝑟 + ℎ 2 , 𝑦𝑟 + ℎ 2 + 𝑓(𝑥𝑟+1, 𝑦𝑟+1) Misalkan 𝑓(𝑥𝑟, 𝑦𝑟) = 𝑓1 dan 𝑓(𝑥𝑟+1, 𝑦𝑟+1) = 𝑓4 Karena 𝑥𝑟 + ℎ
2 terletak di tengah interval [𝑥𝑟, 𝑥𝑟+1] maka
untuk titik tengah tersebut di ambil rata-rata dari 𝑓2 dan 𝑓3 sehingga 4𝑓 𝑥𝑟 + ℎ 2 , 𝑦𝑟 + ℎ 2 ≈ 4(𝑓2 + 𝑓3) 2 = 2𝑓2 + 2𝑓3
Metode
Runge Kutta Orde 4
Jadi 𝑦𝑟+1 ≈ 𝑦𝑟 + ℎ 6 𝑓(𝑥𝑟, 𝑦𝑟) + 4𝑓 𝑥𝑟 + ℎ 2 , 𝑦𝑟 + ℎ 2 + 𝑓(𝑥𝑟+1, 𝑦𝑟+1) = 𝑦𝑟 + ℎ 6 (𝑓1 + 2𝑓2 + 2𝑓3 + 𝑓4) = 𝑦𝑟 + 1 6(ℎ𝑓1 + 2ℎ𝑓2 + 2ℎ𝑓3 + ℎ𝑓4)Metode
Runge Kutta Orde 4
Xr xr+ h = xr+1 yr Xr + h/2 yr + k1/2f1
f2
k
1k
1/2
k
1= hf
1= hf(x
r,y
r)
Metode
Runge Kutta Orde 4
Xr xr+ h = xr+1 yr Xr + h/2 yr + k1/2f1
f2
xr + 3h/2f3
yr + k2/2k
2k
2/2
k
2/2
k
1= hf
1= hf(x
r,y
r)
k
2= hf
2= hf(x
r+ h/2 ,y
r+ k
1/2)
Metode
Runge Kutta Orde 4
Xr xr+ h = xr+1 yr Xr + h/2 yr + k1/2f1
f2
xr + 3h/2f3
f4
yr + k2/2 yr + k3k
3k
1= hf
1= hf(x
r,y
r)
k
2= hf
2= hf(x
r+ h/2 ,y
r+ k
1/2)
k
3= hf
3= hf(x
r+ h/2 ,y
r+ k
2/2)
k
4= hf
4= hf(x
r+ h ,y
r+ k
3)
Metode
Runge Kutta Orde 4
k
1= hf
1= hf(x
r,y
r)
k
2= hf
2= hf(x
r+ h/2 ,y
r+ k
1/2)
k
3= hf
3= hf(x
r+ h/2 ,y
r+ k
2/2)
k
4= hf
4= hf(x
r+ h ,y
r+ k
3)
𝑦𝑟+1 ≈ 𝑦𝑟 + 1 6(ℎ𝑓1 + 2ℎ𝑓2 + 2ℎ𝑓3 + ℎ𝑓4) = 𝑦𝑟 + 1 6 (𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4) Atau = 𝑦𝑟 + 1 6𝑘1 + 1 3𝑘2 + 1 3𝑘3 + 1 6 𝑘4Sehingga
Metode
Runge Kutta Orde 4
Tentukan nilai dari 𝑦(0.1) dengan menggunakan metode Runge-Kutta orde ke empat. 𝑦′ = 𝑓(𝑥, 𝑦) = 1 − 𝑥 + 4𝑦 Dengan ℎ = 0.1 dan 𝑦(0) = 1 Jawab : Diperoleh nilai 𝑘1 = ℎ𝑓(𝑥𝑟, 𝑦𝑟) = 0.1𝑓(0,1) = 0.1(1 − 0 + 4.1) = 0.5 𝑘2 = ℎ𝑓 𝑥𝑟 + ℎ 2, 𝑦𝑟 + 𝑘1 2 = 0.1𝑓(0.05,1.25) = 0.595 𝑘3 = ℎ𝑓 𝑥𝑟 + ℎ 2, 𝑦𝑟 + 𝑘2 2 = 0.1𝑓(0.05,1.2975) = 0.614 𝑘4 = ℎ𝑓(𝑥𝑟 + ℎ, 𝑦𝑟 + 𝑘3) = 0.1𝑓(0.1, 1.614) = 0.7356
Contoh Soal
Metode
Runge Kutta Orde 4
𝑘1 = ℎ𝑓(𝑥𝑟, 𝑦𝑟) = 0.1𝑓(0,1) = 0.1(1 − 0 + 4.1) = 0.5 𝑘2 = ℎ𝑓 𝑥𝑟 + ℎ 2, 𝑦𝑟 + 𝑘1 2 = 0.1𝑓(0.05,1.25) = 0.595 𝑘3 = ℎ𝑓 𝑥𝑟 + ℎ 2 , 𝑦𝑟 + 𝑘2 2 = 0.1𝑓(0.05,1.2975) = 0.614 𝑘4 = ℎ𝑓(𝑥𝑟 + ℎ, 𝑦𝑟 + 𝑘3) = 0.1𝑓(0.1, 1.614) = 0.7356 Berarti 𝑦𝑟+1 ≈ 1 + 1 6(0.5) + 1 3 (0.595) + 1 3(0.614) + 1 6(0.7356) = 1.608933GROUP 1
L
ATIHAN
S
OAL
HELEN P. SYIFA N. A. DITA W. A. LILIK H. HIDAYATUL M. AGUSYARIF R. N.RIDHO A. FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAMDEPARTEMEN MATEMATIKA
INSTITUT PERTANIAN BOGOR 2016
Selesaikan persamaan differensial berikut
menggunakan metode euler
pada interval 𝑥 = 0 s/d 𝑥 = 1, ℎ = ¼.
Pada saat 𝑥 = 0, nilai 𝑦 = 1. Hitung kesalahan sebenarnya! y x dx dy
Latihan Soal
Nomor 1
Selesaikan persamaanberikut: Dengan menggunakan Metode Heun (h=0.1)
Nomor 2
Diketahui PDB: ; 2 1 2 1 x y dx dy Hitung y (0.06) denganmetode Runge Kutta orde 2 (h = 0.02) y(0) = 1 Diketahui PDB: ; 2 1 2 1 x y dx dy
Hitung y (0.06) dengan metode Runge Kutta orde 3 (h = 0.03)
y(0) = 1
Nomor 3
GROUP 1
T
HANK
Y
OU
HELEN P. SYIFA N. A. DITA W. A. LILIK H. HIDAYATUL M. AGUSYARIF R. N.RIDHO A. FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAMDEPARTEMEN MATEMATIKA
INSTITUT PERTANIAN BOGOR 2016
GROUP 1
T
HANK
Y
OU
HELEN P. SYIFA N. A. DITA W. A. LILIK H. HIDAYATUL M. AGUSYARIF R. N.RIDHO A. FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAMDEPARTEMEN MATEMATIKA
INSTITUT PERTANIAN BOGOR 2016
Untuk 𝒙 = 𝟎 → 𝒚 = 𝟏 • Untuk 𝒙 = 𝟎, 𝟐𝟓 𝑦𝑖+1 = 𝑦𝑖+ 𝑓(𝑥𝑖, 𝑦𝑖). ℎ = 1 + f(0,1).0,25 = = 1 • Untuk 𝒙 = 𝟎, 𝟓 𝑦𝑖+1 = 𝑦𝑖+ 𝑓(𝑥𝑖, 𝑦𝑖). ℎ = 1 + f(0,25;1).0,25 = = 1,0625 25 , 0 1 0 1 25 , 0 1 25 , 0 1