MaplePrimes Questions

To restrict the domain of a vector field, I have multiplied a coordinate with a non-real complex number (namely a sqrt(of negative expression)). This does work, as shown in this Maple 2017 worksheet program (below). My question is whether this is the best technique of accomplishing this result, or else how to do it better? Would be interested in suggestions for improvements. Here is my program so far:

restart;
#
with(plots):
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(` Vector Field inside Torus`);
print(` ------- ------- ------- ------- ------- ------- -------`);
print(` Assignment:  `);
print(` In a circular pipe of radius (my2r), water is flowing in the direction `);
print(` of the pipe, with speed (my2r)^2-(mya)^2, where (mya) is the distance  `);
print(` to the axis of the pipe.  `);
print(` Depict the vector field describing the flow if the pipe goes around in `);
print(` the shape of a torus with major radius (my1r).  `);
print(`   `);
print(`   `);
print(`   `);
print(` ------- ------- ------- ------- ------- ------- -------`);
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 1) major radius of torus:`);
#
my1r  := 5;     
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 2) minor radius of torus (pipe radius):`);
#
my2r := 4; 
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 3) definition of torus (polar coordinates):`);
#
c00 := [(my1r+my2r*cos(s))*cos(t),(my1r+my2r*cos(s))*sin(t),my2r*sin(s)];
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 4) 3D plot of solid torus (polar coordinates):`);
#
plot3d({c00},scaling=constrained,color=red);
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 5) 3D plot of wireframe torus (polar coordinates):`);
#
P1 := plot3d({c00},scaling=constrained,style=wireframe);
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 6) implicit definition of torus (cartesian coordinates):`);
#
c01 := (sqrt(x^2+y^2)-my1r)^2+z^2-my2r^2;
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 7) implicit 3D plot of solid torus (cartesian coordinates):`);
#
gx := my1r+my2r; # min and max of each coordinate
#
implicitplot3d(c01,x=-gx..gx,y=-gx..gx,z=-gx..gx,numpoints=9000);
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 8) vector field definition (cartesian coordinates):`);
#
my1vfx := -y;
my1vfy := x;
my1vfz := 0;
#
my1fld := [my1vfx,my1vfy,my1vfz];
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 9) 3D plot of vector field (cartesian coordinates):`);

#
fieldplot3d(my1fld,x=-gx..gx,y=-gx..gx,z=-gx..gx);
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 10) definition of vector field with unit length vectors (cartesian coordinates):`);
#
my1vl := sqrt(my1vfx^2+my1vfy^2+my1vfz^2); # vector length
#
my2fld := [my1vfx/my1vl,my1vfy/my1vl,my1vfz/my1vl];
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 11) 3D plot of vector field with unit length vectors (cartesian coordinates):`);
#
fieldplot3d(my2fld,x=-gx..gx,y=-gx..gx,z=-gx..gx);
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 12) definition of vector field with asked for length vectors (cartesian coordinates):`);
#
mya := sqrt((sqrt(x^2+y^2)-my1r)^2+z^2);
c01r := sqrt(my2r^2-mya^2); # also used for domain restricting vector field below
#
my1tsz := solve([c01],[z]);
#
assign(my1tsz[1][1]);
my1tz := z;
unassign('z');
#
assign(my1tsz[2][1]);
my2tz := z;
unassign('z');
#
my1vp := c01r/my2r; # vector length (maximum one unit)
#
my3fld := [my1vp*my1vfx/my1vl,my1vp*my1vfy/my1vl,my1vp*my1vfz/my1vl];
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 13) 3D plot of vector field with asked for length vectors (cartesian coordinates):`);
#
fieldplot3d(my3fld,x=-gx..gx,y=-gx..gx,z=-gx..gx);
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 14) same asked for vector field with 3-D arrow vectors:`);
print(`   `);
print(` (to get this to display properly it was necessary to do:  `);
print(` -> Maple 2017 -> Preferences... -> Precision ->   `);
print(`   [unselect] Limit expression length to   `);
print(`   Apply to Session`);
print(`   `);
#
gr := 15;
#
P3 := fieldplot3d(my3fld,x=-gx..gx,y=-gx..gx,z=-gx..gx,arrows=`3-D`,grid=[gr,gr,gr]);
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n display asked for vector field within wireframe torus:`);
#
display([P1,P3]);
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);

Hi

However I run similar codes in Maple and Matlab, but the different results are observed.

By increasing number of basis (i.e. m) The convergence is observed, but results are different from each other.

The convergence for Maple: (m,P) =(10,10.8154),(20,10.8081),(30,10.8067),(50,10.8061)

The convergence for Matlab: (m,P) =(10,10.0474),(20,10.0194),(30,10.0143),(40,10.0125)

I have two questions:

1-which answer is correct?

2-why the different results for the same  number of basis  are obtained?

 

Maple code (Maple 2016)

restart;

tm := time():

with(LinearAlgebra):

Digits := 500:

beta := 1:

nu := 0.3:

lambda := 2:

G := 5:

ko := .5*0.1e7:

Ec := 0.380e12:

Em := 0.70e11:

ri := 0:

ro := 0.5:

ti := 0.1e-1:

K := 0.4e-1*0.1e10:

n := 1:

m := 20:

alpha := 0.1:

t := ti*(1+alpha*r/ro)^beta:

Er := (Ec-Em)*(r/ro)^n+Em:

W := simplify(add(a[n]*ChebyshevT(n, r), n = 0 .. m)):

sys := {eval(W, r = ro), eval(diff(W, r), r = ri)}:

W := subs(solve(sys, {a[0], a[1]}), W):

d1 := diff(W, r):

d2 := diff(d1, r):

W := subs(solve({eval(ko*d1-Ec*ti^3*(1+alpha)^(3*beta)*(d1*nu+d2*r)/(12*r*(-nu^2+1)), r = ro) = 0}, {a[2]}), W):

d1 := diff(W, r):

d2 := diff(d1, r):

Uf := int(K*(1+lambda*r/ro+G*(r/ro)^2)*W^2*r, r = ri .. ro):

NUM := int(((d2+d1/r)^2-(2*(1-nu))*d2*d1/r)*Er*t^3*r/(12*(-nu^2+1)), r = ri .. ro)+ko*ro*(eval(d1, r = ro))^2+Uf:

DEN := int(d1^2*r, r = ri .. ro):

PT := NUM-Em*ti^3*P*DEN/ro^2:

for c from 3 to m do

eq[c] := diff(PT, a[c]) end do:

MT := GenerateMatrix([seq(eq[j], j = 3 .. m)], [a[j]$j = 3 .. m])[1]:

solve(Determinant(MT)):

evalf[10](%[1]);

____________________________________________________________________________

Matlab Code (R2014a)

clear all;
digits(10);
tic
m = 20;
n = 1;
alpha = 0.1;
beta = 1;
nu = 0.3;
lambda = 2;
G = 5;
ko = 0.5*1e6;
Ec = 0.380e12;
Em = 0.70e11;
ro = 0.5;
ti = 0.1e-1;
K = 0.04*0.1e10;
ri=0;
syms r P;
c=sym('c%d',[1,m+1]);
c(1)=1;
c(2)=r;
for j=3:m+1
    c(j)=simplify(2*r*c(j-1)-c(j-2));
end
Er = (Ec-Em)*(r/ro)^n+Em;
a=sym('a%d',[1,m+1]);
t = ti*(1+alpha*r/ro)^beta;
W = simplify(a*transpose(c));
[a(1),a(2)] = solve(subs(W,r,ro)==0,subs(diff(W,r),r,ri)==0,a(1),a(2));
W = simplify(a*transpose(c));
d1 = diff(W, r);
d2 = diff(d1, r);
a(3)=solve(subs(ko*d1-Ec*ti^3*(1+alpha)^(3*beta)*(d1*nu+d2*r)/(12*r*(-nu^2+1)),r,ro)==0,a(3));
W = simplify(a*transpose(c));
d1 = diff(W, r);
d2 = diff(d1, r);
Uf = int(K*(1+lambda*r/ro+G*(r/ro)^2)*W^2*r,r,ri,ro);
NUM = int(((d2+d1/r)^2-(2*(1-nu))*d2*d1/r)*Er*t^3*r/(12*(-nu^2+1)),r,ri,ro)+ko*ro*(subs(d1,r,ro))^2+Uf;
DEN = int(d1^2*r, r , ri , ro);
PT = NUM-Em*ti^3*P*DEN/ro^2;
for q=1:m-2
    eq(q)= diff(PT, a(q+3));
end;
for q = 1:m-2
    for u = 1:m-2
        T = coeffs(eq(q),a(u+3));
        tt(q,u) = T(2);
    end;
end;
F=sort(vpa(solve(det(tt))));
F(1)
toc

___________________________________________________________

how to find infinity norm for function of fraction exponenctial

I am wanting to plot a phase portrait of du/dt against u.

 

I have attempted to draw this on maple however am having great difficulty. Can anyone recommend what I may be doing wrong or how I should go about doing this?

Load the Tetrads package, and choose Schwarzshild spacetime:

with(Physics):
with(Tetrads):
Setup(metric = schwarzschild,quiet):

Consider then the following code/output:

expr := D_[~mu](e_[mu,a]);
seq(simplify(SumOverRepeatedIndices(expr             )),a = 1..4);
seq(simplify(SumOverRepeatedIndices(D_[~mu](e_[mu,a]))),a = 1..4);

In my mind, the last two code lines are entirely identical, but their corresponding outputs are certainly not. I don't get it. The above can be compared with the following code/output in which the vierbein indices mu and a have been interchanged:

expr := D_[~mu](e_[a,mu]);
seq(simplify(SumOverRepeatedIndices(expr             )),a = 1..4);
seq(simplify(SumOverRepeatedIndices(D_[~mu](e_[a,mu]))),a = 1..4);

Here, the outputs are identical. The mystery becomes total when realizing that according to Maple, e_[a,mu] and e_[mu,a] are considered completely identical [a notational choice I do not find reassuring].

 

I've been doing some soul searching and started to think that the maple interface and i are kindred spirts, conjoined spirit twins if you will, and i can confirm this if this is the manner in which the totient function is calculated:

 

For example how to input the mixed fraction 3 1/7? What are keys for super- and subscript?

I've keep checking in every 18 months or so for the last 10 years... since Maple got a sort-of-notebook interface. I keep hopeing for a MathCad-like true notebook, where I can organize my document the way I want, instead of the clunky console I/O based interface. But every time I check, its not quite there.

 

Are we there yet?

I got decimal places problem,

not known correct or not

the value are different but difference is constant 

i do not know how many places needed to get exact result

i do not believe the difference is constant

because the matrix are different

but even if using 36 decimal places still constant, 

i notice increasing decimal places , the constant difference is changed

is it possible  to output fraction when calculate eigenvector?

Partial_for_R0.mw
Anybody knows what happen to this coding?

restart

unprotect(Pi)

k := .5;

.5

 

.95

 

0.1e-1

 

116.1

 

0.8e-2

 

0.25e-2

 

0.2e-2

 

0.5e-1

 

0.115e-1

 

0.598e-2

 

.5

 

.2

 

.1

 

0.57e-1

 

.2

 

1.2

(1)

R := k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(vartheta+mu+phi))+epsilon*Pi*(mu*p+vartheta)/(mu*(vartheta+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q))

65688.31239

(2)

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), k)

Error, invalid input: diff received .5, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), `ε`)

Error, invalid input: diff received 0.2e-2, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), tau)

Error, invalid input: diff received .95, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), phi)

Error, invalid input: diff received 0.25e-2, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), chi)

Error, invalid input: diff received 0.598e-2, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), p)

Error, invalid input: diff received .2, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), `ϑ`)

Error, invalid input: diff received 0.8e-2, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), mu)

Error, invalid input: diff received 0.1e-1, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), alpha)

Error, invalid input: diff received 0.57e-2, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), rho)

Error, invalid input: diff received 0.5e-1, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), beta)

Error, invalid input: diff received 0.115e-1, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), eta)

Error, invalid input: diff received .2, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), q)

Error, invalid input: diff received .5, which is not valid for its 2nd argument

 

NULL

NULL


 

Download Partial_for_R0.mw
 

restart

unprotect(Pi)

k := .5;

.5

 

.95

 

0.1e-1

 

116.1

 

0.8e-2

 

0.25e-2

 

0.2e-2

 

0.5e-1

 

0.115e-1

 

0.598e-2

 

.5

 

.2

 

.1

 

0.57e-1

 

.2

 

1.2

(1)

R := k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(vartheta+mu+phi))+epsilon*Pi*(mu*p+vartheta)/(mu*(vartheta+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q))

65688.31239

(2)

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), k)

Error, invalid input: diff received .5, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), `ε`)

Error, invalid input: diff received 0.2e-2, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), tau)

Error, invalid input: diff received .95, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), phi)

Error, invalid input: diff received 0.25e-2, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), chi)

Error, invalid input: diff received 0.598e-2, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), p)

Error, invalid input: diff received .2, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), `ϑ`)

Error, invalid input: diff received 0.8e-2, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), mu)

Error, invalid input: diff received 0.1e-1, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), alpha)

Error, invalid input: diff received 0.57e-2, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), rho)

Error, invalid input: diff received 0.5e-1, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), beta)

Error, invalid input: diff received 0.115e-1, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), eta)

Error, invalid input: diff received .2, which is not valid for its 2nd argument

 

diff(k*tau*(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))*(Pi*(-mu*p+mu+phi)/(mu*(`ϑ`+mu+phi))+`ε`*Pi*(mu*p+`ϑ`)/(mu*(`ϑ`+mu+phi)))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q)), q)

Error, invalid input: diff received .5, which is not valid for its 2nd argument

 

NULL

NULL


 

Download Partial_for_R0.mw

 

 

Basic_Reproduction_Number.mw
Hello, anybody knows how to compute sensitivity analysis for basic reproduction number using Maple coding? By taking the partial derivatives of all the parameters involved in the basic reproduction number using normalised forward sensitivity index formula. Thanks.

restart

unprotect(Pi)

R[0] := k*tau*[(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q))]*(Pi*(-mu*p+mu+phi)/(mu*(vartheta+mu+phi))+epsilon*Pi*(mu*p+vartheta)/(mu*(vartheta+mu+phi)))

k*tau*[(rho*(Upsilon*(mu+alpha+eta)+chi)+(1-rho)*(Upsilon*(1-q)*eta+mu+beta+chi))/((mu+beta+chi)*(mu+alpha+eta)-chi*eta*(1-q))]*(Pi*(-mu*p+mu+phi)/(mu*(vartheta+mu+phi))+epsilon*Pi*(mu*p+vartheta)/(mu*(vartheta+mu+phi)))

(1)

``


 

Download Basic_Reproduction_Number.mw

 

I am having difficulties with a recursive function call with named parameters.

The proc is defind as follows:

Subs:=proc(eqn::seq(equation),elemt::Element,{num::boolean:=false},$) option remember;
...
qs[i]=Subs(eqn,elemt[qs[i]]); # This is where I need to add something like 'num'=num
...
end proc;

My difficulty is with the "num" flag. In the code this flag governs whether to try to evalf() certain results or not. That and the recursion per se all works. What does not work is when I add the num option to the internal call. I have been trying 'num'=num, ''num''=num, "num"=num and `num`=num.  I either get an error that something like true=true is not a valid argument here, or that "num" is not valid.

Any hint?

Thanks,

Mac Dude

Let G be a permutation group like S3. I have a loop in which x runs over the elements of this group.

When I ask the cycle type of x or the number of orbits of x, Maple gives an incorrect result in some cases. This is because when x=(12), for example, Maple considers x to be an element of the permutation group S2 instead of S3, i.e. it fails to understand that (12) should really be (12)(3) in this case.

Is there a way I can instruct Maple to consider the permutation (12) as a member of S3 instead of S2? 

I am posting the code as requested. Something like this:

with(GroupTheory);

for x in Elements(S3) do print(x, numelems(Orbits(PermutationGroup(x)))) end do;

(I don't know how to format this, sorry)

This code is simply asking how many orbits exist in the action of each element of S3. The result will be 1 for x=(12), however, because Maple will assume that (12) is acting on the set {1,2}, even though I am considering (12) as an element of S3. I want it to consider (12)=(12)(3) and let it act on the set {1,2,3}, thereby producing 2 orbits, not 1.

Ok embarassing I posted this one and now it outputs this java error file log and yep i dont know that much about java at all. 

 

Sometimes it works, sometimes it closes maple automatically and spits out the .txt error log i have attached if thats any help... MAPLE_EXAMPLE_16.mw  i honestly have never ever seen maple behave this way in more than a decade of playing around in it with stuff like this.

EDIT: Here is a version with smaller plot components that seems to be working.... MAPLE_EXAMPLE_17.mw

It says i am not allowed to upload a log file but this is what it looks like:

#
# A fatal error has been detected by the Java Runtime Environment:
#
# java.lang.OutOfMemoryError: requested 1024000 bytes for GrET in C:\BUILD_AREA\jdk6_18\hotspot\src\share\vm\utilities\growableArray.cpp. Out of swap space?
#
 
V  [jvm.dll+0x15df8a]
V  [jvm.dll+0x1e1e14]
V  [jvm.dll+0x1a1aad]
V  [jvm.dll+0xc834f]
V  [jvm.dll+0xca01c]
V  [jvm.dll+0xca370]
V  [jvm.dll+0xce42a]
V  [jvm.dll+0x1d8592]
V  [jvm.dll+0xc9398]
V  [jvm.dll
Java Threads: ( => current thread )
  0x522e7c00 JavaThread "Timer-28" [_thread_blocked, id=23236, stack(0x5f2f0000,0x5f6f0000)]
  0x522e7400 JavaThread "Timer-22" [_thread_blocked, id=24248, stack(0x6b440000,0x6b840000)]
  0x522e2c00 JavaThread "WMI:MapleClientSocket:Kernel Connection " daemon [_thread_blocked, id=11140, stack(0x6a2d0000,0x6a6d0000)]
  0x522e7000 JavaThread "WMI:MapleClientSocket:Kernel Connection " daemon [_thread_blocked, id=6792, stack(0x64d30000,0x65130000)]
  0x522e6400 JavaThread "WMI:MapleClientSocket:Kernel Connection " daemon [_thread_blocked, id=20280, stack(0x6a6d0000,0x6aad0000)]
  0x522e4400 JavaThread "Timer-18" daemon [_thread_blocked, id=23888, stack(0x63f20000,0x64320000)]
  0x522e6800 JavaThread "Timer-17" [_thread_blocked, id=17320, stack(0x69ed0000,0x6a2d0000)]
  0x522e5000 JavaThread "WMI:MapleClientSocket:Kernel Connection " daemon [_thread_blocked, id=13480, stack(0x69ad0000,0x69ed0000)]
  0x522e4800 JavaThread "Timer-16" daemon [_thread_blocked, id=18184, stack(0x68ed0000,0x692d0000)]
  0x522e3000 JavaThread "Timer-15" [_thread_blocked, id=23296, stack(0x692d0000,0x696d0000)]
  0x522e3800 JavaThread "WMI:MapleClientSocket:Kernel Connection " daemon [_thread_blocked, id=16388, stack(0x66820000,0x66c20000)]
  0x522e1400 JavaThread "Timer-14" daemon [_thread_blocked, id=24500, stack(0x61c50000,0x62050000)]
  0x522e0c00 JavaThread "Timer-13" [_thread_blocked, id=15848, stack(0x659b0000,0x65db0000)]
  0x522e0000 JavaThread "WMI:MapleClientSocket:Kernel Connection " daemon [_thread_blocked, id=7260, stack(0x655b0000,0x659b0000)]
  0x466cb000 JavaThread "Timer-12" daemon [_thread_blocked, id=1112, stack(0x64320000,0x64720000)]
  0x4699b800 JavaThread "Timer-11" [_thread_blocked, id=24540, stack(0x64930000,0x64d30000)]
  0x4699b400 JavaThread "Timer-10" daemon [_thread_blocked, id=21144, stack(0x60bf0000,0x60ff0000)]
  0x4699d400 JavaTh
 
First 865 866 867 868 869 870 871 Last Page 867 of 2434