Thursday, November 24, 2011

Visualizing Wave packets

This time we used python to help visualize wave packets, and better understand the wave function.
We used a python module called pylab to graph functions.
For my program, you can select the number of harmonics and the value for sigma, and compare different arrangements at once.

from pylab import *
harmonics,sigma = zeros(5),zeros(5)

#### Variables #####
harmonics[1] = 97
sigma[1] = 1
###
harmonics[2] = 97
sigma[2] = 5
###
harmonics[3] = 97
sigma[3] = 10

###
rng = 3.14 #range of x values to plot (-rng to +rng)
#############

def gauss(number,sigma):
    """harmonics, sigma"""
    gauss_list = [] #empty array
    coeff = 1/(sqrt(2*pi)*sigma)
    for x in range(0,number):
        funcval = coeff * exp(-(float(x) -float(number-1)/2 )**2/(2 * sigma**2))
        gauss_list.append(funcval)
    print gauss_list
    return gauss_list

def sinplot(start, stop, A, harms):
    """start, stop, amplitude, harmonics"""
    loop = int()
    superpos = []
    
    for n in arange( start, stop, 0.01 ): #Create list of zeros
        superpos.append(0)
    for i in range( 0, len(harms) ):
        plot_list = []
        domain = []
        loop = 0
        for x in arange( start, stop, 0.01 ):
            funcval = A[i] * sin( harms[i] * x )
            plot_list.append( funcval )
            domain.append(x)
            
            superpos[loop] = superpos[loop] + funcval #sum of funciton values
            loop += 1

        #plot( domain, plot_list) #show each harmonic
    plot( domain, superpos )

#sinamp = gauss(harmonics, sigma)
#print sinamp
#harmonic = range(1,harmonics+1)
try:
    for i in (1,2,3,4,5):
        sinplot(-rng, rng,
                gauss( harmonics[i],sigma[i] ),
                range( 1,harmonics[i]+1 )
                )
except:
    print("Graphing...")
    show()

The program generates this
The plot shows the sum of harmonics of a wave function, with each increasing harmonic having a decreasing amplitude that varies as a gaussian function, with a specific sigma value. The blue plot has a sigma value of 1, the green plot has a sigma of 5 and the red plot has a sigma of 10. This shows that by using the right amplitudes and numbers of harmonics, the superposition of waves can model a wave packet.
We can then use this to answer some questions
 a. The graph is a straight line
b.
c. 1*L
d. 2*L
e.
f. 6.63e-34 = h
g. 6.63e-34 = h

Modern physics: Relativity of Time

In this lab, we looked at some Modern Physics simulations and answered questions about them related to relativity of time in relation to distance and velocity.
Question 1: Distance traveled by the light pulse
   How does the distance traveled by the light pulse on the moving light clock compare to the distance traveled by the light pulse on the stationary light clock?
Ans: The distance traveled is greater on the moving light clock than on the stationary clock

Question 2: Time interval required for light pulse travel, as measured on the earth
  Given that the speed of the light pulse is independent of the speed of the light clock, how does the time interval for the light pulse to travel to the top mirror and back on the moving light clock compare to on the stationary light clock?
Ans: The time for the moving clock is greater than for the stationary clock

Question 3: Time interval required for light pulse travel, as measured on the light clock
Imagine yourself riding on the light clock. In your frame of reference, does the light pulse travel a larger distance when the clock is moving, and hence require a larger time interval to complete a single round trip?
 Ans: No, from your frame, the distance is still 2x the distance between mirrors so it takes the same time.

Question 4: The effect of velocity on time dilation
Will the difference in light pulse travel time between the earth's timers and the light clock's timers increase, decrease, or stay the same as the velocity of the light clock is decreased?
Ans: The difference will become smaller as the velocity of the light clock decreases

The relationship between the time interval measured by an observer and the proper time interval is:
Δt = γΔtproper
where γ is related to the relative velocity between the observer and the clock measuring the proper time interval via
γ = (1 - v2 / c2)-1/2
Question 5: The time dilation formula
Using the time dilation formula, predict how long it will take for the light pulse to travel back and forth between mirrors, as measured by an earth-bound observer, when the light clock has a Lorentz factor (γ) of 1.2.
Ans: This is simply γ*Δt_proper = 1.2*(6.67μs) = 8μs

Question 6: The time dilation formula, one more time
If the time interval between departure and return of the light pulse is measured to be 7.45 µs by an earth-bound observer, what is the Lorentz factor of the light clock as it moves relative to the earth?  
Ans: γ = Δt/Δt_proper -> 7.45/6.67 = 1.12

CD diffraction

In this lab we measured the width of the grooves in a CD by using the principles we know about laser diffraction

The distance between these groves is far too small for a the human eye to measure. With diffraction however, we can measure the distance between observed maxima on the diffraction pattern resulting from a laser (λ = 670 nm) reflected off of a CD. The grooves in a cd act as a reflection diffraction grating, so the distance from the center to the m'th maximum can be found as sin(θ) = mλ/d where d is the groove spacing.
Our data was as follows:
After plugging in all the numbers, we got an average d of 2.7*10^-5 meters
We had a very large error which probably due to the fact that our laser might not have been perfectly incident on the diffraction grating (ie, flat spot on the cd), and we are getting thin film interference from the plastic disk.