Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

 

Minimize the number of tensor components according to its symmetries
(and relabel, redefine or count the number of independent tensor components)

 

 

The nice development described below is work in collaboration with Pascal Szriftgiser from Laboratoire PhLAM, Université Lille 1, France, used in the Mapleprimes post Magnetic traps in cold-atom physics

 

A new keyword in Define  and Setup : minimizetensorcomponents, allows for automatically minimizing the number of tensor components taking into account the tensor symmetries. For example, if a tensor with two indices in a 4D spacetime is defined as antisymmetric using Define with this new keyword, the number of different tensor components will be exactly 6, and the elements of the diagonal are automatically set equal to 0. After setting this keyword to true with Setup , all subsequent definitions of tensors automatically minimize the number of components while using this keyword with Define  makes this minimization only happen with the tensors being defined in the call to Define .

 

Related to this new functionality, 4 new Library routines were added: MinimizeTensorComponents, NumberOfIndependentTensorComponents, RelabelTensorComponents and RedefineTensorComponents

 

Example:

restart; with(Physics)

 

Define an antisymmetric tensor with two indices

Define(F[mu, nu], antisymmetric)

`Defined objects with tensor properties`

 

{Physics:-Dgamma[mu], F[mu, nu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu]}

(1.1)

Although the system knows that F[mu, nu] is antisymmetric, you need to use Simplify to apply the (anti)symmetry

F[mu, nu]+F[nu, mu]

F[mu, nu]+F[nu, mu]

(1.2)

 

Simplify(F[mu, nu]+F[nu, mu])

0

(1.3)

so by default the components of F[mu, nu] do not automatically reflect the (anti)symmetry; likewise

F[1, 2]+F[2, 1]

F[1, 2]+F[2, 1]

(1.4)

Simplify(F[1, 2]+F[2, 1])

0

(1.5)

and computing the array form of F[mu, nu]we do not see the elements of the diagonal equal to zero nor the lower-left triangle equal to the upper-right triangle but for a different sign:

TensorArray(F[mu, nu])

Matrix(%id = 18446744078270093062)

(1.6)

 

On the other hand, this new functionality, here called minimizetensorcomponents, makes the symmetries of the tensor be explicitly reflected in its components.

 

There are three ways to use it. First, one can minimize the number of tensor components of a tensor previously defined. For example

 

Library:-MinimizeTensorComponents(F)

Matrix(%id = 18446744078270064630)

(1.7)

After this, both (1.2) and (1.3) are automatically equal to 0 without having to use Simplify

F[mu, nu]+F[nu, mu]

0

(1.8)

0

0

(1.9)

And the output of TensorArray  in (1.6) becomes equal to (1.7).

 

NOTE: in addition, after using minimizetensorcomponents in the definition of a tensor, say F, all the keywords implemented for Physics tensors are available for F:

 

F[]

F[mu, nu] = Matrix(%id = 18446744078247910206)

(1.10)

F[trace]

0

(1.11)

F[nonzero]

F[mu, nu] = {(1, 2) = F[1, 2], (1, 3) = F[1, 3], (1, 4) = F[1, 4], (2, 1) = -F[1, 2], (2, 3) = F[2, 3], (2, 4) = F[2, 4], (3, 1) = -F[1, 3], (3, 2) = -F[2, 3], (3, 4) = F[3, 4], (4, 1) = -F[1, 4], (4, 2) = -F[2, 4], (4, 3) = -F[3, 4]}

(1.12)

"F[~1,mu,matrix]"

F[`~1`, mu] = Vector[row](%id = 18446744078247885990)

(1.13)

Alternatively, one can define a tensor, specifying that the symmetries should be taken into account to minimize the number of its components passing the keyword minimizetensorcomponents to Define .

 

Example:

 

Define a tensor with the symmetries of the Riemann  tensor, that is, a tensor of 4 indices that is symmetric with respect to interchanging the positions of the 1st and 2nd pair of indices and antisymmetric with respect to interchanging the position of its 1st and 2nd indices, or 3rd and 4th indices, and define it minimizing the number of tensor components

 

Define(R[alpha, beta, mu, nu], symmetric = {[[1, 2], [3, 4]]}, antisymmetric = {[1, 2], [3, 4]}, minimizetensorcomponents)

`Defined objects with tensor properties`

 

{Physics:-Dgamma[mu], F[mu, nu], Physics:-Psigma[mu], R[mu, nu, alpha, beta], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu]}

(1.14)

We now have

R[1, 2, 3, 4]+R[2, 1, 3, 4]

0

(1.15)

R[alpha, beta, mu, nu]-R[mu, nu, alpha, beta]

0

(1.16)
• 

One can always retrieve the symmetry properties in the abstract notation used by the Define command using the new Library:-GetTensorSymmetryProperties, its output is ordered, first the symmetric then the antisymmetric properties

 

Library:-GetTensorSymmetryProperties(R)

{[[1, 2], [3, 4]]}, {[1, 2], [3, 4]}

(1.17)
• 

After making the symmetries explicit (and also before that), it is frequently useful to know the number of independent components of a given tensor. For this purpose you can use the new Library:-NumberOfIndependentTensorComponents

 

Library:-NumberOfIndependentTensorComponents(R)

21

(1.18)

and besides taking into account the symmetries, in the case of the Riemann  tensor, after taking into account the first Bianchi identity this number of components is further reduced to 20.

 

A third way of using the new minimizetensorcomponents functionality is using Setup , so that, automatically, every subsequent definition of tensors with symmetries is performed minimizing the number of its components using the indicated symmetries

 

Example:

Setup(minimizetensorcomponents = true)

[minimizetensorcomponents = true]

(1.19)

So from hereafter you can define tensors taking into account their symmetries explicitly and without having to include the keyword minimizetensorcomponents at each definition

 

Define(C[alpha, beta], antisymmetric)

`Defined objects with tensor properties`

 

{C[mu, nu], Physics:-Dgamma[mu], F[mu, nu], Physics:-Psigma[mu], R[mu, nu, alpha, beta], Physics:-d_[mu], Physics:-g_[mu, nu], Physics:-KroneckerDelta[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu]}

(1.20)

 

C[]

C[mu, nu] = Matrix(%id = 18446744078408747598)

(1.21)
• 

Two new related functionalities are provided via Library:-RelabelTensorComponents and Library:-RedefineTensorComponent, the first one to have the number of tensor components directly reflected in the names of the components, the second one to redefine only one of these components

Library:-RelabelTensorComponents(C)

Matrix(%id = 18446744078408729774)

(1.22)

 

Suppose now we want to make one of these components equal to 1, say C__2

Library:-RedefineTensorComponent(C[1, 2] = 1)

C[mu, nu] = Matrix(%id = 18446744078270104390)

(1.23)

This nice development is work in collaboration with Pascal Szriftgiser from Laboratoire PhLAM, UMR CNRS 8523, Université Lille 1, F-59655, France.

``

 

Download MinimizeTensorComponents.mw

 

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

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 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
 

Hi. I have an excel data file.

IDEALLY, I want to import the results of the formula in cells C3:C7.

But it doesn't like it. Reports 0's

When I convert the range to result to values in cells D3:D7 it imports no problem. But I don't want to do this step.

any ideas?

Book1.xls

import.mw

 

 

 

Lett_L_rot_AL_MapleQuestion.mws

If the attached program is run, at the end are two animation outputs.  One is of two letters A; the other of the single second A being animated.   The second letter A animation works fine, but in the former it "blips" on Continuous animation, and on 'single cycle' the A totally disappears.  I'm using the same number of frames, 48, for each. 
   Prior to that is the letter L which is meant to give the illusion of it rotating, and the letters A getting out of the way.

   Any help on ridding the "blip" most appreciated. 

First 844 845 846 847 848 849 850 Last Page 846 of 2219