PENYELESAIAN PERSAMAAN DEFERENTIAL SECARA NUMER1K DENGAN METODE
RUNGE - KUTTA
K a r s o n o
BADAN TENAGA ATOM NASIONAL.
PUSAT PENEUHAIS" TENAGA ATOM GAMA
Y O G Y A K A R T A — I N D O N E S I A
We regret that some of the pages in the microfiche
copy of this report may not be up to the proper
legibility standards, even though the best possible
P e r i i i t u n g a n n u k l i r dan t i r u a n
PPGM - L 97 - 76
PENYELESAIAN PERSAMAAN DEFERENSIAL SECARA NUHERIK DENGAN METODE
RUNGE - KUTTA
Karsono
1976
BADAN TENAGA ATOM NASIONAL PUSAT PENELITIAN TENAGA ATOM GAMA J l . B a b a r s a r i , P . O . B o x . 0 8 , T e l p . 3 6 6 1
ABSTRAK
Disajxkan peninjauan secara t e o r i metode Runge-Rutta untruk mencari penyelesaian. numerik persamaan d e f e r e n s i a l l i n i e r , b e g i t u pula program dengan k a l k u l a t o r Hewlett Packard~65 d a r i rumusrumus yang d i -p e r o l e h . B i t u l i s -p u l a -program subroutine d i dalam bahasa Fortran yang
akan dipakai n a r t i b i l a sudah ada komputer.
ABSTRACT
The Runge-Kutta method for solving l i n e a r d i f f e r e n t i a l equa-t i o n i s discussed wiequa-th appropriaequa-te programming using equa-t h e Hewleequa-tequa-t Pac-kard-65 Calculator. A subroutine programme w r i t t e n i n FORTRAN language I'B nlra gavan which *«r*i be used when a computer i s a v a i l a b l e 4f ^ t U ^
I I . Penanjauan metoda Eunge-Kutta s e c a r a t e o r i t i s 2 A. Metoda Runge-Kutta untuk persamaan d i f e r e n s i a l l i n i e r
orde s a t u 2 B. Metoda Runge-Kutta untuk sistem persamaan d i f e r e n s i a l
l i n i e r orde s a t u 11 C. Metoda Punge-Kutta untuk persamaan d i f e r e n s i a l l i n i e r
orde t i n g g i 13 III. Program untuk Hewlett Packard- fS 16
A. Untuk persamaan d i f e r e n s i a l l i n i e r orde s a t u 16 B. Untuk persamaan d i f e r e n s i a l l i n i e r orde dua 28
IV. Program dalam FORTRAN 34
V. Kesimpulan 39 Referensi 40
I. PENDAHULUAN
Beberapa tahun t e r a k h i r i n i k i x a s e r i n g menjumpai p e n y e l e s a -ian persamaan d i f e r e n s i a l secara numarik. Metode ini. memang memerlukan banyak s e k a l i perhitungan dan o p e r a s i - o p e r a s i hi-tung yang pada umum— nya s u l i t dikerjakan dengan perhrtrungan tangan b i a s a .
Akan t e t a p i perkembangan komputer dewasa i n i t e l a h sanggup menghilangkan atau p a l i n g t i d a k meringankan problema di a t a s tneskipun s t u d i mendalam tentang a n a l i s a numerik t i d a k akan b i s a ditinggalkan b e g i t u s a j a . S e p e r t i t e l a h k i t a k e t a h u i , untuk memecahkan persoalan yang sama kadang-kadang k i t a memiliki lebih d a r i satu metoda,
sehing-ga kemampuan memilih metoda yang t e p a t akan memberi sumbansehing-gan yang b e r a r t i pada ketepatan jawaban.
Khususnya, untuk mencari penyelesaian pendekatan secara nu-merik bagi persamaan d i f e r e n s i a l l i n i e r , t e l a h dikenal metoda
Runge-Kutta. Metoda i n i amat sering digunakan dan t e r d i r i a t a s berbagai
macam rumus pendekatan yang masingmasing memiliki kelebihan s e r t a k e -kurangan. Metoda Eunge-Kutta i n i k i t a p e l a j a r i secara t e o r i t i s untuk kemudian dibuat program dengan k a l k u l a t o r Hewlett-Packard 65.
dibandingkan netoda a n a l i t i s ataupun metoda i n t e g r a s i b e r u l a n g , h a s i l perhitungan t e r s e b u t b i s a k i t a sajikan dalam t a b e l .
D i s i n i , metoda Bungs-Kutta d i p e l a j a r i s e c a r a t e o r i untuk mencari penyelesaian pendekatan persamaan d i f e r e n s i a l l i n i e r orde s a t u , s i s t i m persamaan d i f e r e n s i a l dan persamaan d i f e r e n s i a l l/.nier o r -de t i n g g i . Sudah barang t e n t u disamping keuntungan-keuntungannya ada juga beberapa kekurangan yang p e r l u diketahui agar k i t a t e r h i n d a r d a r i kesalahan s e r i u s .
A. Metoda Runge-Kutta untuk persamean d i f e r e n s i a l orde satu Dipandang persamaan d i f e r e n s i a l orde satu ( l i n i e r )
y- (x) = f ( x , y) (1) dengan syarat awal y(x ) = y
Kita andaikan f ( x , y) mempunyai d e r i v a t i f - d e r i v a t i f p a r s i i l kontinyu sampai orde n , pada daerah t e r t e n t u yang diinginkan. I n i b e r a r t i bahwa penyelesaian pendekatan yang k i t a inginkan aken mempunyai d e r i v a t i f
-d e r i v a t i f p a r s i i l kontinyu sampai -dengan or-de (n + 1 ) , b i s a d i t u l i s sebagai
n+1 (x-x )m , •. .
y(x) = y(xo) + I -1j 4 - yo i n ) • 0 ( | x - xor+ 1) (2)
m=1
Dengan menganibil h = x - x cukup k e c i l , k i t a b i s a mengabaikan suku 0 ( | x - x | ) pada ruas kanan persamaan di a t a s sehingga pendekatan k a s a r yang diperoleh adalah ( x ) _ , ^ y+ * ~ * o (m) ( 3 )
y y o £ . m I o
3
Untuk memperoleh k e t e l i t i a n yang k i t a inginkan, kadang-kadang k i t a tak p e r l u menghitung seluruh suku di r u a s kanan d a r i ( 3 ) . Setelah k i t a da-p a t menghitung harga d e r i v a t i f - d e r i v a t i f i t u maka y(x) - y ( x ) b i s a k i t a k e t a h u i .
Untnk sampai pada ramus pendekatsn Rwge-Kutta k i t a i k u t i langkah-langkah b e r i k u t :
(«0
H fir
+ ff ~ ) ***>
Secara umumdx
Sekarang k i t a definisikan operator
D = | — + f | — f = f(x ,y 1 (6) 8 x o 3 y o o °
Maka , 2 , 3 „
Ay^ = y(x) - y(x ) = hf + ~ Df + g r (D f+ f Df) + o o 2; o: y H
~ (D3f + f D2f + f2Df + 3Df Df + (7)
«+.' y y y
Dianibil kombinasi l i n i e r
Pr iy h ) + Pr 2k2( h i + + pr rkr( h ) (8)
dimana para p .konstan, k . ( h ) = h f ( £ . , n . ) dengan (9) ?. = x + a . h , n = y + B k (h) + + B. , k. , ( h )
1 0 1 1 O 1 1 I 1 , 1 - 1 1 - 1
a. , 6. . konstanta-konstanta dengan a. = 0 .
Harga h b i s a d i p i l i h sekehendak. . J a d i k. (h) = hf (x , y ) 1 O3 Jo k (h) = h £ U + a h , y + B0 1k,) £ O •£ O 2 1 l k3( h ) = hf(xQ + a3h, y + n^k + e3 2^2) ( 0) k (h) = hf(x + a h , y + 6 ,k, + 6 ,k , ) r o r Jo r1 1 r , r-1 r-1
Dengan mengidentikkan (3) dan (8) sampai suku h pangkat t e r t e n t u k i t a dapatkan p . . a. dan 3 . . .
r rr i • i i ]
Kita definisikan
4» (h) = y(x + h) - y(x ) - v> , k , ( h ) - - p k (h) r J o J o *r1 1 rr r r
yang memenuhi s y a r a t <(> (0) = <j>"(0) = <j> (0) = 0 dan
• £
8 + , )* 0 . (11)
Kita p i l i h harga s t e r b e s a r yang masih memenuhi syarat i t u . J i k a y(x) adalah penyelesaian oxak d a r i persamaan ( 1 ) , maka s e l i s i h harga (exak) A y dengan harga pendekatan A y = p .k.. + p k adalah
h
s +V
s + 1 )u)
V fciTT- °*«*
h (12)untuk s e t i a p langkah pendekatan, a r t i n y a kesalahan yang t e r j a d i pada pendekatan d i t i t i k x + h .
Adapun syarat (J> (0) = 0 mengharuskan y(x ) = y > sedangkan syarat (k)
ij) (0) = 0 memberikan kesamaan r
A y( k )( 0 ) = p , k jk )( 0 ) + t p k( k )( 0 ) (13)
5
Dengan mengingat h = x - x dan k . ( h ) = hf(E. . n . ) maka
o l i * i
k ^ h ) = f(x
Q, y
Q) , k j
n )( h ) = 0 n * 2
k.-(h) = f ( s . , TI ) + h<* 4 r + Tjr(h) | — ) f(g. , T, )
= «5
±, v
+f > i ! r
+ ( Bi i
ki
+ 3i2
k2
+ Pertama-tama ambilah r = 1 (14) • t( h ) = y(x + h) - y(x ) - Pnh f ( x , y ) ( 5) 6j"(h) = y*(xQ + h) - Pnf ( xQ , yo) ( 6) Bilamana h = 0 maka 6/(0) = y (x ) - p , , f (x ,y ) 1 o 11 o " oAgar dipenuhi 6j*(0) = 0 untuk s e t i a p f ( x , y ) , haruslah p . . = 1 . Lebih jauh l a g i 6j"(0) - y" pada umumnya t i d a k sama n o l t Dengan demikian k i t a t e l a h msndapatkan penyelesaian pendekatan
y(x) = y(x ) + hf(x , y ) atau o o o
y(x) = y + hf(x , y ) (17)
•'o p o
Dalam rumus i n i kesalahan untuk s e t i a p langkah pendekatan
h2
R = 5 - y " ( S ) • x * £ * x + h 2
J a d i dalam orde kesalahan h .
Metoda pendekatan i n i dikenal sebagai metoda E u l e r . Untuk r = 2
*2(h> = y(xQ + h) - yQ - p ^ k ^ h ) - p2 2k2( h ) (18)
62(h) = f(xQ + h) - p2 lk1'(h) - P2 2k^(h)
•2<°> = fo - p2 1k - ( o ) - p2 2k2-(o) = fo - ( p2 1 + p2 2) fo (19)
*--«,) = [IfflS?
+m^\)
o- p
2lk
r(0) - p
22k
r(0) (20)
Syarat (ji*(0) = 0 dan <|>''(0) = 0 meraberi persamaan P2 1 + P2 2 = 1
2 P2 2 «2 = 1 (21)
2 p2 2 fl21 - 1
Sedangkan d e r i v a t i f * '2' ( 0 ) J 0 .
Dengan mudah k i t a simpulkan bahwa a . = 8„| .
Bilamana diambil a 2 = g21 = 1 * m a*a p22 = p^ i = ^2
sehingga rumus pendekatan yang k i t a peroleh adalah
y(x) « yQ + (k1 + k2) /2 (22)
dimana k, = hf(x ,y ) , k , = hf(x + h/2 ,y + k , / 2 ) .
I O O £ O 0 1
Kesalahan untuk s e t i a p langkah pendekatannya berorder h .
Sekarang, anibilah penyelesaian yang l a i n dengan mengambil
a2 = e2l = 1 / 2 •
Untuk harga i t u maka p . = 0 dan p2 2 = 1 sehingga rumus pendekatannya
•8 a j a d i y(x) * yo + k2 (23)
dengan k, = h£(x ,y ) , k„ = hf(x + h/2 ,y + k , / 2 ) . 1 o o 2 o o I
3 Orde kesalahan untuk s e t i a p langkah pendekatan h
Kita masih b i s a mengambil pasangan harga yang l a i n , misalnya «2 = G21 = 2 / 3 , p - = 1/4 dan p 2 = 3/4 yang menghasi3kan rumus
pende-katan
7
dengan k = hf(x 3y ) dan k = hf"(x + 2h/3,y + 2k- / 3 ) .
3 Orde kesalahan untuk se-tiap langkah psndekatan adalah h . Untuk r = 3
Orde kesalahan pada rumus pendekatan b e r i k u t adalah h . Para a. S. . . dan p . . harus memenuhi
tt2 = B21 tt3 = B31 + 33 2 P3 1 + P3 2 + P 33 (25) P32 a2 + P33 a3 = 1 / 2 P32 a2 +P33 °3 = 1 / 3 p„„ B a ~ 1/6 F33 32 2
Tiga persamaan t e r a k h i r bisa dipandang sebagai persamaan l i n i e r dalam P3 2 dan p3 3 untuk harga-harga a dan a„ yang k i t a p i l i h . Oleh karena
i t u } "2 2 ''2 0 a3 " 2 °3 53 2 a2 1/2 1/3 1/6 = 0 atau a2 a3 ( a3 - a2 ) - (?32 a2(2 - 3 ^ )
Persamaan terakhir ini ekwivalen dengan
(26)
a3 ( a3 " a2) 332 ° 2( 2 " 3 a2) = ° (27)
Dipilih a , a , 8 . , 03. dan 3_2 sedemikian sehingga
a2 = 621
«3 = P31 + *32 ( 2 8 )
a3 ( a3 - a2 } ~ B32 a2( 2 " 3 a2) = °
Kemudian dengan eliminasi pada persamaan
P33 p32 a2 = 1 / 5
P32 a2 + P3 3a 3 = 1 / 2 ( 2 9 )
P31 + P32 + P3 3 = 1
k i t a t e n t u k a n p3 1 s pg 2 dan p3 3 .
Dengan memilih h a r g a ou = 6 . = 1/2 dan a- - 1, k i t a p e r o l e h
e3 2 ' °» 331 " -1 ' P33 = 1 / 6' P3 2 = 2 / 3 d a n P31 = 1 / 6 -Menghasilkan p e n d e k a t a n y ( x ) a y + ( k , + 4k„ + k . ) / 6 ( 3 0 ) dimana k, = h f ( x ,y ) , k„ = h f ( x + h / 2 , y + k , / 2 ) dan 1 o " o - 2 o " o 1 k . = h f ( x + h , y +• 2k„ - k . ) . 3 0 0 2 1
Sekarang d i a m b i l h a r g a a„ = g = 1/3 dan a = 2 / 3 .
K i t a p e r o l e h B3 2 = 2 / 3 , S3 l = 0 , p3 3 = 3 / 4 , p3 2 = 0 dan ? 3, = 1/4. Rumus p e n d e k a t a n yang s e s u a i a d a l a h y(x) » y + (k1 + 3k3)/4 (31) dengan k1 = hf(x ,y ) , k = hf(x + h/2, y + kj/3) dan k_ = h£(x + 2h/3, y + 2k_/3). 3 o o 2
9
Akhirnya, pemilihan a = 6 . = 1/2 dan a„ = 3 A menghasilkan
B3 2 = 3 / 4 , S31 = 0 , p3 3 = if/9, p3 2 = 173 dan p3, = 2 / 9 . Rumus pendekatannya y ( x ) « y + (2k1 + 3k2 + 4 k3) / 9 (32) dengan k, = hf(x ,y ) . k„ = hf(x + h/2 ,y + k.,/2) i o o 2 o Jo l k„ = hf(x + 3h/4,y + 3k / 4 ) . « J O O £. Untuk R = k
Sejalan dengan pembicaraan sebeluiunya untuk harga r - 4 i n i para a. , S. . , pu. ditentukan d a r i s y a r a t :
^ ( 0 ) = * - ' ( o ) = 4 . ' ^ ' (0) = 0.
Dengan s e d i k i t perhitungan k i t a akan sarapai pada rurcus-rumus pendekat-5
a t yang mempunyai kesalahan d a r i orde h untuk s e t i a p langkah pende-k a t an.
Misalkan k i t a p i l i h a2 = 1/2, a3 = 1/2 dan &32 = 1 / 2 .
Dalam h a l i n i B21 = 1/2, 3g 1 = 0 , c^ = 1 , 6 ^ = 1 ,
\ 2 = °' % = °» PW = 1 / 6> p4 3 = 1 / 3> PU2 = 1 / 3 d a n
PU1 =
1/6-Oleh karena i t u rumus pendekatannya adalah
y ( x ) a y + ( kt + 2k2 + 2k3 + k4) / 6 (33)
dengan k. = hf(x ,y ) , k . = hf(x + h / 2 , y + k ^ 2 ) ,
k3 = hf(xQ + h / 2 , yo + k2/ 2 ) dan k^ = hf(xQ + h , yQ + k3) .
Kalau diattibil a = 1/3 dan a = 2/3, maka 8-1= 1/3, % = ' • B32 = '» S31 = ~ 1 / 3« 3H3, = '> B»2 =- * U ^ \ ' \\
Pi+i^ = 1/ 8 , p ^ = 3 / 8 , p ^ = 3/8 dan p^ = 1/8: i n i membe-r i membe-rumus pendekatan y ( x ) = yQ + ( k1 + 31c2 + 3k3 + k4V 8 (341 dimanak, = hf(x , y ) , k . = hf(x + n / 3 . y + k , / 3 ) „ 1 o Jo ' 2 o ' Jo l k , = hf(x + 2 h / 3 , y - k , / 3 + V ) dan O O O I 2 k^ = hf(y.o + h , yQ + k1 - k2 + k3) .
Sedangkan a = 3 . = 1/4 dan a = 1/3 menyebabkan
e32 = 1 / 2> »31 = ° ' \ = ' » S4 3= 2' P 42 = -2' eHl = 1* V = 1/5> P43 = 2 / 3> P42 = ° d a n PU1 = 1 / 5 -Rumus pendekatan y ( x ) = y + (k1 + 4k3 + \)/6 (35) dengan k, = hf(x „y ) , k = hf(x + h / 4 , y + k , / 4 ) I O O £ O O I k3 = hf(xQ + h / 2 , yo + k2/ 2 ) , k^ = hf(xQ + h,y + k} - 2k2 + k g ) .
Sebenarnya. masih mungkin untuk mendapatkan rumus pendekatan yang l a i n dengan mengambil harga-harga a„ dan a yang berbeda.
B. Metoda Bunge-Kutta untuk s i s t i m persamaan d i f e r e n s i a l l i n i e r orde s a t u
Berdasarkan h a s i l untuk persamaan d i f e r e n s i a l l i n i e r orde s a t u d i muka, k i t a b i s a memakai metoda t e r s e b u t untuk s i s t i m persama-an d i f e r e n s i a l l i n i e r orde s a t u .
Dipandang s i s t i m persamaan y ' ( x ) = f ( x . y , z )
s ' ( x ) = g ( x , ys z ) ( 3 6 )
dengan s y a r a t awal : y(x ) = y , z(x ) = z . Untuk i t u dibentuk fungsi-fungsi
k . ( h ) = h f ( £ . , n . , O l i l i
t . ( h ) = hg(f
i 3n.
3£.) (37)
dimana £,. = x + a.h , a, = 0 x o x 1 I. = x + a . h , a, = 0 ( 3 8 ) x o x i n i sy o + Bnki + Bi 2k2 + + 0x , i - iki - i ^ i= yo+ §i 1k1 + §i 2k2+ + Bi , i - 1ki - 1 h = Zo + ^ 1 * 1 + Yi 2t2+ + *i,1-1*1-1 gis "0^11*1 + Yi2t2+ +* i , i - l V lPersoalannya sekarang adalah menentukan konstan-konstan a. „
6. . , Y. .» o. , 3. . j Yn- • 3 P • dan q . sedamikian sehingga fungsi-fungsi
& yQ - ( priki( h ) + pr 2 k2( h ) + • • • • + pr rVh )) ( 3 9 )
dapat diexpansikan sebagai deret pangkat dalam h dengan pangkat d a r i h sebesar mungkin.
Misalkan, Bunge-Kutia dengan orde kesalahan h mensyaratkan bahwa fungsi-fungsi <j>(h) = y ( xo' + h) - y(xQ) - (p kjOO + . . . + p ^ k ^ h ) ) *(h) = z(xQ + h) - Z ( XQ) - (q^ t ^ ( h ) + . . . + q ^ t ^ ( h ) )
(uo)
harms memenuhi • ' ( 0 ) = * " < 0 ) = <J»"'(0) = $ " " ( 0 ) = 0 i|»'(0) = * " ( 0 ) = \J> <0> = $ (0) = 0Sekali l a g i , s e j a l a n dengsn pembicaraan di muka k i t a b i s a mencocokksn rumus pendekatan y(x) = y + Ck. + 2k + 2k„ + ku) / 6 O I l 3 4 < 4 2j z(x) = z^ t ( t , + 2t0 + 2 t , + t.,)/6 O I £ o 4 damana k. = hf(x ,y ,z ) i o " o o t , = hg(x 4y 5z ) i ° o o o k0 = hf(x + h / 2 . y + k , / 2 , z + t - / 2 ) £ O O I O I t2 = h g ( xo + h / 2'yo + k1/ 2 j Zo + t1/ 2 ) k , = hf(x + h / 2 , y + ko/ 20z + t _ / 2 ) t - = hg(x + h/23y + ko/ 20z + t _ / 2 ) •3 O O <i O £ ku = h f ( xo + h> y o + k3 s Z o + t3) • t4 = hg(xo + h ,y o + k3 SZo + t3)
Hasil t e r s e b u t b i s a k i t a generalisasikan untuk sistiir. per caan d i f e r e n s i a l l i n i e r dengan n buah perubah t a k bebas
y£(x) = f ^ x . y j , y2, . . . . yR) i = 1 , 2 , , n (•<
dengan s y a r a t awal y . ( x ) = y . • Penyelesaian pendekatannya adalah :
y . ( x ) e y. + (k . + 2k-. + 2k_. + kuJ / 6 (L" ) i zo x 2a 3x *ti dimana k1 i= h fi( xo 'y1( xo)'y2( xo)» yn( xo) } k2 i = h fi( xQ + h / 2 , y ]( xo) + kn/ 2 , . . . , yn(xQ) + k1 n/ j k3 i = h fi( xo + ^^y^V + k2 1/ 2> " • • ' yn ( xo} + k2 n7 > \i = h fi( xo + h» y i( x 0 ) + k3l > •••• > V V * + k3 n)
C. Metoda Runge-Kutta untuk persamaan d i f e r e n s i a l l i n i e r orde -tino'.: Persamaan d i f e r e n s i a l orde t i n g g i b i s a k i t a ubah menjcM s i s t i m persamaan d i f e r e n s i a l orde s a t u , oleh karena i t u ruffus per katan (44) dapat digunakan d i s i n i .
Sebagai contoh persamaan d i f e r e n s i a l l i n i e r orde dua d i bawah i n i : y " ( x ) = f ( x , y , y O ( ') dengan s y a r a t awal y(x ) = y , y ' ( x ) = y" .
Lebih dalmlu persamaan t e r s e b u t diubah menjadi s i s t i m persamaan y ' ( x ) = z ( x )
z'(x) = f(x, y, z) ("•)
Sedang syarat awalnya menjadi y(x ) = y , z(x ) = y^ .
Sejalan dengan pembicaraan di muka untuk orde kesalahan h ( set? -7 langkah pendekatan ) , akan diperoleh hubungan sebagai berikut :
«2 = B21 = Y2 1 ; a2 = P2J = 92 1 a3 = B31 + 832 = Y31 + Y32 < *3 = h\ + h'2 = ^31 + ^32 P3 ! + p32 + P3 3 = 1 ' %\ + %2 + q33 = ' P32a2 + P33a3 = 1 / 2 ; q32 «2 + *33 °3 = 1 / 2 ( 4 7 ) P32a2 + P33a3 = 1 / 3 ' %2 °2 + *33 °3 = 1 /3 P33 P32 a2 = 1 / 5 !*.= a2 632 . Y32 r 933 *32 a2 = 1 / 6 = ?32_ ^32 Menggunaksn (47) i n i3 k i t a perolah A yo= h y ; +{ (P3 2Y2 ]+P33Y3 1) f0 + Pa3Y32f ( xo + » 2h* o + *21 hK< + *21 h fo ^ ' ( 4 8 1 A 2o = q31 *1 + «32*2 + ^ 3 * 3 ^™* t . = hf 1 o t2 = hf(xo + 52h5yo + B21 h y ; , y ; + Y2 1 hfQ) t3 = h f ( xo + S3h , yo + B3 h y ; + B3 2Y2 1 h2fQ,y^ t Y31hfQ + Y3 2 h f ( xo + S2h^ o + «21 hK>K + Y21 h f 0>
Untuk iBudahnya diambil P3 2Y2 1 + P33Y31 = 0 (49)
dan kemudian digunakan persamaan kedua dan keempat d a r i (47)untuk men-dapatkan P3 3Y3 2 = 1 / 2 .
Syarat-syarat i n i dipenuhi b i l a diambil a. = a . , B . . = B . . = Y.. - Y..
15 Sehingga c2 = a2 = ^ = B21 - y^ = y^ = 1/3 a3 = S3 = 832 = l32 = Y32 = *32 = 2/3 (50) B31 = f3 1 = Y31 = *31 = ° »33 = 133 = 3 / U ; P32 = q32 = ° 5 *31 = q31 = 1 ^ 14.
Sekarang k i t a saispai pada rumus pendekatan dengan orde kesalahan h y(x) = y + b y ' + hk./2 y ' ( x ) « y'Q + kQ/U + 3k2/4 (51) dimana k = hf 0 o k1 = hf(x + h / 3 , y + hy^/3sy^ + k / 3 ) k_ = hf(x + 2h/3,y + 2 h y ' / 3 + 2hk / 9 , y ' + 2k,/3) 2 o " o ' o 0 0 1
Untuk persamaan d i f e r e n s i a l yang sama, k i t a b i s a juga n a n c a r i penyele-saian pendekatan yang l a i n sebagai b e r i k u t :
y ( x ) « y ^ + h y ' + ( h / 6 ) ( t . + t „ + t _ ) y ' ( x ) » y^ + ( t1 + 2 t2 + 2 t3 + t ^ ) / 6 (52) dimana t. = hf(x ,y ,y") 1 o o Jo t2 = hf(xQ + h / 2 , yQ + h y V 2 , y ^ + t , / 2 ) tg = hf(xQ + h / 2 , yQ + h y ^ / 2 , + h ^ / 4 ^ + t g / 2 ) tl t Bh f ( xo + hayo + h y ;+h t2/ 2 , y ;+t3) 5 Untuk s e t i a p langkah pendekatan, orde kesalahan adalah h .
Untuk persamaan d i f e r e n s i a l orde yang lebih t i n g g i , penyele-saian pendekatannya diperoleh dengan cara yang sama, y s i t u dengan me-ngubah t e r l e b i h dahulu menjadi sistiro persamaan d i f e r e n s i a l kemudian digunakan penyelesaian d a r i s i s t e n i n i .
masing rumus p e n d e k a t a n yang t e l a h d i p e r o l e h p a d a bab sebelumnya.
A. untulc persamaan d i f e r e n s i a l l i n i e r orde s a t u PROGRAM RK-1.3.1 y ( xQ + h ) = yQ + <k1 + k2) / 2 ; y ( xo> = yQ ditnana k , = h f ( x ,y ) , k = h f ( x + h / 2 , y + k . , / 2 ) . I o Jo 2 o " o 1 Program : LBL A STO + 1 RTN LBL B STO 2 RTN LBL C STO 3 RTN LBL E D • 2 ' RCL 2 + STO 2 RCI. 3 2 : A D 2 : RCL 2 + STO 2 RCL 3 2 I n s t r u k s i : I . Sispkan k a l k u l a t o r pada W/ PRGM, masukkan program i t u . I I . Pindahkan W/PRGM ke RUN s e t e -l a h sebe-luff-lnya memasukkan LBL D untuk h f ( x , y ) . I I I . P e j e t l a h x > A) y , B, h , C yang meru-pakan input. P e j e t E memberi y ( x + h ) pada penampil k a l k u l a t o r . C a t a t a n x » Pv, = y , Ro = h . 16
17 PROGRAM RK-1.3.2 y ( x + h ) = y + k,. • y { x ) = y d i n a n a k . = hfCx ,y ) , k_ = h f ( x + h / 2 , y + k,/2">. i o " o 2 o , Jo 1 Program : ! LBL ! i ! A I ! STO + 1 RTN LBL B STO 2 RTN LBL C STO 3 RTN LBL E RCL 2 STO 4 D 2 RCL 2 STO RCL 2 A D RCL + STO RCL 2 A ' RCL RTN 2 3 4 2 3 2 I n s t r u k s l : I . Siapkan k a l k u l a l r o r p a d a W/PRGtf, masukkan program i t u . I I . B u a t l a h LBL D u n t u k h f ( x , y ) kemudian pindahkan W/PRGM k e RUN. I I I . P e j e - t l a h : x , A , y , B, h , C yang meru-p a k s n inmeru-put. P e j e t l a h E u n t u k mendapatkan h a r g a y ( x + h) p a d a p e n a m p i l . P e j e t l a h E l a g i b i l a i n g i n h a r g a y ( x + 2h) , d s t . C a t a t a n B i l a d i i n g i n k a n h a r g a h b i s a d i g a n t i dengan h ' dengsn j a l a n tnemasukkan h ' kemudian memejet C.
PROGRAM RK-1 .4-.1 yCx + h ) = y + ( k . + 4k + k ) / 6 , y ( x ) = y o o ' ^ o o c d i a a n a k = h f ( x ^ , y ^ ) , k = h f ( x ^ + h / 2 , y _ + k , / 2 ) , o " o k . = h f ( x + h , y + 2k„ - k , ) , 3 O o 2. I Program : LBL A STO + 1 RTN LBL B STO + 2 RTN LBL C STO 3 RTN LBL E D STO 5 RCL 3 2
i
: 1 A RCL 5 2 ; B D STO 6 RCL 3 2 : A RCL 5 3 X 2 : CHS B RCL 6 i 2 X B D 7 ENTER RCL 5 X + 8 ENTER RCL 6 X -6 : B RCL 2 RTN I n s t r u k s i : I . Siapkan k a l k u l a t o r pada W/PRGM, masukkan program t e r s e -t>ut. I I . B u a t l a h LBL D u n -t u k h f ( x , y ) . , pindsh-kan W/PRGM k e RUN. I I I . P e j e t l a h : XQ, A, yQ, B , h , C yang merupakan •input. P e j e t l a h E sebonyak n k a l i uirtuk mempe-r o l e h y ( x + iih) . o h a r g a i n i nampak pa da p e n a m p i l . C a t a t a n R1 = x' R2 = y» R3 =PRGOGRAM RK-1.4.2 y ( x + h ) = y + ( k , + 3 k _ ) / 4 i v ( x ) = y O O ' 0 * " O C dimana k . = h f (x ,y ) k„ = h f ( x + h / 2 , y + v / 3 ) dan 2 a o 1 k = h f ( x + 2 h / 3 , y + 2k / 3 ) , Program " — LBL A STO + 1 RTN LBL B STO RTN LBL C STO RTN LBL E RCL STO D STO 3
j
2 3 2 4 5 RCL 2 + STO 2 RCL 3 2 A D 2 x 3 4 RCL 4 t STO 2 RCL 3 "6 D 3 X RCL + 4 5 RCL + STO RCL 3 : A RCL RTN 1 5 4 2 3 2 T n s t r u k s i : I . Siapkan k a l k u l a t o r p a d a W/PRGM, masukkan program t e r s e b u t . I I . B u a t l a h LBL D u n t u k h f ( x , y ) kemudian p i n -dahkan W/PRGM k e RUN, I I I . P e j e t l a h : *•> As yQ, B , hs Cyang merupakan input, P e j e t l a h E u n t u k men-d a p a t k a n h a r g a y ( xQ+ h ) pada p e n a w p i l j d s t . C a t a t a n Sama dengan c a t a t a n p a d a PROGRAM RK-1.3.2 R1 = x , R2 = y , R3 = h .
PROGRAM RK-1.4.3 v ( x + h ) = y + (2k, + 3k„ + U V V 9 o o 1 2 3 y(x ) = y J o •'o dimana k , = h f ( x ,y 1 , k „ = h f ( x + h / 2 , y + k , / 2 ) dan I O O 2. 0 O 1 k - = h f ( x + 3 h / 4 , y + 3 k0/ M ) . d o O A Program : LBL A STO + 1 RTN LBL B STO 2 RTN LBL C STO 3 RTN LBL E RCL 2 STO 4 D STO 5 2 : RCL 2 + STO 2 RCL 3 2 A D STO 6 3 X 4 • RCL 4 + STO 2 RCL 3 4 • A D 4 X 3 ENTER RCL 6 X + 2 ENTER P.CL 5 X + 0 : RCL 4 + STO 2 RCL 3 4 '• A RCL 2 RTN
2 1
I n s t r u k s l :
I . Siapkan k a l k u l a t o r pada V/PRGM,. tnasukkan program t e r s e b u t . I I . Buatlah LBL D w t u k h f ( x , y ) kemudian pindahkan V/VRGVi ke RUN, I I I . P e j e t l a h :
x , A ,y , B, h . C yang merupakan. input.
Pejetlah E sebanyak n k a l i untuk mendapatkan harga y(x + n h ) ,
harga i n i nampak pada penampil d a r i k a l k u l a t o r . «
Catatan
Bila k i t a ingin merubah harga h dengan h^ k i t a t i n g g a l memasukkan h" i n i kemudian d i i k u t i dengan metnejet C.
Jelasnya demikian.
Setelah k i t a mengerjakan i n s t r u k s i I dan I I kemudian memejet x , A^ y , B, h , C s e r t a memejet tombol E sebanyak n k a l i , maka angka pada penampil adalah harga y(x + nh) ; apabila ketnudian k i t a mengikuti langkah t e r s e b u t dengan memejet h ' , C s e r t a E sebanyak a k a l i akan muncul angka penampil sebagai harga yCx + nh + m h ' ) .
PROGRAM RK-1.5.1 y ( xQ + h) = yQ + (k1 + 2 k2 + 2k3 + k ^ / 6 y ( x ) = y dimana k, = hf(x ,y ) s k„ = hf(x + h/2,y + k,/2) , I c J o * 2 o o • k . = h f ( x + W 2 , y + k / 2 ) dan k. = h f ( x + hsy + k j . 3 o " o 2 "4 o o 3 P r o g r a n : LBL A STO + 1 RTW L3L B STO 2 RTN LBL C STO 3 RTN LBL E RCL 2 STO H D STO 5 2 : RCL k + STO 2 RCL 3 2 A D STO 6 2 • RCL 4 + STO 2 D STQ 7 I RCL 4 + STO 2 RCL 3 2 • A D 2 ENTER RCL 7 X + 2 ENTER RCL 6 X + RCL 5 + 6 .-RCL 4 + STO 2 RCL 2 RTN
23
Instruksi :
I . Siapkan k a l k u l a t o r pada W/PRGM, masukkan program t e r s e b u t . I I . Euatlah LBL B untuk hf(>:.,y) keinudian pindahkan W/PRGM ke KUN. I I I . P e j e t l a h :
x 4 A,y , B,, h , C yang merupakan input.
Pejetlah S sebanyak n k a l i untuk raendaDatkan harga y(x + nil),,
o ini nampak pada penampil.
Catatan
Sama dengan catatan pada PROGRAM RK-1.4.3. R1 = x , Rj = y» R3 = h.
PROGRAM R K - 1 . 5 . 2 y(XQ + h) = y + (lc1 + 3k,, + 3k3 + k ^ / 8
v < 0 = y
dimana k . = h f ( x , y J . k_ = h f ( x + h / 3 Ay + v / 3 ) , I O O £. C " 0 1 kg = l i f ( x + 2 h / 3 , yQ - k j / 3 + k2) dan *4 * I * * » , + h5yo + k , - k2 + kg) . Program : IflL A STO + 1 FTN LBL C KCL 2 STO 4 B STO 5 3 RCL 2 + STO 2 RCL 3 A B STO 6 RCL **• + RCL 5 ENTER 3 : -STO 2 RCL 3 A B STO 7 FCL 6 -RCL 5 i + RCL + STO RCL A B 3 4 2 3 ENTER RCL X + 3 7 ENTER FCL X + PCL 6 5 4. 8 RCL T STO RCL KTN 4 2 2 t25
Instruksi
:I . Siapkan k a l k u l a t o r pada W/PRGM, raasukkan program t e r s e b u t .
I I . Buatlah LBL B untuk h f ( x , y ) dengan roenglngat bahwa pada storage
register 3 (R3) b e r i s i harga h / 3 .
Kemudian pindahkan d a r i W/PFGM ke RUN, I I I . P e j e t l a h :
xo, A , y , S T C 2 , h , ENTEF, 3 , : , STO 3 yang merupakan input.
P e j e t l a h C sebanyak n k a l i untuk mendapatkan harga y(x + n h ) , harga i n i nampak pada penstnpil.
Catatan
B i l a k i t a ingin mengubah harga h dengan h ' maka p e j e t l a j n% ENTER,
3 . := STD 3 .
Jelasnya dercikian.
Untuk raendapatkan harga y(x + nh + mh') k i t a havus mengerjakan I , I I , iremejet : x , A. y , STO 2 , h , ENTER, 3 , : , STO 3 , memejet c sebanyak n k a l i kemudian memejet : h ' , ENTER, 3 : , STO 3 dan akhimya c l a g i
sebanyak m k a l i .
PROGRAM WC-1.5.3 y ( x + h ) = y + (k + 4k„ + k. ) / 6 y ( xo) = yo diraana k = hf ( x ,v ) » K - ^ f ( x + h / 4 , y + k . / U ) , 1 0 0 « ° o 1 k = h f (x + h / 2 , v + ko /2 ds n k = h f ( x + h ,y + k . o o " o ^ 4 o o 1 Program : 2k2 + k3) LBL A STO + 1 RTN LBL r RCL 2 STO 4 B STO 5 4 : RCL 4 + STO 2 RCL 3 A B STO 6 2 : RCL 4
+ j
STO 2 RCL 3 A 3 STO 7 PCL 4 + RCL 5 + 2 ENTER RCL 6 X -STO 2 P.CL 3 2 X A B 4 ENTER RCL 7 X + RCL 5 + 6 : RCL 4 + STO 2 | ECL 2 RTN •27
Instruksi t
I . Siapkan k a l k u l a t o r pada W/PP.GMS masukkan program t e r s e b u t .
I I . Buatlah LBL B untuk hf(x,y) dengan mengingat bahwa storage
re-gister- 3 (R_) b e r i s i harga h / 4 .
Keraudian pindahkan W/PRGM ke RUN. I I I . Pejetlah r
x , A , y , STO 2 , h , ENTER}4,: .STO 3 yang merupakan input.
Pejetlali C sebanyak n k a l i untuk mendapatkan harga y(x + n h ) , harga i n i nampak pada penampil.
Catataii
y " ( x ) = f ( x , y , y - ) dengan s y s r a t awal : y ( xo> = yQ a y ' ( x ) = y * . PROGRAM BK-2.4.1 y ( x + h ) = y + h y ' + ( / 2 ) o o o hk, y " ( x + h ) = y' + ( 1 / 4 ) ic + ( 3 / 4 ) v O 0 O 2 dimana k = h f C x ^ y ^ y J ) k . = h f U + h / 3 , y „ + h y V 3 , y * + k / 3 ) 1 o o o " o o
k2 = hf(xQ + 2h/3,yQ + (2/3hy^ + (2/9)hko>y^ + 2k,
Program : LBL B RCL 2 STO 5 A STO 7 3 RCL 3 STO 6 + STO 3 RCL 6 RCL 4 X STO + 2 RCL 4 STO + 1 A STO 8 2 X 3 : RCL 6 + STO 3 RCL 4 RCL 7 X 2 X 3 : RCL 4 RCL 6 X + STO + 2 RCL 4 STO + 1 A 3 X RCL 7 + 4 : RCL 6 + STO 3 R/S RCL ^ STO + 1 RCL 8 2 : PCL 6 + RCL 4 X 3 X RCL 5 + STO 2 RTN
29
Instruksi :
I . Siapkan k a l k u l a t o r p a d a W/PRGM, masukkan program t e r s e b u t ,
I I . B u a t l a h LBL A u n t u k h f ( x , y , y * ) dengan n e n g i n g a t hahva. storage
register R1 untuk x , R_ u n t u k y . R^ trntuk y % R u n t u k h / 3 ; k e
-mudian p i n d a h k a n ke RUN. III. Pejetlah :
x } STO 1 , y , STO 2 , y * . STO 3 , h „ OTTER, 3 , : , STO U-t yang
me-rupakan input.
B i l a d i p e j e t B akan muncul p a d a p e n a m p i l h a r g a y ' 6 i + h ) k e m u d i -an deng-an memajet R/S ak-an b i s a d i l i h a t h a r g a d a r i y ( x + b ) .
B i l a k i t a i n g i n k a n h a r g a y ' ( x t nh) dan y ( x + n h ) maka s e t e l a h
input dimasukkan k i t a p e j e t pasangan tombol B dan R/S sebanyak n
k a l i dengan u r u t a n : B,R/S,B , R / S , R1 = x , R2 = y , R3 = y ' s R^ = h / 3
S e k e d a r memberikan gambaran bagaimana menggunakan program t e r s e b u t , b e r i k u t i n i kami kemukakan contoh persamaan d i f e r e n s i a l l i -n i e r orde s a t u :
y ' ( x ) = s i n x ; y ( 0 ) = -1 K i t a gunakan program RK-1.5.1 s e b a g a i b e r i k u t :
Kalkulator k i t a siopkan pada W/PRGM.
Kita p e j e t tombol f PRGM dan k i t a masukkan program RK-1.5.1. Kenudian k i t a Ireruskan dengan membuat l a b e l D sebagai b e r i k u t :
LBL D S DEG. RCL 1 f SIN RCL 3 x 180 g 7T X KTN
Setelah i t u , k i t a pindah W/PRGM ke RUN.
. Kita masukkan 0 , p e j e t As k i t a masukkan (pejet angka) 1, pejet
CHS ( b e r a r t i k i t a masukkan harga - 1 ) , pejet B. p e j e t 5 ( b e r a r t i k i t a masukkan harga h = 5 ) , pejet C, kemudian k i t a p e j e t E seba-nyak 38 k a l i misalnyas dengan mencatat angka pada penampil s e t i a p
x (derajat) y
5 1 0 15 2 0 2 5 3 0 3 5 40 4 5 5 0 55 60 55 7 0 75 80 85 90 9 5 1 0 0 1 05 110 - 0 . 9 9 6 1 9 - 0 . 9 8 4 8 - 0 . 9 6 5 9 3 - 0 . 9 3 9 6 9 - 0 . 9 0 6 3 1 - 0 . 8 P 6 0 3 - 0 . 8 1 9 1 5 - 0 . 7 6 6 0 4 - 0 . 7 0 7 1 1 - 0 . 6 4 2 7 9 - 0 . 5 7 3 5 8 - 0 . 5 0 0 0 0 - 0 . 4 2 2 5 2 - 0 . 3 4 2 0 2 - 0 . 2 5 8 8 2 - 0 . 1 7 3 6 5 -0.087156 +0.000000 0.087156 0.17365 0.25882 0.34202x (darajat) y
1 15 120 1 2 5 130 135 140 145 150 155 160 165 170 175 180 185 190 0.42262 0.50000 0.57358 0.64279 0 . 7 0 7 1 1 0.76604 0.81915 0.86603 0 . 9 0 6 3 1 0.93969 0.96593 0 . 9 8 4 8 1 0.99619 1.00000 0.99619 0 . 9 8 4 8 1Sekarang k i t a akan rnenibandingkan h a s i l yang diperoleh dengan menggunakan £ K - 1 . 3 J{ S K - 1 -4-1 <len BK-1.5.1 imtuk perssnaen.
y~(x} ^ y . y ( o ) = 1 x Pk-1.3.1 BK-1.4.1 Fk-1.5.1 «x (#) 0 0 . 1 0 . 2 0 . 3 0 . 4 0 . 5 0 . 6 0 . 7 0 . 8 0 . 9 1 . 0 2 . 0 3 . 0 4 . 0 5 . 0 6 . 0 7 . 0 8 . 0 9 . 0 10 1.00000000 1.05000000 1.22102500 1.31+923262 1.49090205 1.64744677 1.82042868 2,01157369 2.22278892 2.45618176 2.71408084 6.78520212 1 6 . 9 6 3 0 6 5 3 42.4075132 1 0 6 . 0 1 8 7 8 3 2 6 5 . 0 4 6 9 5 8 6 6 2 . 6 1 7 3 9 5 1656.54343 4141.35872 10353.3758 2,0000000 1,1051667 1.2213934 1.3498432 1.4918017 1.6486896 1.8220767 2.0136985 2.2254724 2.4595180 2.7181773 7.2484727 19.329261 51.544695 137.45252 366.540O5 977.44014 2606.5070 6950.6854 1 8 5 3 5 . 1 6 1 1.0000000 1.1051708 1.2214026 1.3498585 1.4918242 1.6487206 1.8221180 2.0137516 2.2255400 2.4596014 2.7182798 7.3620076 1 9 . 9 3 8 7 7 1 54.000837 146.25227 396.09989 1072.7705 2905.4202 7868.8464 21311,459 1.000O000 1.1051709 1.2214028 1.3498588 1.4918247 1.6487213 1.8221188 2.0137527 2.2255409 2.4596031 2.7182818 7.3890561 20.085337 54.598150 148.41316 403.42879 1096.6332 2980.9580 8103.0839 22026.466
33
£ A F i r s t Course i n Numerical Analysis - Anthony R a l s t o n , HJm. 207.
Oari x=0 s . d . x=1 fc=0.1 ; sedang d a r i x=l s . d . x=10 h=t>
Perlu d i i n g a t bahwa program dengan HP-65 t i d a k boleh l e b i h atari 100 langkah termasuk d i s i n i langkah pada l a b e l untuk harga n f ( x ,
2
y) atau h f ( x , y ) (pada contoh RK-1.5.1 d i muka LBL D). Oleh karena i t u programprogram d i muka b i s a digunekan asalkan langkah program t o t a l -nya t i d a k raelampaui 100 langkah.
Juga, sebelttm program dimasukkan seyogyanya k i t a memejet da-hulu f PRGM j sudah barang t e n t u s e t e l a h k a l k u l a t o r disiapkan pada W/ PRGM9 agar t i d a k t e r j a d i kesalahan karena t e l a h t e r i s i n y a storage re-gister dengan program yang l a i n .
Program untuk penyelesaian persamaan d i f e r e n s i a l l i n i e r o r -de dua yang lain> juga untuk s i s t i m persamaan d i f e r e n s i a l l i n i e r belum b i s a kami buat dengan p r a k t i s . Hal i n i karena terbatasnya langkah yang disediakan k a l k u l a t o r i t u . Perhitungan perbandingan waktu hitung t i d a k b i s a dilakukan j u g a , meskipun k i t a t e t a p b i s a membandingkan cacah ope-r a s i hitung yang dipeope-rlukan oleh s e t i a p ope-rumus pendekatan metoda
Runge-Kutta i n i ,
Program untuk s e t i a p rumus pendekatan di muka memang t i d a k tunggal dalam a r t i masih b i s a dibuat model program yang berbeda dalam rumus pendekatan yang sama.
toda Pictge-Kutta :
- untuk persamaan d i f e r e n s i a l l i n i e r orde se.tu y"(x) = f(x.y^ , y(x ~)~
y berdasarkan psda penyelesaian pendekatan
y(x„ + h> = 7 + (k. + 21c, + 2k., + k . l / B O O I i. J 4 dir.ana k, = hf(x .y ) - k = hf(x + h / 2 , y + k , ^ 1 o • Jo " 2 o o ' k = h f ( x + h/23y + k /2^ dan k„ = hf(x + h . yn + k _ ) . 3 o o 2 4 o 0 3 - untuk sistim nersEonaan d i f e r e n s i a l orde s a t u yT(x^ = £ . ( x . . , . . , y )
y , ( x 1 = y . i berdasarkan pada penyelesaian pendekatsn y . ( x + M = y . + ( k , . + 2k0. + 2k. . + ku. V 5 i i o l i 2 x 3 i 4 i diniana
Ni
= h fi
(V
y1
(V * ' ^ V ^
k2 i = h f . ( xc + h / 2 ,y i( xot + kn/ 2 , . . . . , yn( xo) t k1 n/ 2 ) k3 i = h fi( Xo + h / 2 ,y i( x ^ + k2, /2 j . . . . s yn(xo> + k2 n/ 2 ) k „ . = hf. (x + h y . ( x } + L . , y (x ") + k,, ) 4i l o J1 o 31 - - ' n o 3nProgram untuk kedua penyelesaian pendekatan t e r s e b u t k i t a jadikan subroutine yang skan b i s a dipakai n a n t i b i l a komputer sudah k i t a m i l i k i . Perlu kami kemukakan juga bahwa program i n i belun pernah kami coba dengan komputer karena kesem'patan untuk i t u belum kakami p e r -oleh.
Program untuk penyelesaian pendekatan yang lainnya akan mi-r i p dengsn pmi-rogmi-ram di a t a s (logika pmi-rogmi-ramnya) sehingga kami sengaja t i d a k menibuatnya.
Flow Chart : SUBROUTINE RUNGEKUTTA (XI ..YI tEX,HfF..RK) r ^ ' mulailah dengan i i VARX = XI , VARY = YI '
.1
i hrtung AKl = F i — _ VARX = VAPX + H/2 VARY = YI + AKl/2 f ~ , - ! _ _ ; h i t u n g A .K2 = F L. .... . . . i VARY = YI + AK2/2k
i . 1 i i l i A ' hitune AK3 = F i VARX = VARX + H/2 VARY = YI + AK3 -Nil | ! gmbillah YI = RK J i i dan XI = VARX > 1 i p 1 h i t u n g AK4 = F .>!/_ i h i t u n g PK = YI +SUBROUTINE RUNGEKUTTA ( X IJ l ,EX.H ,FSRK) 108(0 VARX = XI VARY = YI ~.K1 = F VARX = VARX + H/2, VARY = YI + AK1/2. AK2 = F VARY = YI + AK2/2. AK3 = F VAPX = VAF.X + H/2, VARY = YI + AK3 AK4 = F
PK = YI + (AK1 + 2, ... AK2 + 2, ft AK3 + KM)/5.
IF (VARX - EX) 1001,10^2;1002 1001 XI = VARX YI = F.K GO TO 1000 1002 RETURN END Keterangan
Dalam program utana k i t a tentukan XI = harga x awalj YI = harga y awals Ex = harga absis x dimana ordinat y yang s e s u a i
dengan-nya yang k i t a inginkan, H = harga sub i n t e r v a l (h) yang' k i t a p i l i h dan F = h f ( x , y ) dengan catatan untuk v a r i a b e l - v a r i a b e l n y a : VARX = x;
VARY = y dan H = h.
37
SUBROUTINE RUNGEKUTTA ST (X ..Y,EX,H ,F,M1
DIMENSION Y(N) , VARY(U) -F(N> ,AKlCO ,AK2(N) ,AK3(N) ^AK^d-f) 6 VARX = X DO 1 1=1 ,N 1 VARY(I) = Y(T) DO 2 J=1.N AK1(J) = F ( J ) 2 VARY(J) = Y(J) + A K l ( J ) / 2 . VARX = VARX + H / 2 . DO 3 K=1,W AK2(K> = F(K)
3 VARY(K) = Y(K) + AK2(K)/2, DO H L=1,N
AK3(L) = F(L)
"+ VARY (Li = Y(L) + AK3(L) ' VARX = VARX + H/2.
DO 5 M=1,N AK4(M) = F(M)
5 Y(M) = Y(M"> + (AK1(M) + 2.*AK2(M) + 2.*AK3(M) + AK4(M))/6. I F (VARX - EX) 6 , 7S7
6 X = VARX GO TO 8 7 RETURN
Keterangan
M s a l n y a k i t a dihadapkan p a d a s i s t e m persamaan d i f e r e n s i a l : yj"(x) = 5x + y2
y^Cx) = 2x" + y iy2
denean s v a r s t awal : y , ( x ) = r y _ ( x ) = s
Maka dalera h a l i n i , N = 2 dan pada p r o g r a a utama k i t a n a s u k k s n
V. - xo, ' / ( 1 ) = r , Y(2^ = s , F ( H = H * ( 5 . * VARt + VARY(2)) dan
F(2) = h * ( 2 . « VARX •'<* 2 + VARY(0 * VARY(2>)
V, KESIMPULAN
Beberapa k e s i m p u l a n y s n g b i s a d i a n b i l d a r i p e m b i c a r a a n me-n g e me-n a i roetoda Rume-nge-Xutta a me-n t a r a l a i me-n :
met ode i n i self stavtir.g dan dap a t d i p a k a i u n t u k m e n y e l e s a i k a n p e r -s o a l a n -sampai k e t i t i k yang k i t a i n g i n k a n , -s e i -s i n i t u b i -s a p u l a h -s n y a u n t u k m e n g h a s i l k a n starting values yang d i p e r l u k a n o l e h metoda l a i n
( n i s a l n y a , raetoda p r e d i k t o r - k o r e k t o r )
- sub i n t e r v a l ft b i s a k i t a p i l i h sekehendak s e s u a i kebutuh?n k i t a - cukup t e l i t i d i b a n d i n g k a n metoda p r e d i k t o r - k o r e k t o r
- k e s a l a h a n p e r lengkah p e n d e k a t a n memang s u k a r d i t e n t u k a n s e c a r a exak , o l e h k a r e n a i t u sub i n t e r v a l h b i a s a n y a d i a m b i l l e b i h pendek d a r i yang d i p e r l u k a n menurut t e o r i dalam mencapai k e t e l i t i a n yang d i i n g i n k a n
- d i b a n d i n g k a n ^.etoda p r e d i k t o r - k o r e k t o r s metoda PungeKutta i n i l e
b i h banyak memerlukan p e r h i t u n / j a n f ( x . y ) ( s e s u a i dengan orde k e s a -l a h a n d a r i rumus p e n d e k a t a n n y a )5 s e h i n g g a k a l a h c e p a t
- k i t a d a p a t menggabungkan rr.etoda Punge-Kutta dengan metoda p r e d i k t o r - k o r e k t o r dimana metoda Punge-kuttft d a l a n h a l i n i digunakan untuk
mencari starting values yang d i b u t u h k a n raetoda p r e d i k t o r - k o r e k t o r - mengingat kemampuan k a l k u l a t o r HR-65 k i t a ^ j e l a s l a h b e b e r a p a program
hanya b i s a digunakan untuk m e n y e l e s a i k a n p r o b l e m - p r o b l e m s e d e r h a n a;
t e r b a t a s n y a j e n i s problem persamaan d i f e r e n s i a l yang s e c a r a p r a k t i s b i s a k i t a s e l e s a i k a n i n i akan b i s a d i h i l a n g k a n dengan menggunakan k a l k u l a t o r a t a u komputer yang m e m i l i k i kemampuan l e b i h b a i k .
P r e s s , 19 C5.
2 . R s l s t c n . Anthony, A First Course in unnericsl Analysis, McGraw-Hill
Kogakusha, Tokyo, 1955,
3. Clay; Poy.L. _ Solutions of Si,3ten of Differential Equation-
Lawren-ce Radiation Laboratory University of C a l i f o r n i a . USA June 1959, 4. I n t e r n a t i o n a l Seminar Course 2-20 Agust 1971. Computing as A
Lan-guage of Physics. I n t e r n a t i o n a l Atomic Energy Agency, Vienna 1 971 .
5. Proceeding of A Seminar 17-21 January 1972, numerical Peactor
Cal-culations^ I n t e r n a t i o n a l Atonic Energy Agency., Vienna. 1972.
6. Fox, L.j How to get Memingless Answers in Scientific Computation
(aid what to do about it). . . , „