Mathematica Find all values of E for a transcendental equation

AI Thread Summary
The discussion revolves around solving a transcendental equation related to quantum mechanics, specifically for finding energy values corresponding to bound states in a potential well. The equation in question is k = -l * Cot(la), but the user encounters precision errors with Nsolve and FindRoot, leading to imaginary values. The user attempts to reformulate the equation as √(-e/(e+v)) = -Cot(la) but still faces challenges. Key points include the identification of a typo in the cotangent term, which affects the solution's validity. A plot of the two sides of the equation indicates they do not intersect within the expected energy range, suggesting a lack of bound states. The user also shares their code for calculating the mass and energy, noting that the mass is approximately 7 GeV and the ground state energy in an infinite square well is about 0.
happyparticle
Messages
490
Reaction score
24
Hi,
I'm trying to solve a transcendental equation. I would like all the values of E that solve this equation.
##k = -l \cdot Cot(la)##
However, using Nsolve or FindRoot, they give me a precision error. Hence, I'm trying this form.
##\sqrt{-e /(e+v)} = -Cot(la)##
FindRoot only give me an imaginary value and NSolve just keep running.
Here is my code
Code:
k = Sqrt[-2*m*e] /h
l = Sqrt[2*m*(e+v)] /h
m = (2.66*10^-26)(2.32*10^-26) / ((2.66*10^-26) + (2.32*10^-26))
h = 6.58-10^-16
v = 0.05
a = 3.2*10^-10

Nsolve[Sqrt[-e / (e+v)] == -(Cot[l-a]), e]

I'm trying to find all the energies corresponding to the bound states in a potential well.
https://quantummechanics.ucsd.edu/ph130a/130_notes/node151.html

Thank you
 
Last edited:
Physics news on Phys.org
It is not Cot[l-a], but Cot[l a].

However, if you try and plot the two sides of the equality with the correct term in the cotangent, you will see that the two curves never cross in the range of interest, ##[-V_0,0]##.
 
I find the mass is about 7 GeV. In an infinite square well of width 0.32 nm, the ground state energy is around 0.00027 eV, so there should be plenty of bound states in the finite well of depth 0.05 eV.
 
happyparticle said:
Here is my code
Code:
k = Sqrt[-2*m*e] /h
l = Sqrt[2*m*(e+v)] /h
m = (2.66*10^-26)(2.32*10^-26) / ((2.66*10^-26) + (2.32*10^-26))
h = 6.58-10^-16
v = 0.05
a = 3.2*10^-10

Nsolve[Sqrt[-e / (e+v)] == -(Cot[l-a]), e]
In addition to the other errors @DrClaude has pointed out, you have a typo in defining ##\hbar## as well.

Here's a little trick to simplifying the calculations and avoid a bunch of unit conversions.
$$k = \sqrt{-\frac{2mE}{\hbar^2}} = \sqrt{-\frac{2(mc^2)E}{(\hbar c)^2}}.$$ Express the mass ##m## in units of ##{\rm eV}/c^2## and the energy ##E## in eV, and use ##\hbar c = 197.3~\rm eV\cdot nm##. Then the calculated value of ##k## will have units of ##\rm nm^{-1}##.
 
Back
Top