MaplePrimes Questions

I found system remember tables mentioned under Details in ?CacheOption.

What exactly are they? Anything special about them?

The ProgrammingGuide does not given more details. It only mentions that there are "procedures that cannot use option system remember tables". For what reason a procedure cannot use them?

For the following limit determination, I do not get the known result 2, but only a term with LerchPhi. Please give me some advice.
lim(n-->oo)[(n/(2^n))*sum(k=1 to n) (2^k/k)]

I wish to plot two line segments over the intervals [0,1] and [2,3].  Maple 2024 draws a single line segment over [0,3].  Oddly enough, if I specify a color option, then it produces the expected result!

This used to work correctly in Maple 2023.  Perhaps this can be corrected in the forthcoming release?

restart;

kernelopts(version);

`Maple 2024.2, X86 64 LINUX, Oct 29 2024, Build ID 1872373`

plots:-display(
        plot(1, x=0..1),
         plot(1, x=2..3), thickness=5);

plots:-display(
        plot(1, x=0..1),
         plot(1, x=2..3),thickness=5, color=red);


Download mw.mw

Does this happen to you (ChatGPT session):

I am taking a course in quantum mechanics and trying to do the calculations in Maple.

In the worksheet below I try to solve a system of equations to find some constants. 

It isn't very relevant that the domain is physics. 

The issues I have are with manipulations of expressions (specifically, simplifications).

restart

Levine - Ch. 2.4 - Particle in a Rectangular Well

NULL

Define

s__1 := sqrt(2*m*(V__0-E))/`ℏ` = 2^(1/2)*(m*(V__0-E))^(1/2)/`ℏ`NULL

s__2 := -s__1 = -2^(1/2)*(m*(V__0-E))^(1/2)/`ℏ`NULL

NULLs := sqrt(2*m*E)/`ℏ` 

2^(1/2)*(m*E)^(1/2)/`ℏ`

(1)

`ψ__1`, `ψ__2` and `ψ__3` are wavefunctions.

`ψ__1` := proc (x) options operator, arrow; C*exp('s__1'*x) end proc = proc (x) options operator, arrow; C*exp('s__1'*x) end procNULL

`ψ__2` := proc (x) options operator, arrow; A*cos('s'*x)+B*sin('s'*x) end proc = proc (x) options operator, arrow; A*cos('s'*x)+B*sin('s'*x) end procNULL

`ψ__3` := proc (x) options operator, arrow; G*exp('s__2'*x) end proc = proc (x) options operator, arrow; G*exp('s__2'*x) end procNULL

NULL

assume(G <> 0, C <> 0)

NULL

I would also like to assume that A and B cannot both be zero simultaneously.


As can be seen above, there are four unknown constants, "A,B,C,"and G.

 

We can obtain values for these unknowns by imposing boundary conditions.

 

Some of the boundary conditions involve the first derivatives of the wavefunctions.

`&psi;__1,d` := D(`&psi;__1`) = proc (z) options operator, arrow; C*s__1*exp(s__1*z) end procNULL

`&psi;__2,d` := D(`&psi;__2`) = proc (z) options operator, arrow; -A*s*sin(s*z)+B*s*cos(s*z) end procNULL

`&psi;__3,d` := D(`&psi;__3`) = proc (z) options operator, arrow; G*s__2*exp(s__2*z) end procNULL

NULL

The boundary conditions are

NULL

`&psi;__1`(0) = `&psi;__2`(0)*`&psi;__2`(l) and `&psi;__2`(0)*`&psi;__2`(l) = `&psi;__3`(l)*(D(`&psi;__1`))(0) and `&psi;__3`(l)*(D(`&psi;__1`))(0) = (D(`&psi;__2`))(0)*(D(`&psi;__2`))(l) and (D(`&psi;__2`))(0)*(D(`&psi;__2`))(l) = (D(`&psi;__3`))(l)

NULL

My question is how to find the constants in Maple.

NULLNULL

In this problem, E < V__0 and m > 0.

 

assume(E < V__0, m > 0)

 

Solving the first boundary condition is easy.

expr1 := solve(`&psi;__1`(0) = `&psi;__2`(0), {C}) = {C = A}

NULL

Next, I solve the third boundary condition and sub in the result from solving the first boundary condition. We get B in terms of A.

expr3 := eval(solve(`&psi;__1,d`(0) = `&psi;__2,d`(0), {B}), expr1) = {B = A*(m*(V__0-E))^(1/2)/(m*E)^(1/2)}NULL

NULL

Already here it is not clear to me why Maple does not cancel the m's.

 

Next, consider the second boundary condition

expr2 := solve(`&psi;__2`(l) = `&psi;__3`(l), {G}) = {G = (A*cos(s*l)+B*sin(s*l))/exp(s__2*l)}

 

We can obtain G in terms of just A by subbing in previously found relationships, as follows

expr2 := simplify(subs(expr3, expr2))

{G = exp(2^(1/2)*m^(1/2)*(V__0-E)^(1/2)*l/`&hbar;`)*A*(sin(2^(1/2)*m^(1/2)*E^(1/2)*l/`&hbar;`)*(V__0-E)^(1/2)+cos(2^(1/2)*m^(1/2)*E^(1/2)*l/`&hbar;`)*E^(1/2))/E^(1/2)}

(4)

NULL

Finally, consider the fourth boundary condition.

solve(`&psi;__2,d`(l) = `&psi;__3,d`(l), {G})

{G = (m*E)^(1/2)*(A*sin(2^(1/2)*(m*E)^(1/2)*l/`&hbar;`)-B*cos(2^(1/2)*(m*E)^(1/2)*l/`&hbar;`))/((m*(V__0-E))^(1/2)*exp(-2^(1/2)*(m*(V__0-E))^(1/2)*l/`&hbar;`))}

(5)

expr4 := simplify(subs(expr3, solve(`&psi;__2,d`(l) = `&psi;__3,d`(l), {G})))

{G = (sin(2^(1/2)*m^(1/2)*E^(1/2)*l/`&hbar;`)*E^(1/2)-cos(2^(1/2)*m^(1/2)*E^(1/2)*l/`&hbar;`)*(V__0-E)^(1/2))*exp(2^(1/2)*m^(1/2)*(V__0-E)^(1/2)*l/`&hbar;`)*A/(V__0-E)^(1/2)}

(6)

result := simplify(subs(expr2, expr4))

{exp(2^(1/2)*m^(1/2)*(V__0-E)^(1/2)*l/`&hbar;`)*A*(sin(2^(1/2)*m^(1/2)*E^(1/2)*l/`&hbar;`)*(V__0-E)^(1/2)+cos(2^(1/2)*m^(1/2)*E^(1/2)*l/`&hbar;`)*E^(1/2))/E^(1/2) = (sin(2^(1/2)*m^(1/2)*E^(1/2)*l/`&hbar;`)*E^(1/2)-cos(2^(1/2)*m^(1/2)*E^(1/2)*l/`&hbar;`)*(V__0-E)^(1/2))*exp(2^(1/2)*m^(1/2)*(V__0-E)^(1/2)*l/`&hbar;`)*A/(V__0-E)^(1/2)}

(7)

At this point, we have this complicated expression.

 

The calculations above come from the book "Quantum Chemistry" by Levine. The variable "result" above should, after a few more steps of manipulating the expression, give us

 

(2*E-V__0)*sin(sqrt(2*mE)*l/`&hbar;`) = 2*sqrt(-E^2+E*V__0)*cos(sqrt(2*mE)*l/`&hbar;`)

(2*E-V__0)*sin(2^(1/2)*mE^(1/2)*l/`&hbar;`) = 2*(-E^2+E*V__0)^(1/2)*cos(2^(1/2)*mE^(1/2)*l/`&hbar;`)

(8)

 

I've done the calculation by hand. It is not difficult. The exponentials and the A cancel on each side and we are left with an equation involving sin(sl) and cos(sl) which easily comes out to the desired equation above.

I would like to be able to do it here in Maple.

The first thing I would do at this point is to start eliminating some of the clutter. For example, I would like to replace sqrt(2*mE)/`&hbar;` with s.

 

This is a first task (that I have asked about in a separate question).

 

Then, I would want Maple to do the cancellations for me, but I have already used "simplify".

 

Finally, I think I would like to collect terms involving cos and sin.

 

Here is what happens when I try to get Maple to solve the equations for me in one go

 

solve({`&psi;__1`(0) = `&psi;__2`(0), `&psi;__1,d`(0) = `&psi;__2,d`(0), `&psi;__2`(l) = `&psi;__3`(l), `&psi;__2,d`(l) = `&psi;__3,d`(l)}, {A, B, C, G})

{A = 0, B = 0, C = 0, G = 0}

(9)

Download solve_constants.mw

In a calculation, I obtained the following expression from Maple.

expr1:=A*sqrt(-m*(-V__0 + E))/sqrt(m*E)

A*(-m*(-V__0+E))^(1/2)/(m*E)^(1/2)

(1)

The first question I have is why the "m's don't cancel."

Next, consider the expression

expr2:=exp(sqrt(2)*sqrt(m)*sqrt(-V__0 + E)*l*I/`&hbar;`)

exp(I*2^(1/2)*m^(1/2)*(-V__0+E)^(1/2)*l/`&hbar;`)

(2)

simplify(expr2,[E-V__0=y])

exp(I*2^(1/2)*m^(1/2)*y^(1/2)*l/`&hbar;`)

(3)

simplify(expr2,[2*m=y])

exp(I*y^(1/2)*(-V__0+E)^(1/2)*l/`&hbar;`)

(4)

Why doesn't the simplification below work?

simplify(expr2,[2*m*(E-V__0)=y])

exp(I*2^(1/2)*m^(1/2)*(-V__0+E)^(1/2)*l/`&hbar;`)

(5)

I also tried with other commands

eval(expr2,2*m=y)

exp(I*2^(1/2)*m^(1/2)*(-V__0+E)^(1/2)*l/`&hbar;`)

(6)

eval(expr2,E-V__0=y)

exp(I*2^(1/2)*m^(1/2)*y^(1/2)*l/`&hbar;`)

(7)

eval(expr2,2*m*(E-V__0)=y)

exp(I*2^(1/2)*m^(1/2)*(-V__0+E)^(1/2)*l/`&hbar;`)

(8)

algsubs(2*m=y,expr2)

exp(I*y^(1/2)*(-V__0+E)^(1/2)*l/`&hbar;`)

(9)

algsubs(E-V__0=y,expr2)

exp(I*2^(1/2)*m^(1/2)*y^(1/2)*l/`&hbar;`)

(10)

algsubs(2*m*(E-V__0)=y,expr2)

exp(I*2^(1/2)*m^(1/2)*(-V__0+E)^(1/2)*l/`&hbar;`)

(11)
 

NULL

In reality, I would like to the entirety of sqrt(2m(E-V__0)/hbar) a variable by the name of s.

Download simplify_roots.mw

Below is a simple demonstration of something that I am very confused about in another worksheet I am working on.

Basically, I have a function of x called psi_I and I want to define another function of x called psi_I,d which is just the derivative of psi_I.

In, the snippet below, this works if I use the variable names psi_1 and psi_1,d, but not if I replace the "1" with a "I" as I want to do.

In addition, I don't know why the output (6) is different from (7) or (8). All three are from the same command in Maple.

restart

`&psi;__1` := proc (x) options operator, arrow; C*exp(a*x) end proc

proc (x) options operator, arrow; C*exp(a*x) end proc

(1)

`&psi;__1,d` := unapply(diff(`&psi;__1`(x), x), x)

proc (x) options operator, arrow; C*a*exp(a*x) end proc

(2)

`&psi;__1,d`(x)

C*a*exp(a*x)

(3)

NULL

restart

`&psi;__I` := proc (x) options operator, arrow; C*exp(a*x) end proc

proc (x) options operator, arrow; C*exp(a*x) end proc

(4)

`&psi;__I,d` := unapply(diff(`#msub(mi("psi",fontstyle = "normal"),mi("1"))`(x), x), x)

D(psi__1)

(5)

`#msub(mi("psi",fontstyle = "normal"),mi("1,d"))`(x)

`psi__1,d`(x)

(6)

`#msub(mi("psi",fontstyle = "normal"),mi("I,d"))`(x)

(D(psi__1))(x)

(7)

`&psi;__I,d`(x)

(D(psi__1))(x)

(8)

NULL

Download psi_subscript.mw

i want to to get the eq(14) but i need to do some Hard replacing which i am unfamiliar with it any one can help ?

restart;

 

f :=  1 + exp(eta[1]) + b[1, 2]*exp(eta[1] + eta[2]) + exp(eta[2]) + b[2, 3]*exp(eta[2] + eta[3]) + b[1, 2]*b[1, 3]*b[2, 3]*exp(eta[1] + eta[2] + eta[3]) + b[1, 3]*exp(eta[1] + eta[3]) + exp(eta[3])

1+exp(eta[1])+b[1, 2]*exp(eta[1]+eta[2])+exp(eta[2])+b[2, 3]*exp(eta[2]+eta[3])+b[1, 2]*b[1, 3]*b[2, 3]*exp(eta[1]+eta[2]+eta[3])+b[1, 3]*exp(eta[1]+eta[3])+exp(eta[3])

(1)

NULL

C :=(i,j)->6*l[j]*l[i]*(l[i] + l[j])/((l[i] - l[j])^2*beta)

proc (i, j) options operator, arrow; 6*l[j]*l[i]*(l[i]+l[j])/((l[i]-l[j])^2*beta) end proc

(2)

NULL

etai := k[i]*(t*w[i]+y*l[i]+x)+eta[i]

k[i]*(t*w[i]+y*l[i]+x)+eta[i]

(3)

theta[i] := t*w[i]+y*l[i]+x

t*w[i]+y*l[i]+x

(4)

eqw := w[i] = -(alpha*l[i]+beta)/l[i]

w[i] = -(alpha*l[i]+beta)/l[i]

(5)

theta[1] := normal(eval(eval(theta[i], eqw), i = 1)); theta[2] := normal(eval(eval(theta[i], eqw), i = 2))

-(alpha*t*l[1]-y*l[1]^2+beta*t-x*l[1])/l[1]

 

-(alpha*t*l[2]-y*l[2]^2+beta*t-x*l[2])/l[2]

(6)

fix:=proc(F)
   local i,j;
   i:=op(1,F); j:=op(2,F);
   if i<j then
      C(i,j);
   else
      F;
   fi;
end proc:

evalindets(f,b[anything,anything],F->fix(F));

1+exp(eta[1])+6*l[2]*l[1]*(l[1]+l[2])*exp(eta[1]+eta[2])/((l[1]-l[2])^2*beta)+exp(eta[2])+6*l[3]*l[2]*(l[2]+l[3])*exp(eta[2]+eta[3])/((l[2]-l[3])^2*beta)+216*l[2]^2*l[1]^2*(l[1]+l[2])*l[3]^2*(l[1]+l[3])*(l[2]+l[3])*exp(eta[1]+eta[2]+eta[3])/((l[1]-l[2])^2*beta^3*(l[1]-l[3])^2*(l[2]-l[3])^2)+6*l[3]*l[1]*(l[1]+l[3])*exp(eta[1]+eta[3])/((l[1]-l[3])^2*beta)+exp(eta[3])

(7)

simplify(%);

1+exp(eta[1])+b[1, 2]*exp(eta[1]+eta[2])+exp(eta[2])+b[2, 3]*exp(eta[2]+eta[3])+b[1, 2]*b[1, 3]*b[2, 3]*exp(eta[1]+eta[2]+eta[3])+b[1, 3]*exp(eta[1]+eta[3])+exp(eta[3])

(8)
 

 

Download get_result.mw

I would like to generate a brief description of the object Iterator:-Product but I get the following error:  

Describe(Iterator:-Product);

object Product :: Class<<36893490916968945900>>:

    ModuleApply( )

    ModuleCopy( self::_Product, proto::_Product, 
Error, (in Describe) `proto` does not evaluate to a module

How do I get rid of this message? 

i used: 
Y := ssystem("dir C:"); print(Y)
result is

[0,"\" El volumen de la unidad C es OS\n El n£mero de serie del volumen es: 54A9-09DA\n\n Directorio de C:\\Program Files\\Maple 2016"

Windows operating system English version but Maple shows Spanish result
I want result is English. Please help me

Y := ssystem("dir C:"):

[0, " El volumen de la unidad C es OS
 El n£mero de serie del volumen es: 54A9-09DA

 Directorio de C:\Program Files\Maple 2016

21/02/2025  07:53 AM    <DIR>          .
22/02/2025  08:34 AM    <DIR>          ..
21/02/2025  07:50 AM    <DIR>          afm
21/02/2025  07:55 AM    <DIR>          bin.X86_64_WINDOWS
21/02/2025  07:52 AM    <DIR>          data
13/02/2025  07:46 AM    <DIR>          eBookTools
21/02/2025  07:50 AM    <DIR>          etc
02/02/2016  05:05 AM            73,861 EULA.html
21/02/2025  07:52 AM    <DIR>          examples
21/02/2025  07:52 AM    <DIR>          examplesclassic
21/02/2025  07:52 AM    <DIR>          Excel
21/02/2025  07:50 AM    <DIR>          extern
21/02/2025  07:52 AM    <DIR>          Fonts
13/01/2016  06:39 AM           223,499 Install.html
21/02/2025  07:52 AM    <DIR>          java
21/02/2025  07:52 AM    <DIR>          jre
21/02/2025  07:52 AM    <DIR>          lib
21/02/2025  07:55 AM    <DIR>          license
27/01/2011  11:13 PM             6,296 Maple Cloud Terms of Service.html
17/02/2016  02:54 PM         5,490,560 MapleToolbox2016.0WindowsX64Installer.exe
13/02/2025  07:48 AM           317,257 Maple_2016_Install_2025_02_13_08_46_07.log
21/02/2025  07:52 AM           317,834 Maple_2016_Install_2025_02_21_08_47_47.log
21/02/2025  07:50 AM    <DIR>          profiles
21/02/2025  07:52 AM             5,396 readme.txt
21/02/2025  07:52 AM    <DIR>          redist
21/02/2025  07:52 AM    <DIR>          samples
21/02/2025  07:52 AM    <DIR>          uninstall
21/02/2025  07:52 AM    <DIR>          update
13/02/2025  07:46 AM    <DIR>          Users
               7 archivos      6,434,703 bytes
              22 dirs  148,583,636,992 bytes libres"]

(1)

``

Download language_maple.mw

Hello,

non-expert Maple user here.  Any help would be appreciated, I am trying to perform the following process:

1) Represent State Space matrices calculated by hand (ex: A, B, C, D) as a Maple object.

2) Find a solution to the State Space system of equations based on given initial conditions, or represent the same in any other form such as a plot or table.  I am right now trying without much success to use the ResponsePlot and Simulate functions for this.

I have completed (1) using the DynamicSystems > StateSpace object of the form

sys:= StateSpace(A,B,C,D)    // where A, B, C, D are the numeric matrices of the typical S-S set.

using a simple constant '1' as an algebraic input test, I use the ResponsePlot as follows:

ResponsePlot(sys, 1) 

Maple gives me the error: 

Error, (in DynamicSystems:-Simulate) for a continuous system, the second argument (input) must be an algebraic expression or a list of algebraic expressions; received Vector(7, [0,1,2,3,4,5,6])
NULL;

I am sure I'm missing something simple.  Can someone please assist in showing me what I'm doing wrong?  I tried using a vector [0,1,2,3,4] instead of an algebraic function, but it still returned an error.  I am open to other ways too, but the next best way seems to be to convert from StateSpace into individual differential equations and then solve them all manually with dsolve.  It seems like there has got to be a simpler way than that.  Does anyone know of a simple way to implement this process?

i did try but i don't know the result is not come out? also i am not sure to put equation in eq1 in pde or linear part?

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(1)

declare(u(x, y, t))

u(x, y, t)*`will now be displayed as`*u

(2)

declare(f(x, y, t))

f(x, y, t)*`will now be displayed as`*f

(3)

pde := diff(u(x, y, t), t, y)+diff(u(x, y, t), `$`(x, 3), y)-3*(diff(u(x, y, t), x))*(diff(u(x, y, t), x, y))-3*(diff(u(x, y, t), `$`(x, 2)))*(diff(u(x, y, t), y))+alpha*(diff(u(x, y, t), x, y))+beta*(diff(u(x, y, t), `$`(x, 2)))

diff(diff(u(x, y, t), t), y)+diff(diff(diff(diff(u(x, y, t), x), x), x), y)-3*(diff(u(x, y, t), x))*(diff(diff(u(x, y, t), x), y))-3*(diff(diff(u(x, y, t), x), x))*(diff(u(x, y, t), y))+alpha*(diff(diff(u(x, y, t), x), y))+beta*(diff(diff(u(x, y, t), x), x))

(4)

pde_nonlinear, pde_linear := selectremove(proc (term) options operator, arrow; has((eval(term, u(x, y, t) = a*u(x, y, t)))/a, a) end proc, pde)

-3*(diff(u(x, y, t), x))*(diff(diff(u(x, y, t), x), y))-3*(diff(diff(u(x, y, t), x), x))*(diff(u(x, y, t), y)), diff(diff(u(x, y, t), t), y)+diff(diff(diff(diff(u(x, y, t), x), x), x), y)+alpha*(diff(diff(u(x, y, t), x), y))+beta*(diff(diff(u(x, y, t), x), x))

(5)

eq := u(x, y, t) = -2*(diff(ln(f(x, y, t)), x))

u(x, y, t) = -2*(diff(f(x, y, t), x))/f(x, y, t)

(6)

eq1 := -(1/2)*numer(normal(eval(pde_linear, eq)))

f(x, y, t)^4*(diff(diff(diff(f(x, y, t), x), x), x))*beta+f(x, y, t)^4*(diff(diff(diff(f(x, y, t), x), x), y))*alpha-f(x, y, t)^3*(diff(f(x, y, t), y))*(diff(diff(f(x, y, t), x), x))*alpha-2*f(x, y, t)^3*(diff(diff(f(x, y, t), x), y))*(diff(f(x, y, t), x))*alpha-3*f(x, y, t)^3*(diff(f(x, y, t), x))*(diff(diff(f(x, y, t), x), x))*beta+2*f(x, y, t)^2*(diff(f(x, y, t), y))*(diff(f(x, y, t), x))^2*alpha+2*f(x, y, t)^2*(diff(f(x, y, t), x))^3*beta+(diff(diff(diff(f(x, y, t), t), x), y))*f(x, y, t)^4+(diff(diff(diff(diff(diff(f(x, y, t), x), x), x), x), y))*f(x, y, t)^4-(diff(diff(f(x, y, t), t), x))*(diff(f(x, y, t), y))*f(x, y, t)^3-(diff(diff(diff(diff(f(x, y, t), x), x), x), x))*(diff(f(x, y, t), y))*f(x, y, t)^3-(diff(diff(f(x, y, t), x), y))*(diff(f(x, y, t), t))*f(x, y, t)^3-4*(diff(diff(diff(f(x, y, t), x), x), x))*(diff(diff(f(x, y, t), x), y))*f(x, y, t)^3-(diff(f(x, y, t), x))*(diff(diff(f(x, y, t), t), y))*f(x, y, t)^3-4*(diff(diff(diff(diff(f(x, y, t), x), x), x), y))*(diff(f(x, y, t), x))*f(x, y, t)^3-6*(diff(diff(f(x, y, t), x), x))*(diff(diff(diff(f(x, y, t), x), x), y))*f(x, y, t)^3+2*(diff(f(x, y, t), x))*(diff(f(x, y, t), t))*(diff(f(x, y, t), y))*f(x, y, t)^2+8*(diff(diff(diff(f(x, y, t), x), x), x))*(diff(f(x, y, t), x))*(diff(f(x, y, t), y))*f(x, y, t)^2+6*(diff(diff(f(x, y, t), x), x))^2*(diff(f(x, y, t), y))*f(x, y, t)^2+24*(diff(diff(f(x, y, t), x), x))*(diff(f(x, y, t), x))*(diff(diff(f(x, y, t), x), y))*f(x, y, t)^2+12*(diff(diff(diff(f(x, y, t), x), x), y))*(diff(f(x, y, t), x))^2*f(x, y, t)^2-36*(diff(diff(f(x, y, t), x), x))*(diff(f(x, y, t), x))^2*(diff(f(x, y, t), y))*f(x, y, t)-24*(diff(f(x, y, t), x))^3*(diff(diff(f(x, y, t), x), y))*f(x, y, t)+24*(diff(f(x, y, t), x))^4*(diff(f(x, y, t), y))

(7)

NULL

T := f(x, y, t) = h*a[10]+m^2+n^2+a[9]

T1 := m = t*a[3]+x*a[1]+y*a[2]+a[4]

T2 := n = t*a[7]+x*a[5]+y*a[6]+a[8]

T3 := h = a[10]*exp(t*p[3]+x*p[1]+y*p[2])

L2 := expand(subs({T1, T2, T3}, T))

f(x, y, t) = a[10]^2*exp(p[3]*t)*exp(p[1]*x)*exp(p[2]*y)+t^2*a[3]^2+2*t*x*a[1]*a[3]+2*t*y*a[2]*a[3]+x^2*a[1]^2+2*x*y*a[1]*a[2]+y^2*a[2]^2+2*t*a[3]*a[4]+2*x*a[1]*a[4]+2*y*a[2]*a[4]+a[4]^2+t^2*a[7]^2+2*t*x*a[5]*a[7]+2*t*y*a[6]*a[7]+x^2*a[5]^2+2*x*y*a[5]*a[6]+y^2*a[6]^2+2*t*a[7]*a[8]+2*x*a[5]*a[8]+2*y*a[6]*a[8]+a[8]^2+a[9]

(8)

eq9a := eval(eq1, L2)

indets(%)

{alpha, beta, t, x, y, a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], p[1], p[2], p[3], exp(p[1]*x), exp(p[2]*y), exp(p[3]*t)}

(9)

p2b := subs({exp(p[1]*x) = eX, exp(p[2]*y) = eY, exp(p[3]*t) = eT}, eq9a); indets(%)

{alpha, beta, eT, eX, eY, t, x, y, a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], p[1], p[2], p[3]}

(10)

p2c := numer(normal(p2b))

eqns := {coeffs(collect(p2c, {eT, eX, eY}, distributed), {eT, eX, eY})}; nops(%)

5

(11)

solve(eqns, {a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], p[1], p[2], p[3]})

 

NULL

Download parameters.mw

Can I define the creation and annihilation operator commutation relations with an explicit momentum dependence?

The goal is to implement an expression of a discrete scalar plane-wave solution to the Klein-Gordon equation that makes use of the creation and annihilation operators in the Physics package.

We don't bother solving the Klein-Gordon equation explicitly. Instead, we just take a solution from literature. This approach is sufficient to show the difficulty in defining the the creation and annihilation operators in this way.

how_to_define_creation_and_annihilation_operators_with_a_momentum_dependence.mw

restart

Setup

   

NULL``

Goal

   

NULL``

Define Creation and Annihilation Operators for Quantum Field phi

   

NULL

Static Textbook Solution

   

NULL

Commutator Definition Attempt 1 FAIL

   

NULL``

Commutator Definition Attempt 2 FAIL

   

NULL``

Commutator Definition Attempt 3 FAIL

   

NULLNULL

Commutator Definition Attempt 4 FAIL

   

NULL``

Commutator Definition Attempt 5 FAIL

   

So, is defining the creation and annihilation operators with a momentum dependence even possible, using the physics MAPLE package?

Download how_to_define_creation_and_annihilation_operators_with_a_momentum_dependence.mw

Whenever I have local proc inside a proc, and use local variables from the outer proc inside it, Mint tells me that the variables are not used.

This can't be right. Why does it say that? Here is MWE. I have this foo.mpl file

foo := proc()

local C1;
local y,x;

    proc()
        C1:= `tools/genglobal`(_C); 
        sol:=y(x)=  C1; 
    end proc();

end proc;

We see clearly that C1 is used, also x and y are used. There can be more code using these inside the inner proc. But this is what mint says

"C:\Program Files\Maple 2024\bin.X86_64_WINDOWS\mint.exe" foo.mpl

    |\^/|      Maple 2024 Diagnostic Program
._|\|   |/|_.  Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2024
 \  MINT   /   All rights reserved. Maple is a trademark of
 <____ ____>   Waterloo Maple Inc.
      |
Procedure foo() on lines 1 to 11
  These local variables were never used:  C1, x, y

Any idea why it says these are not used?

Also, I noticed it did not warn me that variable sol is global inside the proc. i.e. I was expecting something like this 

          These names were used as global names but were not declared: sol

Which is typical message mint gives when using a name inside a proc which was not declared,

Maple 2024.2 on Windows

First 27 28 29 30 31 32 33 Last Page 29 of 2425