View Single Post
RowdyScot
Ice Arrow Sniper
 
Join Date: Apr 2005
Location: Great Bay Temple
Send a message via AIM to RowdyScot Send a message via Skype™ to RowdyScot 
2006-10-10, 00:08

So for my modern physics class, I'm supposed to create a program in Python to demonstrate a simple harmonic oscillator based off of the Schroedinger equation for n=0, n=1, and n=2. Mind you, NOBODY in this class has any programming knowledge, other than some HTML and bits and pieces of Java. I do not know Python well at all. The program should find the probabilty of the particle's location in the interval -x to x (can presumably be -1 to 1) and also give the energy. So...ummm...yeah. I understand enough to know what to use for xmin and xmax, and dx can just be a step to whatever suits the needs, but I'm not sure what equations I should be using. I know that the energy is (n + 1/2)*hbar*omega, where hbar is h/(2*pi) or 1.054*10**-34, and omega can just be set to 1 radian/second. I'm not sure how to get the probability because of some massive math issues. I can make things easier by defining a bunch of things to cancel out, such as setting k and m as 1.054*10**-34, and so on for the variables in Schroedinger's. My issue mathematically is when I have to solve Schroedinger's for modes n=0, 1, and 2. This gives me a ton of ugly, which I'm not sure how to code. So my question is, does anyone understand what I'm trying to do enough to help, and is anyone willing to help? I know when completely scripted, the code really shouldn't be more than 20 lines. Easy enough, right? This is unfortunately due Wednesday the 11th, so I'm already on a strict timetable. If somebody can give me an example, or help me understand mathematically what I should be doing, I think I can get the rest from there. Honestly, I'm not sure if this is where this thread should belong, but I figured as much since I am trying to make an application. If it should be in AppleOutsider, my humble apologies. I'm currently running on VPython in X11. Thanks for any help that I can get. It is extremely appreciated.

Authentic Nova Scotia bagpipe innards
  quote