HaHu

15 Reputation

One Badge

5 years, 213 days

MaplePrimes Activity


These are questions asked by HaHu

Dears, 

Can you look the code bellow and send me my error please? I used Maple 18.

restart;
with(plots);
theta(t) = 19.592+1.2697*cos(.5240*t+4.3391)-.6343*cos((2*.5240)*t-.6963);
omicron(t) = 99.4876+89.8581*cos(.5232*t+15.4500)+19.1069*sin((2*.5232)*t)-8.5891*cos((3*.5232)*t+3.7723)+6.4660*sin((5*.5232)*t);
`ϕ`(theta):=0.000203*theta*(theta - 11.7)*sqrt(42.3-theta);
mu[v](theta,omicron):=0.0886*exp(((0.01*omicron +1.01*theta  -21.211)/(14.852))^(4));
p[0](theta):=(-0.153* theta*theta + 8.61*theta - 97)/(mu[v](theta,omicron)):
p[2](omicron):=(4*0.25)/(2500)*omicron*( 50 -omicron);
p[3](omicron):=(4*0.75)/(2500)*omicron*( 50 -omicron);
p[2](theta):=exp (0.06737 - 0.00554*theta);
theta[EA](theta):=1/(-0.00094*theta*theta + 0.049*theta - 0.552);
L[v](theta,omicron):=(3.375*(4*omicron*(50-omicron))^(3)*exp(0.0054*theta+0.6737))/(50^(6)*(2+(0.00554*theta-0.06737)^(-1)));
eta(theta,omicron):=(p[0](theta)*p[1](omicron)*p[2](omicron)*p[3](omicron)*p[2](theta))/(theta[EA](theta));
lambda[v] := beta[v]*`ϕ`(theta)*i[v](t)/n[h](t);
lambda[h] := (beta[h]*`ϕ`(theta)*i[h](t)+beta[h]*`ϕ`(theta)*omega*r[h](t))/n[h](t);
n[v](t):=s[v](t)+i[v](t);
beta[h] := 0.9e-1; beta[v] := 0.2e-1; Lambda[h] := .50; sigma[1] := 0.15e-1; sigma[2] := 0.71e-1; Omega[h] := .50; mu[h] := 0.128e-1; delta[h] := .45; k[v] := .66; omega := .3; mu[d] := 0.14e-2;
sys := {diff(i[h](t), t) = Omega[h]+sigma[2]*r[h](t)+lambda[v]*s[h](t)-(delta[h]+mu[d]+mu[h])*i[h](t), diff(i[v](t), t) = lambda[h]*s[v](t)-mu[v](theta, omicron)*i[v](t), diff(j[v](t), t) = L[v](theta, omicron)*(1-j[v](t)/k[v])*n[v](t)-(eta(theta, omicron)+mu[j](theta, omicron))*j[v](t), diff(r[h](t), t) = delta[h]*i[h](t)-(sigma[1]+sigma[2]+mu[h])*r[h](t), diff(s[h](t), t) = Lambda[h]+sigma[1]*r[h](t)-(lambda[v]+mu[h])*s[h](t), diff(s[v](t), t) = eta(theta, omicron)*j[v](t)-(lambda[h]+mu[v](theta, omicron))*s[v](t), i[h](0) = 100, i[v](0) = 100, j[v](0) = 200, r[h](0) = 0, s[h](0) = 10000, s[v](0) = 5000};
p1 := dsolve(sys, numeric, method = rkf45, output = procedurelist);
Error, (in dsolve/numeric/process_input) input system must be an ODE system, found {mu[j](theta, omicron), mu[v](theta, omicron)}
p1o := odeplot(p1, [theta, omicron, i[h](t)], 0 .. 10, numpoints = 100, labels = ["Time (Days)", " infectious population"], labeldirections = [horizontal, vertical], style = line, color = red, axes = boxed, legend = [front, rear, ideal]);

I an unable to prot the optimal  control function and the controls individualy for the diterministic mathematical model with an two or more optimal control. May  any one can give me a sample program on it. Such us the following figure

You may give me direction even.

Dear Brothers and Sisters,

I faced warnning while simulating the code below was running

restart;
with(plots);
beta := 0.143e-1; delta := 0.7e-1; PI := 2.5; mu := 0.16e-1; tau := .7; rho := 0.4e-3; epsilon := .15; sigma[2] := 0.2e-1; sigma[1] := 0.1e-3; eta := 0.1e-1;
a[1] := 2; a[2] := 5; w[1] := 10; w[2] := 50; w[3] := 20; T := 4;


u[1] := min(max(0, z), 1); z := beta*(1-u[3])*s(t)*(sigma[2]*e(t)+sigma[1]*i[t])*(lambda[2](t)-lambda[1](t))/w[1]; u[2] := min(max(0, c), 1); c := (lambda[2](t)*e(t)+beta*i(t)+lambda[4](t)*((1-tau)*delta*e(t)+epsilon*i(t))+lambda[3](t)*(delta*tau*e(t)+epsilon*i(t)))/w[2]+lambda[2](t)*e(t)/w[2]; u[3] := min(max(0, e), 1); e := (beta*(1-u[1])*s(t)*sigma[2]*e(t)+sigma[1]*i[t])/w[3];
Error, recursive assignment

sys := diff(s(t), t) = PI+eta*r(t)-((1-u[1])*(1-u[1]))*beta*(sigma[1]*i(t)+sigma[2]*e(t))*s(t)-mu*s(t), diff(e(t), t) = (((1-u[1])*(1-u[1]))*beta*beta)*(sigma[1]*i(t)+sigma[2]*e(t))*s(t)-(u[2]+u[3]+delta+mu)*e(t), diff(i(t), t) = (1-u[2])*tau*delta*e(t)-(u[2]+u[3]+epsilon+rho+mu)*i(t), diff(r(t), t) = (1-u[2])*(1-tau)*delta*e(t)+(1-u[2])*epsilon*i(t)-(mu+eta)*r(t), diff(lambda[1](t), t) = lambda[1]*((1-u[3])*(1-u[1])*beta*(e*sigma[2]+i*sigma[1])-mu)-lambda[2]*(1-u[3])*(1-u[1])*beta*(e*sigma[2]+i*sigma[1]), diff(lambda[2](t), t) = -a[1]+lambda[1]*((1-u[3])*(1-u[1])*beta*sigma[2]*s-lambda[2]*(1-u[3])*(1-u[1])*beta*sigma[2]*s-u[2]-u[3]-delta-mu)-lambda[3]*(1-u[2])*tau*delta-lambda[4]*(1-u[2])*(1-tau)*delta, diff(lambda[3](t), t) = -a[2]+lambda[1]*(1-u[3])*(1-u[1])*beta*sigma[1]*s-lambda[2]*(1-u[3])*(1-u[1])*beta*sigma[1]*s+lambda[3]*(u[2]+u[3]+epsilon+rho+mu)-lambda[4]*(1-u[2])*epsilon, diff(lambda[4](t), t) = -lambda[1]*eta+lambda[4]*(mu+eta), s(0) = 1000000, e(0) = 1000, i(0) = 89, r(0) = 16, lambda[1](T) = 0, lambda[2](T) = 0, lambda[3](T) = 0, lambda[4](T) = 0;
p1 := dsolve({sys}, type = numeric, method = bvp[midrich], abserr = .1);
Error, (in dsolve/numeric/bvp/convertsys) e(t) and e cannot both appear in the given ODE
p2o := odeplot(p1, [t, i(t)], 0 .. 2, numpoints = 100, labels = ["Time (months)", "i"], labeldirections = [horizontal, vertical], style = line, color = red, axes = boxed);
Error, (in plots/odeplot) input is not a valid dsolve/numeric solution
plots[display](p2o);

 

May I get your help please? Thank you in advance. Lokking forward...

 

     Dear Sir/Madam,

I have faced a problem while using Maple 18. The  warning is the following

Warning, The use of global variables in numerical ODE problems is deprecated, and will be removed in a future release. Use the 'parameters' argument instead (see ?dsolve,numeric,parameters)

This is the code

restart;
with(plots);
beta := 0.2e-1; delta := .5; PI := 10000; mu := 0.16e-1; tau := 0.3e-1; rho := 0.4e-1; epsilon := 0.4e-1; sigma[1] := 0.1e-2; sigma[2] := 0.2e-2; eta := 0.6e-1;
sys := {diff(e(t), t) = beta*(sigma[1]*i(t)+sigma[2]*e(t))*s(t)-(delta+mu)*e(t), diff(i(t), t) = tau*delta*e(t)-(epsilon+rho+mu)*i*t, diff(r(t), t) = (1-tau)*delta*e(t)+epsilon*i(t)-(mu+eta)*r(t), diff(s(t), t) = PI+eta*r(t)-beta*(sigma[1]*i(t)+sigma[2]*e(t))*s(t)-mu*s(t), e(0) = 148, i(0) = 74, r(0) = 14, s(0) = 4110};
p1 := dsolve(sys, numeric, method = rkf45, output = procedurelist);
Warning, The use of global variables in numerical ODE problems is deprecated, and will be removed in a future release. Use the 'parameters' argument instead (see ?dsolve,numeric,parameters)
Error, (in dsolve/numeric) i(t) and i cannot both appear in the given ODE
p2o := odeplot(p1, [t, s(t)], 0 .. 4, numpoints = 100, labels = ["Time (months)", " Infected  "], labeldirections = [horizontal, vertical], style = line, color = red, axes = boxed);
Error, (in plots/odeplot) input is not a valid dsolve/numeric solution

plots[display](p2o);

 

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/nnn.mw .

Download nnn.mw

Hello Dear Brothers and Sistors,

Can you help me giving a maple program to plot cost function  of a an optimal control modeling ?

Looking forward.

Regards,

1 2 Page 1 of 2