Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

>> fungsi=@(t,y) 4*exp(0.8*t)-0.

5*t

fungsi =

@(t,y)4*exp(0.8*t)-0.5*t

>> a=0

a=

>> b=4

b=

>> n=20

n=

20

>> alfa=2
alfa =

>> [t y]=rk_4(fungsi,a,b,n,alfa)

h=

0.2000

t=

Columns 1 through 12

0 0.2000 0.6000 1.2000 2.0000 3.0000 4.2000 5.6000 7.2000 9.0000 11.0000
13.2000

Columns 13 through 21

15.6000 18.2000 21.0000 24.0000 27.2000 30.6000 34.2000 38.0000 42.0000

y=
1.0e+013 *

Columns 1 through 12

0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
0.0000

Columns 13 through 21

0.0000 0.0000 0.0000 0.0000 0.0000 0.0003 0.0040 0.0701 1.4532

t=

Columns 1 through 12

0 0.2000 0.6000 1.2000 2.0000 3.0000 4.2000 5.6000 7.2000 9.0000 11.0000
13.2000

Columns 13 through 21

15.6000 18.2000 21.0000 24.0000 27.2000 30.6000 34.2000 38.0000 42.0000

y=
1.0e+013 *

Columns 1 through 12

0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
0.0000

Columns 13 through 21

0.0000 0.0000 0.0000 0.0000 0.0000 0.0003 0.0040 0.0701 1.4532

>> plot(t,y)

You might also like