I have had no trouble with the assignment up until I'm asked to solve for the transcendental equations for energy and solve for the lowest odd and even state using MATLAB2. Relevant equations
We are told to use the following form for the wavefunction as defined below:

3. The attempt at a solution
Since the well is symmetric we can ignore the left-side classically allowed region, the function will just be defined as plus or minus [itex]Bsin(k(b + \frac{a}{2} - x))[/itex] depending on whether we're looking at an even or odd state.

Typing out all of my work would have been a huge pain, if these don't look right let me know and I can type out what I did.

Now, my first question is: Do these equations for the energy look right?

If they are right my second question will be how the heck do I solve for the energies?! I'm using the fzero function, with a given initial guess of ~0.00661eV, in MATLAB and am getting ~0.041eV for the even state but 3.7e-16 for the odd state. They should be almost identical!!

Your equations look fine, but you want V0 > E so that κ is real. In terms of k and κ, your equations are
$$k \cot ka = \begin{cases}
-\kappa\tanh \kappa(b-a/2) & \text{even} \\
-\kappa\coth \kappa(b-a/2) & \text{odd}
\end{cases}$$and ##\kappa^2 = k_v^2 - k^2## where ##k_v^2 = 2mV_0/\hbar^2##. Try plotting both sides of the equation as a function of k and see where the graphs intersect. That'll give you a better first guess for k. When I used ##k=\pi/a## for the initial guess, Mathematica had trouble converging on the solution.

I used ##m = 1.304 \times 10^{10}~\text{eV/c}^2## (the mass of a nitrogen atom), and with your numbers, I found the energy of the states to be both around ##1.103 \times 10^{-3}\text{ eV}##, which is much smaller than V0. The difference in the energies was ##6.79 \times 10^{-8}\text{ eV}##.

EDIT: Ah, I just saw your edit. You're just having a problem with units, I think — the speed of light in particular. Using that value for the mass implicitly assumes c=1. You can probably fix this by changing your value for ##\hbar## to 197.

Attached Files:

Since the prof explicitly tells use to use k = pi/a as our guess when evaluating this I am still using that in my initial guess ([itex] E \approx 0.006613 eV [/itex]. With the change in a in my code I get, GAH, the exact same value

Ok that's good enough for me then. I think the issue with taking k ~ pi/a is that it occurs right around the asymptote just to the right of the plot you posted. I used the better k value and explained why in my assignment. Man this question was a headache. Thanks a lot for your help!