angelisasking

10 Reputation

One Badge

1 years, 354 days

MaplePrimes Activity


These are questions asked by angelisasking

hi im currently doing my thesis and can somebody help me to develope the code? pls im stuck..

restart;
_local(I);
Digits := 15;
de1 := (1 - p)*(diff(S(t), t) + mu*S(t)) + p*(diff(S(t), t) + mu*S(t) + beta*S(t)*I(t) - rho*R(t) - varepsilon);
de2 := (1 - p)*(diff(E(t), t) + (alpha1 + mu)*E(t)) + p*(diff(E(t), t) + (alpha1 + mu)*E(t) - beta*S(t)*I(t));
de3 := (1 - p)*(diff(I(t), t) + (alpha2 + delta + mu)*I(t)) + p*(diff(I(t), t) + (alpha2 + delta + mu)*I(t) - alpha1*E(t));
de4 := (1 - p)*(diff(R(t), t) + (mu + rho)*R(t)) + p*(diff(R(t), t) + (mu + rho)*R(t) - alpha2*I(t));
ibvc := S(0) = 2304219, E(0) = 84929, I(0) = 299, R(0) = 71411;
sys1 := eval([de1, de2, de3, de4], p = 1);
dsolve(sys1);
sys0 := eval~(sys1, [{I = 0, R = 0}, {I = 0, S = 0}, {E = 0}, {I = 0}]);
sys_p := `*`~(1 - p, sys0) +~ `*`~(p, sys1);
ode1, ode2, ode3, ode4 := seq(sys_p[j], j = 1 .. 4);
ode1;
de1;
collect(expand(ode1 - de1), S(t), factor);
ode2 - de2;
ode3 - de3;
ode4 - de4;
mu := 0.133*10^(-5);
varepsilon := 0.99879;
delta := 0.004554;
beta := 0.1009*10^(-6);
alpha1 := 0.0008999;
alpha2 := 0.1997;
rho := 0.00090021;
res := dsolve({ibvc, ode1, ode2, ode3, ode4}, numeric, parameters = [p], abserr = 0.1*10^(-14), relerr = 0.1*10^(-12));
res(parameters = [0.5]);
res(50);
plots:-odeplot(res, [t, S(t)], 0 .. 100);
res(parameters = [1]);
plots:-odeplot(res, [t, S(t)], 0 .. 100);
Q := proc(p, {scene::list := [t, S(t)], range::range := 0 .. 100}) if not p::realcons then return 'procname(_passed)'; end if; res(parameters = [p]); plots:-odeplot(res, scene, range, _rest); end proc;
Q(0.5, color = blue);
plots:-animate(Q, [p, range = 0 .. 50], p = 0 .. 1, trace = 24);
n := 4;
s := unapply(add(g[k](t)*p^k, k = 0 .. n), t);
e := unapply(add(h[k](t)*p^k, k = 0 .. n), t);
i := unapply(add(i[k](t)*p^k, k = 0 .. n), t);
r := unapply(add(j[k](t)*p^k, k = 0 .. n), t);
Error, (in i[0]) too many levels of recursion
DE1 := series(eval(ode1, {E = e, I = i, R = r, S = s}), p = 0, n + 1);
DE2 := series(eval(ode2, {E = e, I = i, R = r, S = s}), p = 0, n + 1);
DE3 := series(eval(ode3, {E = e, I = i, R = r, S = s}), p = 0, n + 1);
DE4 := series(eval(ode4, {E = e, I = i, R = r, S = s}), p = 0, n + 1);
Error, (in i[0]) too many levels of recursion
Error, (in i[0]) too many levels of recursion
Error, (in i[0]) too many levels of recursion
Error, (in i[0]) too many levels of recursion
M := eval([ibvc], {E(0) = e(0), I(0) = i(0), R(0) = r(0), S(0) = s(0)});
Error, (in i[0]) too many levels of recursion

Page 1 of 1