Upload presentasi
Presentasi sedang didownload. Silahkan tunggu
1
Persamaan Differensial Biasa
2
Ruang lingkup Metode Euler Metode Runge-Kutta orde dua (Heun)
Metode Runge-Kutta orde empat
3
Definisi Metode Euler merupakan metode yang menghitung sejumlah pasangan nilai (tk,yk) sebagai pendekatan fungsi penyelesaian tersebut. Algoritme
4
Contoh:
5
Secara analitik Iterasi ke-1 t1=t0+h=0+0,2=0,2 y1=y0+0,2f(0,1) =1+0,2(1)=1,2 iterasi ke-2 t2=t1+h=0,4 y2=y1+hf(t1,y1)=1,2+0,2(1,2)=1,44 …dst
6
function [t,y]=euler(h,a,b,y0)
deff('y=f(t,y)','y=y') n=(b-a)/h; t=[a]; y=[y0]; for k=2:n+1 t=[t;a+(k-1)*h]; y=[y;y(k-1)+h*f(t(k-1),y(k-1))]; end endfunction
8
Metode Runge-Kutta orde2
Algoritme
9
Contoh:
10
Secara analitik Iterasi 1 (k=0) t1=0+1=1 s1=f(t0,y0)= (0-1)/2 = -1/2
s2=f(t1,y0-1/2)= (t1-(y0-1/2))/2 = ¼ y1=1+1(-1/2 + 1/4)/2 = 7/8 iterasi 2 (k=1) t2=1+1=2 s1=f(t1,y1)= (1-7/8)/2 = 1/16 s2=f(t2,y1 + 1/16)= (t2-(y1+1/16))/2 =17/32 y2= 75/64 Dst……………
11
function [t,y]=rk2pdb(h,a,b,y0)
deff('y=f(t,y)','y=(t-y)/2') n=(b-a)/h; t=[a]; y=[y0]; for k=2:n+1 t=[t;a+(k-1)*h]; s1=f(t(k-1),y(k-1)); s2=f(t(k),y(k-1)+h*s1); y=[y;y(k-1)+(h/2)*(s1+s2)]; end endfunction
13
Metode Runge-Kutta orde4
Algoritme
14
Contoh:
15
Secara analitik t1=0+1=1 s1=f(t0,y0)= (0-1)/2 = -1/2 s2=f(t0+1/2,y0 + 1(1/4))=(0+1/2-1+1/4)/2= -1/8 s3=f(t0+1/2,y0 + 1(-1/16))=(0+1/2-1+1/16)/2= -7/32 s4=f(t1,y0 + 1(-7/32))=(t1-y0+7/32)/2= 7/64 y1=1+1/6[-1/2+2(-1/8 -7/32)+7/64]
16
function [t,y]=rk4pdb(h,a,b,y0)
deff('y=f(t,y)','y=(t-y)/2') n=(b-a)/h; t=[a]; y=[y0]; for k=2:n+1 t=[t;a+(k-1)*h]; s1=f(t(k-1),y(k-1)); s2=f(t(k-1)+h/2,y(k-1)+h*(s1/2)); s3=f(t(k-1)+h/2,y(k-1)+h*(s2/2)); s4=f(t(k),y(k-1)+h*s3); y=[y;y(k-1)+(h/6)*(s1+2*(s2+s3)+s4)]; end endfunction
Presentasi serupa
© 2024 SlidePlayer.info Inc.
All rights reserved.