Question: Comparing RK4 and RK45. How to solve Differential equation using the fouth order Runge-kutta RK4

Dear Team, I have used RKF45 to solve my ODE with Maple. now I am required to solve same ODE using RK4 for comparison of solution. Ps help me with an example. Pls find my Parameters, intial values and ODE below:


 

``

ODE*equations

ODE*equations

(1)

diff(s(t), t) = (1-phi)*epsilon+(1-rho)*a+(1-f)*alpha*v(t)-(lambda+theta[1]+a+epsilon)*s(t)

diff(v(t), t) = phi*epsilon+rho*a+theta[1]*s(t)-((1-f)*alpha+f*theta[2]+a+epsilon)*v(t)

diff(e(t), t) = lambda*s(t)-(delta+a+epsilon)*e(t)

NULL

diff(r(t), t) = eta*i(t)+v(t)*f*theta[2]-(a+epsilon)*r(t)

``

``

My*parameters

My*parameters

(2)

v(0) := .4

.4

(3)

NULL

s(0) := 0.6e-1

0.6e-1

(4)

e[0] := .24

.24

(5)

i[0] := .17

.17

(6)

r[0] := .13

.13

(7)

c := 0.4e-1

0.4e-1

(8)

f := .4

.4

(9)

beta := .2

.2

(10)

epsilon := .8

.8

(11)

theta[1] := .1

.1

(12)

theta[2] := .3

.3

(13)

alpha := .9

.9

(14)

rho := .7

.7

(15)

eta := .99

.99

(16)

delta := .3

.3

(17)

a := 0.4e-1

0.4e-1

(18)

phi := 1

``

``

``


 

Download ODE_EQNS.mw

Please Wait...