Maple 2018 Questions and Posts

These are Posts and Questions associated with the product, Maple 2018

Why can't maple integrate

restart;
`assuming`([int(GAMMA(a, s)*exp(-b*s), s = 0 .. infinity)], [b > 0, a > 0])

which has a simple result obtained by partial integration?

Is het possible to use the circletimes symbol  ⊗ from Maple's Operators palette as an alias for KroneckerProduct(A,B)?

Instead of KroneckerProduct(A,B) :  A ⊗ B

An abbriviation would be convenient for the following expression:

A ⊗ B ⊗ C ⊗ D ⊗ E ⊗ F ⊗ G

 

I tried alias, macro, applyrule but was not successfull.

Is is possible or should I add it to the Maple 2019 wishlist?

Harry

 

I vaguely recall others complain about disappearing Code Edit Regions. Does anyone else recall that? I had one disappear from the very top of the attached worksheet (right after the restart), causing me to lose about 15-30 minutes of work. I've totally recreated the work, so I have no interest in this worksheet being repaired. I'm merely posting it in case anyone wants to do an autopsy on it.

Another issue that happened twice with this worksheet is that when I unchecked the "Expanded" box on the Code Edit Region menu (pull out from the right side of the screen) and copied the text to my clipboard (for posting on MaplePrimes), that copied text was missing my most-recent changes to the code. They reappeared when I expanded again. (But it's really difficult to copy-and-paste a multi-screen Code Edit Region when it's expanded.)

My final issue (and this has bothered me for years), is how the heck are you supposed to find the line with the syntax error in a several-hundred-line Code Edit Region? Unlike with inline code, the cursor is not placed near the error location._Binomial_missing_Code_region.mw

how I can determined time period?

thank you

period.mw
 

d := (10+20*cos(Omega*t)+30*cos(9*sqrt(2)*t))^2

(10+20*cos(Omega*t)+30*cos(9*2^(1/2)*t))^2

(1)

with(StringTools)

period(d)

period((10+20*cos(Omega*t)+30*cos(9*2^(1/2)*t))^2)

(2)

``


 

Download period.mw

 

Hi,

this "sum(1/(1+x)^t, t=1..infinity)" is (in my opionon) one of the most standard infinity summation and has the closed form 1/x. 
i used maple 18 and it was executed and i got the closed form 1/x.

with maple 2018 i get the non executed form, also the same inert form as "Sum(1/(1+x)^t, t=1..infinity)".

if i try "sum(1/(1+2)^t, t=1..infinity)" i get 1/2 as result.

why does the version above not working? any ideas?

thank you.

This may seem a bit trivial, but I prefer f'(x) to writing diff(f(x),x) in 1D input. How to achieve?

differential.mw


 

15

 

"maple init loaded..."

(1)

In Document mode, this works fine.

f := proc (x) options operator, arrow; x^2 end proc

proc (x) options operator, arrow; x^2 end proc

(2)

diff(f(x), x)

2*x

(3)

But I mainly use Worksheet (1D) mode, and I can't seem to acheve the same, without using diff(f(x),x)

``

f:x->x^2

proc (x) options operator, arrow; x^2 end proc

(4)

f'(x)

Error, unexpected single forward quote

 

``


 

Download differential.mw

 

i want to gain diff(p(t), t) and diff(q(t), t) and Jacobian matrix
 according to the attached pdf file.

please help me.

thanks

simplify.mw
 

k := diff(a(t), t) = -mu*a(t)-(1/4)*alpha6*a(t)*sin(gamma(t))

diff(a(t), t) = -mu*a(t)-(1/4)*alpha6*a(t)*sin(gamma(t))

(1)

j := a(t)*(diff(gamma(t), t)) = 2*a(t)*sigma-(6*(1/8))*(alpha1-alpha2+(1/3)*alpha3)*a(t)^3-(1/2)*alpha6*a(t)*cos(gamma(t))

a(t)*(diff(gamma(t), t)) = 2*a(t)*sigma-(3/4)*(alpha1-alpha2+(1/3)*alpha3)*a(t)^3-(1/2)*alpha6*a(t)*cos(gamma(t))

(2)

"p(t):=a(t)*cos(gamma(t))"

proc (t) options operator, arrow, function_assign; a(t)*cos(gamma(t)) end proc

(3)

"q(t):=a(t)*sin(gamma(t))"

proc (t) options operator, arrow, function_assign; a(t)*sin(gamma(t)) end proc

(4)

diff(p(t), t)

(diff(a(t), t))*cos(gamma(t))-a(t)*(diff(gamma(t), t))*sin(gamma(t))

(5)

(-mu*a(t)-(1/4)*alpha6*a(t)*sin(gamma(t)))*cos(gamma(t))-a(t)*(2*sigma-(6*(1/8))*(alpha1-alpha2+(1/3)*alpha3)*a(t)^2-(1/2)*alpha6*cos(gamma(t)))*sin(gamma(t))

(-mu*a(t)-(1/4)*alpha6*a(t)*sin(gamma(t)))*cos(gamma(t))-a(t)*(2*sigma-(3/4)*(alpha1-alpha2+(1/3)*alpha3)*a(t)^2-(1/2)*alpha6*cos(gamma(t)))*sin(gamma(t))

(6)

diff(p(t), t)

2*t

(7)

``


subs.pdf

Download simplify.mw

 

 

Hi

I am having some trouble with a procedure. One of the procedures arguments is a mathematical function g(var). For simplification lets say I wish to make a procedure which calculates some values of the unknown function, g: 

SomeProc:=proc(g,var:=x)
f(var):=g
return f(2)
end proc

This does not seem to work. No matter what value of var is inserted into f, the return is g(var). 

Any help would be much appreciated:

Hello

I have an expression which invokes the LambertW function.

LambertW(-ln(1+i)*EP*p*(1+i)^(-(365*EP*hr*kw*p+SC*i)/(365*FIT*hr*i*kw*(-1+p)))/(FIT*i*(-1+p)))

I was trying to import this expression into Excel, but my version doesn't have LambertW.

Does someone know an analagous function in a form Excel can compute?

According to wiki The Lambert W relation cannot be expressed in terms of elementary functions.

I have gotten around the problem using Newton-Raphson method, but it takes a few cells to converge....

 

how i can remove root of from result.

I want to plot function.

Thnaks

root_of.mw
 

sigma2 := RootOf(43980465111040000000000000000*sqrt(3)*Pi^25*sqrt(32*Pi^2+2)*sigma+21990232555520000000000000000*sqrt(3)*Pi^23*sqrt(32*Pi^2+2)*sigma-98268851732480000000000000000*sqrt(3)*Pi^21*sqrt(32*Pi^2+2)*sigma-44495861186560000000000000000*sqrt(3)*Pi^19*sqrt(32*Pi^2+2)*sigma+82188225740800000000000000000*sqrt(3)*Pi^17*sqrt(32*Pi^2+2)*sigma+33095407370240000000000000000*sqrt(3)*Pi^15*sqrt(32*Pi^2+2)*sigma-30136000839680000000000000000*sqrt(3)*Pi^13*sqrt(32*Pi^2+2)*sigma-10618895073280000000000000000*sqrt(3)*Pi^11*sqrt(32*Pi^2+2)*sigma+3822293002240000000000000000*sqrt(3)*Pi^9*sqrt(32*Pi^2+2)*sigma+1210118016000000000000000000*sqrt(3)*Pi^7*sqrt(32*Pi^2+2)*sigma+118805400000000000000000000*sqrt(3)*Pi^5*sqrt(32*Pi^2+2)*sigma+5028750000000000000000000*sqrt(3)*Pi^3*sqrt(32*Pi^2+2)*sigma+79101562500000000000000*sqrt(3)*sigma*Pi*sqrt(32*Pi^2+2)+111484894360500000*Pi^2*20^RootOf8+1765920726670320000*Pi^4*20^RootOf8-569534208772147200*Pi^6*20^RootOf8-4505569481375428608*Pi^8*20^RootOf8+972005049637797888*Pi^10*20^RootOf8+5143616921914048512*Pi^12*20^RootOf8-554194415829123072*Pi^14*20^RootOf8-2216777663316492288*Pi^16*20^RootOf8+(-9231519020818020433920000000000*Pi^22+195541371952408496701440000000000*Pi^20+89300299589267320995840000000000*Pi^18-333503605675043554590720000000000*Pi^16-115500365322956203622400000000000*Pi^14+204706142659640339988480000000000*Pi^12+55783620627641021399040000000000*Pi^10-43454880575740151285760000000000*Pi^8-9286786763553830541120000000000*Pi^6-635208422610519981000000000000*Pi^4-16054449064166199375000000000*Pi^2-85686765999732421875000000)*_Z+(1683627180032000000000000000000*Pi^28+947040288768000000000000000000*Pi^26-243897798836910985052160000000000*Pi^24-105849518880314282213376000000000*Pi^22+543806205557386676011008000000000*Pi^20+206745517628405562998784000000000*Pi^18-493535946568048375234560000000000*Pi^16-161556685841710476165120000000000*Pi^14+209521703041307302907904000000000*Pi^12+57932333046211895115008000000000*Pi^10-32606166808014116503296000000000*Pi^8-7574931806403147431400000000000*Pi^6-916854325001083153125000000000*Pi^4-60848666758777034179687500000*Pi^2-1531121744500488281250000000)*_Z^2+(14538675656595603456000000000000*Pi^20+6360670599760576512000000000000*Pi^18-24363640065154351104000000000000*Pi^16-9459367828326973440000000000000*Pi^14+10040437028153917440000000000000*Pi^12+3693930616897744896000000000000*Pi^10+1609933205706216192000000000000*Pi^8+58674582771546096000000000000*Pi^6-1202653471578517170000000000000*Pi^4-149668239567146343750000000000*Pi^2-4663745768352832031250000000)*_Z^3+(-8723205391669003498291200000000*Pi^24-4361602695834501749145600000000*Pi^22+19490912047010429691494400000000*Pi^20+8825430454852624633036800000000*Pi^18-16301436833461042151424000000000*Pi^16-6564233354119088386867200000000*Pi^14+5977256592087501137510400000000*Pi^12+2106180608207148770918400000000*Pi^10-758124018049754123827200000000*Pi^8-240018107472837924480000000000*Pi^6-23564187036740637000000000000*Pi^4-997415989180706250000000000*Pi^2-15689219628471679687500000)*_Z^4-13647882752248245117187500000-261292721157421875*20^RootOf8-535230827832343213125000000000*Pi^2-90526382422649463214540800000000*Pi^8-18587959930253464168320000000000*Pi^6-5863377073505044924800000000000*Pi^4+305811336261213249011712000000000*Pi^12+79115470702645314657484800000000*Pi^10-239241111641945951698944000000000*Pi^16-79895480796476508576153600000000*Pi^14+7986315188014109687808000000000*Pi^22-60346149989113268482867200000000*Pi^20-18258684357505568263372800000000*Pi^18+14855623787650488886886400000000*Pi^24)

F := plot([sigma2], sigma = -10 .. 10, color = [RED], thickness = 1)

Warning, expecting only range variable sigma in expression RootOf(-2216777663316492288*Pi^16*20^RootOf8-554194415829123072*Pi^14*20^RootOf8+5143616921914048512*Pi^12*20^RootOf8+33095407370240000000000000000*3^(1/2)*Pi^15*(32*Pi^2+2)^(1/2)*sigma-30136000839680000000000000000*3^(1/2)*Pi^13*(32*Pi^2+2)^(1/2)*sigma+5028750000000000000000000*3^(1/2)*Pi^3*(32*Pi^2+2)^(1/2)*sigma+79101562500000000000000*3^(1/2)*sigma*Pi*(32*Pi^2+2)^(1/2)-10618895073280000000000000000*3^(1/2)*Pi^11*(32*Pi^2+2)^(1/2)*sigma+3822293002240000000000000000*3^(1/2)*Pi^9*(32*Pi^2+2)^(1/2)*sigma+1210118016000000000000000000*3^(1/2)*Pi^7*(32*Pi^2+2)^(1/2)*sigma+118805400000000000000000000*3^(1/2)*Pi^5*(32*Pi^2+2)^(1/2)*sigma+43980465111040000000000000000*3^(1/2)*Pi^25*(32*Pi^2+2)^(1/2)*sigma+21990232555520000000000000000*3^(1/2)*Pi^23*(32*Pi^2+2)^(1/2)*sigma-98268851732480000000000000000*3^(1/2)*Pi^21*(32*Pi^2+2)^(1/2)*sigma-44495861186560000000000000000*3^(1/2)*Pi^19*(32*Pi^2+2)^(1/2)*sigma+82188225740800000000000000000*3^(1/2)*Pi^17*(32*Pi^2+2)^(1/2)*sigma+14855623787650488886886400000000*Pi^24-18587959930253464168320000000000*Pi^6-5863377073505044924800000000000*Pi^4+79115470702645314657484800000000*Pi^10-90526382422649463214540800000000*Pi^8-239241111641945951698944000000000*Pi^16-79895480796476508576153600000000*Pi^14+305811336261213249011712000000000*Pi^12-60346149989113268482867200000000*Pi^20-18258684357505568263372800000000*Pi^18+7986315188014109687808000000000*Pi^22-535230827832343213125000000000*Pi^2+111484894360500000*Pi^2*20^RootOf8+1765920726670320000*Pi^4*20^RootOf8-569534208772147200*Pi^6*20^RootOf8-4505569481375428608*Pi^8*20^RootOf8+972005049637797888*Pi^10*20^RootOf8+(-9231519020818020433920000000000*Pi^22+195541371952408496701440000000000*Pi^20+89300299589267320995840000000000*Pi^18-333503605675043554590720000000000*Pi^16-115500365322956203622400000000000*Pi^14+204706142659640339988480000000000*Pi^12+55783620627641021399040000000000*Pi^10-43454880575740151285760000000000*Pi^8-9286786763553830541120000000000*Pi^6-635208422610519981000000000000*Pi^4-16054449064166199375000000000*Pi^2-85686765999732421875000000)*_Z+(1683627180032000000000000000000*Pi^28+947040288768000000000000000000*Pi^26-243897798836910985052160000000000*Pi^24-105849518880314282213376000000000*Pi^22+543806205557386676011008000000000*Pi^20+206745517628405562998784000000000*Pi^18-493535946568048375234560000000000*Pi^16-161556685841710476165120000000000*Pi^14+209521703041307302907904000000000*Pi^12+57932333046211895115008000000000*Pi^10-32606166808014116503296000000000*Pi^8-7574931806403147431400000000000*Pi^6-916854325001083153125000000000*Pi^4-60848666758777034179687500000*Pi^2-1531121744500488281250000000)*_Z^2+(14538675656595603456000000000000*Pi^20+6360670599760576512000000000000*Pi^18-24363640065154351104000000000000*Pi^16-9459367828326973440000000000000*Pi^14+10040437028153917440000000000000*Pi^12+3693930616897744896000000000000*Pi^10+1609933205706216192000000000000*Pi^8+58674582771546096000000000000*Pi^6-1202653471578517170000000000000*Pi^4-149668239567146343750000000000*Pi^2-4663745768352832031250000000)*_Z^3+(-8723205391669003498291200000000*Pi^24-4361602695834501749145600000000*Pi^22+19490912047010429691494400000000*Pi^20+8825430454852624633036800000000*Pi^18-16301436833461042151424000000000*Pi^16-6564233354119088386867200000000*Pi^14+5977256592087501137510400000000*Pi^12+2106180608207148770918400000000*Pi^10-758124018049754123827200000000*Pi^8-240018107472837924480000000000*Pi^6-23564187036740637000000000000*Pi^4-997415989180706250000000000*Pi^2-15689219628471679687500000)*_Z^4-13647882752248245117187500000-261292721157421875*20^RootOf8) to be plotted but found name RootOf8

 

``


 

Download root_of.mw

 

Hi, I'm using Maple 2018 and I tried to run coding from https://www.maplesoft.com/applications/view.aspx?sid=4194&view=html

however, it said : unable to parse. I figured out that the problem maybe is in the if loop. though it seems perfectly fine, but it has some goto commands that i cannot search on maple website. does this mean that the goto cannot be used here and should be replaced? if yes, then how? 

i am still learning on how to use maple. any help would be much appreciated. thank you!

this is the coding for if loop:

 

label_7;

rv:=vector([p1(x1pt,x2pt),p2(x1pt,x2pt)]):

numgeval:=numgeval+1;

printf("%5d (%8.4f,%8.4f)",numIter,rv[1],rv[2]);

max:=n;

mg:=convert(sqrt(dotprod(rv,rv)),float);

printf("%12.4f",mg);

if(mg<tol or numIter>=max) then

goto(label_6);

else

numIter:=numIter+1;

fi;

v1:=x1pt+t*rv[1];

v2:=x2pt+t*rv[2];

newt:=evalf(subs({x1=v1,x2=v2},f1));

numfeval:=numfeval+1;

lam:=fsolve(diff(newt,t)=0,t,maxsols=1);

nv1:=evalf(subs({t=lam},v1));

nv2:=evalf(subs({t=lam},v2));

printf(" (%8.4f,%8.4f)%13.4f\n",x1pt,x2pt,lam);

x1pt:=nv1;

x2pt:=nv2;

goto(label_7);

label_6;

printf("\n\n-----------------------------------------");

printf("---------------------------------------------");

printf("\n\n Approximate Solution: ");

printf(" (%8.4f,%8.4f)\n",x1pt,x2pt);

Fvalue:=evalf(subs(x1=x1pt,x2=x2pt,f));

printf(" Maximum Functional Value: ");

printf("%21.4f",Fvalue);

printf("\n Number gradient evaluations:");

printf("%22d",numgeval);

printf("\n Number function evaluations:");

printf("%22d",numfeval);

printf("\n\n-----------------------------------------");

printf("---------------------------------------------");

end:

If q := [q1(t),q2(t),q3(t)];

and L=cos(q1(t))+sin(q2(t))+5*dq1 + 4*dq3

now I want to get the result of the following expression

d(dL/d dq1)/dt=?,

how can i write the expression?

In above expression dq1 is the derivative of q1(t), and dq3 is that of q3(t),

How do I solve (1/2)*n^2 +2n-1=O(n^2) in maple2018?Thank you

I have plotted a 3d figure with MAPLE. How can I snap a point in 3d figure and  show  the coordinate value of snaped point ?It  can be  carried out  easily in MATLAB,but I  cann‘t  snap the point used  point probe tool in MAPLE ?

Hi,

with the Physics package, I want to represent a discrete two-dimensional Hilbert space in a direct-product basis.

I have looked at https://www.mapleprimes.com/posts/209099-Tensor-Product-Of-Quantum-State-Spaces but am not sure how to implement bracketrules.

Let's assume I have one-dimensional bases A and B that span a two-dimensional space C. A is of size Na and B is of size Nb. Consequently, C is of size Na * Nb.

If I understand it correclty, this can be done with

Setup(hilbertspaces = {{A, C}, {B, C}}, quantumbasisdimension = {A = 1 .. Na, B = 1 .. Nb, C = 1 .. Na*Nb}, quantumdiscretebasis = {A, B, C})

First question: Is this correct and if yes, why do I need to specify quantumbasisdimension for C?

Then, I want to define, using bracketrules, <A[i]| <B[j]| |Psi> = X[i,j],

where |Psi> lives in the full, two-dimensional space C and X is a matrix.

<B[j]|Psi> would be a state living in A and <A[i]||Psi> would be a state in B.

How do I define this?

bracketrules = {%Bracket(Bra(A, i)*Bra(B, j), Ket(C, t)) = X[i,j](t)}

gives me an error.

I found a way using the nested expression

bracketrules = {%Bracket(Bra(A, i), Ket(A, j)) = X[i,j], %Bracket(Bra(B, j), Ket(C)) = Ket(A, j)}

giving

Bracket(Bra(A, i), Bracket(Bra(B, j), Ket(C, t))) = X[i,j]

but this is error prone, clumsy and only works in one direction:

Bracket(Bra(B, j), Bracket(Bra(A, i), Ket(C)))

does not work. Of course, I could also specify rules for the reverse direction but this is quite an effort for higher-dimensional spaces (I have, e.g., 9-dimensional spaces in mind).

So how do I do this properly?

Please have a look at the attached example, where I also included time-dependence.

Thanks,

Henrik

 


 

-------``

First try

-------

restart; restart, with(Physics)

Setup(hilbertspaces = {{A, C}, {B, C}}, quantumbasisdimension = {A = 1 .. Na, B = 1 .. Nb, C = 1 .. Na*Nb}, quantumdiscretebasis = {A, B, C}, bracketrules = {%Bracket(Bra(A, i)*Bra(B, j), Ket(C, t)) = X[i, j](t)})

Error, (in Physics:-Setup) expected first argument in the Bracket defining a bracket rule to be a 'Bra'; received: Physics:-`*`(%Bra(A, i), %Bra(B, j))

 

 

---------

Second try

---------

 

restart; restart, with(Physics)

Setup(hilbertspaces = {{A, C}, {B, C}}, quantumbasisdimension = {A = 1 .. Na, B = 1 .. Nb, C = 1 .. Na*Nb}, quantumdiscretebasis = {A, B, C}, bracketrules = {%Bracket(Bra(A, i), Bra(B, j), Ket(C, t)) = X[i, j](t)})

[bracketrules = {%Bracket(%Bra(A, i), %Bra(B, j), %Ket(C, t)) = X[i, j](t)}, disjointedspaces = {{A, C}, {B, C}}, quantumbasisdimension = {A = 1 .. Na, B = 1 .. Nb, C = 1 .. Na*Nb}, quantumdiscretebasis = {A, B, C}]

(1)

Bracket(Bra(A, i), Bra(B, j), Ket(C, t))

Physics:-`*`(Physics:-Bra(A, i), Physics:-Bra(B, j), Physics:-Ket(C, t))

(2)

--------

Third try

--------

 

 

restart; restart, with(Physics)

Setup(hilbertspaces = {{A, C}, {B, C}}, quantumbasisdimension = {A = 1 .. Na, B = 1 .. Nb, C = 1 .. Na*Nb}, quantumdiscretebasis = {A, B, C}, bracketrules = {%Bracket(Bra(A, i), Ket(A, j, t)) = X[i, j](t), %Bracket(Bra(B, j), Ket(C, t)) = Ket(A, j, t)})

[bracketrules = {%Bracket(%Bra(A, i), %Ket(A, j, t)) = X[i, j](t), %Bracket(%Bra(B, j), %Ket(C, t)) = Physics:-Ket(A, j, t)}, disjointedspaces = {{A, C}, {B, C}}, quantumbasisdimension = {A = 1 .. Na, B = 1 .. Nb, C = 1 .. Na*Nb}, quantumdiscretebasis = {A, B, C}]

(3)

Bracket(Bra(A, i).Bra(B, j), Ket(C, t))

Physics:-`*`(Physics:-Bra(A, i), Physics:-Bra(B, j), Physics:-Ket(C, t))

(4)

Bracket(Bra(A, i), Bracket(Bra(B, j), Ket(C, t)))

X[i, j](t)

(5)

Bracket(Bra(B, j), Bracket(Bra(A, i), Ket(C, t)))

Error, (in Physics:-Bracket) expected a Bra and a Ket as a first and last arguments, or no Bra and no Ket when using the shortcut notation; received: Physics:-Bra(B,j), Physics:-Bracket(Physics:-Bra(A,i),Physics:-Ket(C,t))

 

``


 

Download twoD.mw

 

First 39 40 41 42 43 44 45 Last Page 41 of 61