# Find all values of E for a transcendental equation

• Mathematica
happyparticle
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:

Mentor
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]##.

Staff Emeritus
Homework Helper
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.

DrClaude
Staff Emeritus
Homework Helper
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}##.

DrClaude