Sunteți pe pagina 1din 3

Homework 2

Name

: Nadya Amalia

Student ID

: 20213042

Subject

: Komputasi Sistem Fisis (FI5005)

Lecturer

: Dr.rer.nat. Linus Ampang Pasasa

Use Runge-Kutta fourth order method for solving a system of first order Ordinary Differential
Equation.
)(
0.5
=
= (, )
4 0.3 0.1
()
( 0)
4
(0) = =
(0)
6

with = 0.5, on the interval [0, 10].


Solution
In vector format we write the Runge-Kutta fourth order method as

= + ( + 2 + 2 + ), = 0, 1, 2,
where

= , = , = , =

= (, (), ()), = 1, 2.

1
1
= + , () + , () + , = 1, 2.
2
2
2

1
1
= + , () + , () + , = 1, 2.
2
2
2
= ( + , () + , () + ), = 1, 2.
In explicit form, we write the method as

1
() = () + ( + 2 + 2 + )
6
1
() = () + ( + 2 + 2 + )
6

For = , we have = , () = , () =

= (, (), ()) = (0.5)(0.5)(4) = 1.000000

= (, (), ()) = (0.5)[4 (0.3)(6) (0.1)(4)] = 0.900000

1
1
= + , () + , () +
2
2
2
1

= (0.5)(0.5) 4 + (1.000000)= 0.875000

1
1
= + , () + , () +
2
2
2

= (0.5) 4 (0.3) 6 + (0.900000) (0.1) 4 + (1.000000)= 0.857500

1
1
= + , () + , () +
2
2
2

= (0.5)(0.5) 4 + (0.875000)= 0.890625

1
1
= + , () + , () +
2
2
2

= (0.5) 4 (0.3) 6 + (0.857500) (0.1) 4 + (0.875000)= 0.857563

= ( + , () + , () + )

= (0.5)(0.5)[4 + (0.890625)] = 0.777344

= ( + , () + , () + )

= (0.5){4 (0.3)(6 + 0.857563) (0.1)[4 + (0.890625)]} = 0.815897

1
(0.5) = () = () + ( + 2 + 2 + )
6
1
= 4 + [(1.000000) + (2)(0.875000) + (2)(0.890625) + (0.777344)]
6
= 3.115234

1
(0.5) = () = () + ( + 2 + 2 + )
6
1
= 6 + [(0.900000) + (2)(0.857500) + (2)(0.857563) + (0.815897)]
6
= 6.857670

For = , we have = . , () = . , () = .
= (, (), ()) = (0.5)(0.5)(3.115234) = 0.778809

= (, (), ()) = (0.5)[4 (0.3)(6.857670) (0.1)(3.115234)] = 0.815588

1
1
= + , () + , () +
2
2
2

= (0.5)(0.5) 3.115234 + (0.778809)= 0.681458

1
1
= + , () + , () +
2
2
2
1
1
= (0.5) 4 (0.3) 6.857670 + (0.815588) (0.1) 3.115234 + (0.778809)
2
2
= 0.773889

1
1
= + , () + , () +
2
2
2
2

1
= (0.5)(0.5) 3.115234 + (0.681458)= 0.693626
2

1
1
= + , () + , () +
2
2
2

= (0.5) 4 (0.3) 6.857670 + (0.773889) (0.1) 3.115234 + (0.681458)

= 0.774583

= ( + , () + , () + )

= (0.5)(0.5)[3.115234 + (0.693626)] = 0.605402

= ( + , () + , () + )

= (0.5){4 (0.3)(6.857670 + 0.774583) (0.1)[3.115234 + (0.693626)]} = 0.734082

1
(1.0) = () = () + ( + 2 + 2 + )
6
1
= 3.115234 + [(0.778809) + (2)(0.681458) + (2)(0.693626) + (0.605402)]
6
= 2.426171

1
(1.0) = () = () + ( + 2 + 2 + )
6
1
= 6.857670 + [(0.815588) + (2)(0.773889) + (2)(0.774583) + (0.734082)]
6
= 7.632106

Solution obtained with a computer program for the fourth-order RK method. The plot below
represents solutions for ( )and ( )for = 0 until = 10, with = 0.5.
14,000000
12,000000
10,000000
8,000000

y1
6,000000

y2

4,000000
2,000000
0,000000
0,0

2,0

4,0

6,0

8,0

10,0

12,0

S-ar putea să vă placă și