Elisha

50 Reputation

5 Badges

8 years, 111 days

MaplePrimes Activity


These are questions asked by Elisha

I find it difficult to use dsolve to solve system of ordinary differential equations with assigned parameters and initial conditions. The error message "Error, (in dsolve/numeric) 'parameters' must be specified as a list of unique unassigned names" kept coming up.

Pls see the uploaded equation for more understanding

restart

interface(imaginaryunit = F)

I

(1)

I

I

(2)

sqrt(-4)

2*I

(3)

NULL

Suscep := diff(S(t), t) = theta*epsilon+v__2*S__v(t)-S(t)*lambda-S(t)*(µ+v__1)

diff(S(t), t) = theta*varepsilon+v__2*S__v(t)-S(t)*lambda-S(t)*(µ+v__1)

(4)

Vacc := diff(S__v(t), t) = (1-theta)*epsilon+v__1*S(t)-(µ+alpha+v__2)*S__v(t)-(1-w)*S__v(t)*lambda

Immun := diff(V(t), t) = alpha*S__v(t)+`ρ__A`*A(t)+(1-k)*`ρ__Q`*Q(t)+`ρ__I`*(I)(t)-µ*V(t)

Exp := diff(E(t), t) = S(t)*lambda+(1-w)*S__v(t)*lambda-(q__E+delta+µ)*E(t)

Asymp := diff(A(t), t) = delta*a*E(t)-(`ρ__A`+µ)*A(t)+k*`ρ__Q`*Q(t)

Inf := diff((I)(t), t) = delta*(1-a)*E(t)-(`ρ__I`+q__I+`δ__I`+µ)*(I)(t)

Quar := diff((I)(t), t) = q__E*E(t)+q__I*(I)(t)-(`ρ__Q`+`δ__Q`+µ)*Q(t)

init_conds := S(0) = S_0, S__v(0) = S__v*_0, V(0) = V_0, E(0) = E_0, A(0) = A_0, (I)(0) = I_0, Q(0) = Q_0

S(0) = S_0, S__v(0) = S__v*_0, V(0) = V_0, E(0) = E_0, A(0) = A_0, I(0) = I_0, Q(0) = Q_0

(5)

sys := {Asymp, Exp, Immun, Inf, Quar, Suscep, Vacc, init_conds}

``

sol := dsolve(sys, numeric, parameters = [`δ__Q`, `δ__I`, a, k, epsilon, v[1], q[E], q[I], q[A], eta[A], eta[Q], rho[A], rho[Q], rho[I], v[2], alpha, mu, delta, alpha, beta, w, lambda, S_0, S__v*_0, V_0, E_0, A_0, I_0, Q_0], method = rkf45)

Error, (in dsolve/numeric) 'parameters' must be specified as a list of unique unassigned names

 

sol(parameters = [delta = .125, `δ__Q` = 0.6847e-3, epsilon = .464360344, `δ__I` = 0.2230e-8, a = .6255, q[E] = 0.18113e-3, k = .15, v__1 = 0.5e-1, v__2 = 0.6e-1, `ρ__Q` = 0.815e-1, `ρ__A` = .1, `ρ__I` = 0.666666e-1, q__I = 0.1923e-2, q__A = 0.4013e-7, `η__A` = .1213, `η__Q` = 0.3808e-2*alpha and 0.3808e-2*alpha = .4, w = .5925, mu = 0.464360344e-4, lambda = 0.1598643e-7, S_0 = 1.0, S__v*_0 = 0.6e-4, V_0 = 0.35e-4, E_0 = 0.5e-4, I_0 = 0.32e-4, A_0 = 0.15e-4, Q_0 = 0.1e-4])

sol(parameters = [delta = .125, delta__Q = 0.6847e-3, varepsilon = .464360344, delta__I = 0.2230e-8, a = .6255, q[E] = 0.18113e-3, k = .15, v__1 = 0.5e-1, v__2 = 0.6e-1, rho__Q = 0.815e-1, rho__A = .1, rho__I = 0.666666e-1, q__I = 0.1923e-2, q__A = 0.4013e-7, eta__A = .1213, false, w = .5925, mu = 0.464360344e-4, lambda = 0.1598643e-7, S_0 = 1.0, S__v*_0 = 0.6e-4, V_0 = 0.35e-4, E_0 = 0.5e-4, I_0 = 0.32e-4, A_0 = 0.15e-4, Q_0 = 0.1e-4])

(6)

Evaluate*the*system*at*t = 2

sol(2)

sol(2)

(7)

sol(1)

sol(1)

(8)

sol(.1)

sol(.1)

(9)

sol(.3)

sol(.3)

(10)

sol(.5)

sol(.5)

(11)

sol(.7)

sol(.7)

(12)

sol(.9)

sol(.9)

(13)

sol(1.1)

sol(1.1)

(14)

sol(1.3)

sol(1.3)

(15)

sol(1.5)

sol(1.5)

(16)

 

 

Download Covid19_Simulation.mw

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

How can i plot various 3 multiple graphs using Maple to Compare ADM, EXACT SOLUTION AND RKF45 using the table below:

 Time  ADM Solution                                   RKF45 Numerical Solution        EXACT Solution

               ADM Solution                     RKF45 Numerical Solution                EXACT Solution

 t           s               i              r                 s            i                r             s               i                   r

0.1     0.0769540597    0.1477783335     0.1393069312      0.0763361154   0.1477867626   0.1393072151   0.0763361266    0.1477867830     0.1393071934 

0.3     0.1093424148    0.1120401102     0.1509302274      0.1072278404   0.1121142033   0.1509369166   0.1072278479    0.1121142168     0.1509369024 

0.5     0.1392030568    0.0853083077     0.1558066181      0.1353291378   0.0855066806   0.1558355785   0.1353291558    0.08550671332   0.1558355439

0.7     0.1662374563    0.0652194693     0.1562235596      0.1604342222   0.0655908735   0.1562974878   0.1604342352    0.06559089617   0.1562974637 

0.9     0.1903821623    0.0500537619     0.1537887672      0.1825594352   0.0506356391   0.1539346707   0.1825594528    0.05063567192   0.1539346352

1.1     0.2117168860    0.0385555127     0.1496220815      0.2018541863   0.0393727175   0.1498707561   0.2018542024    0.03937274753   0.1498707234 

1.3     0.2303874000    0.0298096396     0.1444864012      0.2185409755   0.0308687065   0.1448804021   0.2185409880    0.03086872986   0.1448803765 

1.5     0.2465077820    0.0231661161     0.1388614678      0.2328759081   0.0244336214   0.1394893808   0.2328759200    0.02443364533   0.1394893543

 

 

 

I have a system of ODE that I need to get an exact solution to. How can I do this using Maple? I tried doing it but error pops out.

Thanks

Pls what is the maple code for the fourth order Runge-kutta method for five systems of ODE of several variables?

1 2 3 Page 2 of 3