Thursday, December 15, 2011

Visualizing Wave Packets

In this lab the purpose was to get a better understanding of wave packets through computational modeling since it is not possible to do physical experiments with current equipments. So the code for the programing is as follow:


from pylab import *
w=1 
Fourier_Series=[] 
sigma = 10
C1 = 1
numberofharmonics=50
center = numberofharmonics/2

for i in range(1,50):#every time the loop repeats this will change the harmonic
    x = [] # plots from -pi to +pi
    gauss = C1*exp(-(i-center)**2/(2.*sigma**2))
    sin_list = [] #this includes the sine functions
    for t in arange (-3.14, 3.14, 0.01): 
        sine= gauss*sin(i*w*t) 
        sin_list.append(sine) 
        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()



Answers to the questions at the end of the handout:

 1)

2)

3) L
4) 2L
5) ---- (same question as last part)
6) h
7) h
8) In both cases the values are equal to h which means the results are bounded and cannot pass this value which ties itself to uncertainty principal.

No comments:

Post a Comment