You are on page 1of 7

1.

h= 0.2
i=5
k_1 = 3.451041651557123
k_2 = 3.896145816712835
k_3 = 3.940656233228407
k_4 = 4.439172898202805

h =0.1000
i = 10
k_1 = 3.919202827560142
k_2 = 4.165162968938149
k_3 = 4.177460976007049
k_4 = 4.436948925160847

h =0.0500
i = 20
k_1 = 4.171419073190575
k_2 = 4.300704550020339
k_3 = 4.303936686941083
k_4 = 4.436615907537629

h =0.0250
i = 40

k_1 = 4.302334405483385
k_2 = 4.368613585551927
k_3 = 4.369442075302784
k_4 = 4.436570457365955

B.

2. For dy/dt = 2y +3z, y(0) = 1, t =[0,1], h = 0.1:


Fourth order Runge-Kutta method :
h = 0.100000000000000
ii= 11
k1= 9.583333862489187

k2= 10.691667248738106
k3= 10.802500587363000
k4=12.043833979961788
ans= 26

For dz/dt = 2y +z, y(0) = -1, t =[0,1], h = 0.1:


Fourth order Runge-Kutta method :
h = 0.100000000000000
ii= 11
k1= 3.194444620829730
k2= 3.563889082912703
k3= 3.600833529121000
k4=4.014611326653929
ans= 26

3. for t=[0,3], h=0.1


K_4 = -1.23*10^-6
For h = .05
K_4 = -6.18*10^-8

4.
For dy/dt = 2y +3z, y(0) = 1, t =[0,1], h = 0.1:

For dz/dt = 2y +z, z(0) = -1, t =[0,1], h = 0.1:

5. For u = 10 and using ode 45 to solve the eq. d^2 u / d(x^2) + 6* du /dx u =2

For u = 1 and using ode 45 to solve the eq. d^2 u / d(x^2) + 6* du /dx u =2

6. For s = 1 and solving using ode45 for d^2T / d(r^2) + 1 / r * dT /dr + s = 0 over the range 0<= r <=1 and
the condition T(r = 1) = 1

For s = 10 and solving using ode45 for d^2T / d(r^2) + 1 / r * dT /dr + s = 0 over the range 0<= r <=1 and
the condition T(r = 1) = 1

For s = 20 and solving using ode45 for d^2T / d(r^2) + 1 / r * dT /dr + s = 0 over the range 0<= r <=1 and
the condition T(r = 1) = 1

You might also like