1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Calculating energy for particle in finite box.

  1. Mar 8, 2010 #1
    [solved] Calculating energy for particle in finite box.

    1. The problem statement, all variables and given/known data
    I am going to look at a particle in a finite boxpotential where V(x)=-V0 for -a<x=<a
    And they are bound, in other words -V0<E<0. This is a transcendtale equation that need to be solved graphicly/numericly.
    I am aware of two solutions, one of odd, and one of even.

    2. Relevant equations
    To make calculation easier, the task defines [tex]k=\frac{\sqrt{2m|E|}}{\hbar}, l=\frac{\sqrt{2m(V_0+E)}}{\hbar}=\frac{\sqrt{2m(V-|E|)}}{\hbar}[/tex]
    Also told that solution for the equation is [tex]ltan(la)=k[/tex] (even) and [tex]lcot(la)=-k (odd)[/tex]
    Rewriting these to, for odd: [tex]zcot(z)=-\sqrt{z_0 ^2-z}[/tex] and for even: [tex]ztan(z)=\sqrt{z_0 ^2-z^2}[/tex] where z=l*a and [tex]z_0 ^2=\frac{2mV0a^2}{\hbar ^2}[/tex]

    Now, I am tolk to solve these numericly for V0=10eV and a=1nm, and m as electronic mass:

    3. The attempt at a solution
    Since it's a numerical task, I am writing it in matlab, but getting some horrible answers.
    Since I am told to express the energi to the end I use the relevant units for my program (this could be the issue, but my graph is just a straight line).
    So here is my program (agian, it's written in MATlab, but the pseudocode should be easy to recognize for other languages):

    figure(1) %For even functions:
    V0=10; %eV
    a=1; nm
    E=-V0:0.1:0; %I am really unsure about this one
    z=0:.0.1:5*pi/2; %This one aswell, but the tan/cot-functions make this a sensible choise?
    m=511000; %eV/c^2
    h=6.582*10^(-16); eVs

    y11=z.*tan(z); %Gives the array for left side of the equation
    y12=sqrt(z0^2-z.^2); % Should give array for right side of equation
    plot(z,y11,'-r') %Plots it into figure 1 with a red line
    hold 'on'
    plot(z,y12) %Plots it into same figure with a blue (default) line.

    The problem I end up with, is that it's in the size order of 1037, so plotting it on same graph as something with size order of about 1-10 is just silly. So I am wondering where the program fails. It should be quite easy to calcute, considering z is just an array running from 0 to (a number) and z0 is a constant, but I end up with a straight line for the right side, which according to my book (David J. Griffits, Introduction to Quantum Mechanics, figure 2.18: page 80) says it two quite defined graphs, which is also where I got my z-array from, but the plot he is using ([tex]tan(z)=\sqrt{\frac{z0}{z} ^2-1}[/tex]) gives distinct points where they cross, whereas mine deosn't look anything like it.

    I am only suppoosed to find the first one (where they cross) and then calcutate E, but what formula do I use for that? Do I put it into [tex]z=l\cdot a=\frac{\sqrt{2m(V0+E)}}{\hbar}a\Rightarrow E=\frac{(\frac{z\hbar}{a})^2}{2m}-V0[/tex]?
    And then how do I express it in eV without having to calculate it to Joule first, then divide by the value of charge of an electron?


    Edit: I've done some breakthrough when it comes to the task, turns out, the z0 constant is easy to calculate, so I am very curious, and stressing about what I should use for z, amd what about the E? Should I make a loop that is just slooow?

    Edit2: No need to respond, I solved it all by myself now :) .
    Last edited: Mar 8, 2010
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted