Monday, November 28, 2011

Computational Programing: Visualizing Wave Packets

This is a computational project to help understand probability distributions and wave natures of particles. By adding a bunch of sinusoid together, it's possible to arrive at a probability distribution for a particle. The proceeding text and pictures are code (python) being used in the mathematical model and images of the program in work. Following the final stage of the model and pictures, a series of questions will be addressed.




Code (in python)

from pylab import *
#Define constantsConstants
w=1 #sets the frequancey coefficient
Fourier_Series=[] #initialize the list of sine functions
sigma = 10
coeff = 1
numberofharmonics=50
center = numberofharmonics/2
#Calculate the harmonics of the sine functions

for i in range(1,50):#every time the loop repeats this will change the harmonic
    x = [] # plots from -pi to +pi
    gauss = coeff*exp(-(i-center)**2/(2.*sigma**2))#Define the amplitude of the sin function
    sin_list = [] #this includes the sine functions
    for t in arange (-3.14, 3.14, 0.01): # create tsh range of the graph and incriments
        sine= gauss*sin(i*w*t) #the function to be plotted
        sin_list.append(sine) # Adds the calculated vale from the sine function to the list appendex
        x.append(t)
    #plot(x,sin_list)# plots values
#show()

    Fourier_Series.append(sin_list)
superposition = zeros(len(sin_list))
for function in Fourier_Series:
    for i in range(len(function)):
        superposition[i]+=function[i]
plot(x,superposition)
show()

An early step in the program showing waves of different types.
Further along in the program with many waves displayed.
The envelope for the waves.
The program with a limiting factor included to make the wave superposition approach zero.

The final result: a super position of many waves limited to a given region, this can model wave packets. 

Questions:

Click to Enlarge.

A)
Taken from Mastering Physics.

 B)
Taken from Mastering Physics

C) 1.00 L

D) 2.00 L

E) Duplicate Question.

F) h, plank's constant is the answer.

G) h, plank's constant is the answer.

H)The questions in part F and G tie in strongly to the Uncertainty Principle. Both answers for part F and part G come out to be h. This shows there is a constraint on the accuracy to position and momentum which shows a strong parallel to the Uncertainty Principle.










0 comments: