Question: How to perform simplifications to find unknown constants in a simple system of equations in a quantum mechanics problem.

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

Please Wait...