PHYC 262
Problem Sessions
Problem sessions will be held at the following times and locations:- Monday
- 1100–1200 in RH 111
- Tuesday
- 1000–1100 in RH 111
- Friday
- 1000–1100 in RH 111
Plotting Tutorial
I have included some code that can be used on the Sage notebook server to plot various functions we are discussing in class so you can play around with observing the effects of varying different parameters.
To start with, you will need to log into the Sage notebook server. You can either create a new account or log in using an OpenID provider such as Google. Once you log in, there will be a link near the top of the page titled New Worksheet
that you should use to create the worksheet we will be plotting on. Once you open up a new worksheet you will see an empty cell into which you can enter code. In the first cell, copy and paste the following and then press Shift-Enter
while your cursor is in the cell to execute the code:
This code will make an example plot showing the difference in the intensity pattern for a double slit experiment both with (green) and without (blue) the small angle approximation made. Values for theta are plotted from theta_min to theta_max. The sliders allow you to change values of L (the wavelength) from L_min to L_max and the values of d (slit separation) from d_min to d_max. You can change these ranges by modifying the values assigned to these variables in the first couple lines.
Another piece of example code is below:
This code makes a plot for single slit diffraction where you can adjust the wavelength and slit width with sliders.
You should be able to modify the lines with the lambda
keyword to different functions you want to plot. If you feel more ambitious, you can look at the Sage plotting documentation. If you have any problems getting this to work or any other questions feel free to email me.