Lab notebooks and diatomic molecules
Dear Students,
Sorry I haven’t responded to each individual request to stop by to look at your exam, pick up your last homework, lab notebook etc. My collective response is: stop by anytime! For the next week, I’ll make a point of being in or around my office before 12:30 and after 2:00, so you can stop in on the way to or from your PY 252 lecture. I expect you can use your lab notebook from PY251 for PY252 if you have enough blank pages.
One last bit of unfinished business. As you saw in the last problem of the last homework, sometimes an experimental measurement leaves you in a gray zone. The simple measurement of the oscillation in the Ruchardt apparatus did not clearly distinguish gamma for diatomic and monatomic molecules. The cause was the fairly strong damping. This has the effect of shifting the measured period to shorter times. Here is the result of a fit to the data using the exponential decay form:
gnuplot> y(x)=A*cos(omega*x+delta)*exp(-alpha*x)+C
gnuplot> fit y(x) ‘cpcv-old.txt’ via A,omega,delta,alpha,C
A = -0.612613 +/- 0.01169 (1.908%)
omega = -5.86622 +/- 0.01262 (0.2151%)
delta = 5.58579 +/- 0.01602 (0.2869%)
alpha = 0.523474 +/- 0.01373 (2.622%)
C = 103.096 +/- 0.002086 (0.002024%)
The fit value for omega gives a period of 1.1 seconds instead of 1 second, which lowers gamma by 1.1 squared to 1.33+-0.07 The estimate of the period is no longer the dominant uncertainty. I roughly find the rest from my solution to add up to about 5%. So using a better model, we find a result completely consistent with air being diatomic (gamma=1.4) and inconsistent with it being monatomic (gamma=1.66).
That’s a relief. I can breathe easy now.
Be good.
Ed Kearns
PY251 FINAL
Dear Students,
I hope you have some productive studying time. Let me remind
you that the exam review is posted. The final will have a look-and-feel
similar to the 4 discussion quizzes and the midterm. You do not have
to memorize any physical constants. Moments of inertia of regular
solids will be provided. Few, if any, formula will be provided, with
the exception of Bernoulli’s Law which I promised, and from which you
can remind yourself of other useful forms.
Don’t stay up too late! This final is at 9 AM = NINE O’CLOCK in the
MORNING. Get enough sleep, get up in plenty of time to make it
to the classroom. I have not heard of any reports of sickness, so I
expect everyone to be there. If you are hit by a bus, I want to see
the accident report!
When you get to the room, please spread out like an ideal gas so
that proctoring is easy.
Best wishes for a successful exam. Make me proud!
Ed K.
Equal Loudness
I forgot to go over this graph in class. It is called the Fletcher-Munson equal loudness graph. The idea is that along the contours, a human perceives equal loudness as a function of frequency. So the threshold of hearing, which we refer to as 0 dB, actually depends on frequency. The actual intensity at the threshold of hearing is 100x higher at 150 Hz than 2500 Hz, as seen by tracing along the bottom contour. Recall that 100x higher in W/m2 corresponds to 20 dB (10 times log 100).
Tutorial: Fitting Data with GNUPLOT
In an earlier problem, you learned how to use gnuplot to graph a particular function. In this example, we will learn several new techniques. First, we will learn how to create a file that contains all of the commands needed to make a graph. This is clearly required for serious work, you can’t be typing in from scratch all of the time. Second, we will plot discrete data, from a file. Here it will be a few points, but in a more serious experiment it might be thousands. Third, we will “fit” the data to a specified function, and extract the parameters. This is a technique that you will surely encounter again. A good work flow is to have an editor window open where you tinker with the contents of the file. Then you save and execute the gnuplot command:
gnuplot> load "myfile.txt"
How do you make such a file? On Windows, use a simple editor such as Notepad or Wordpad. You want to save just the text, no formatting (like fonts or boldface etc). As far as I could determine, Notepad is quite determined to put the extension .txt on your file, even though standard naming convention would suggest something else. No matter, myfile.txt will suffice.
In this command file, you should do a few things. First, “comment” your file and put your name and date. It’s just good practice. You can also comment certain commands. A comment line begins with a pound sign. So here is an example:
# gnuplot file to plot and fit data for a mechanical resonance
# lines beginning with the pound-sign are comments
# it is advisable to comment your code
# Ed Kearns, Nov 4, 2008, PY 251
# I like a grid
set grid
# mass is 0.035 kilogram
m = 0.035
OK, so make command file and make a simple graph. Maybe plot sin(x), just to get the hang of things. A possible error you may encounter is “file not found”. Gnuplot keeps track of a current working directory, which you can set from a menu item, or from the command line using the “cd” command.
Next, we need to learn about plotting data points and not just a function. The data has to come from a file, another text file that you create with Notepad or Wordpad. For our application, create a data file with three columns. The first is x, the second is y, and the third is the error bar in y. When I measured the amplitude of the driven oscillation, I guessed that my uncertainty was 1 cm for all the data points. So here is the data, in a text-file named yellow-ball-data.txt.
# Forced oscillation data. Yellow ball demo. # omega amplitude error # rad/s meters meters 6.28 0.04 0.01 6.41 0.06 0.01 6.53 0.11 0.01 6.66 0.22 0.01 6.79 0.22 0.01 6.85 0.16 0.01 6.91 0.06 0.01 7.54 0.04 0.01
Note that you can put comments in the data file and gnuplot ignores them when it parses the file. To plot the data, here is the gnuplot command:
gnuplot> plot "yellow-ball-data.txt" with yerrorbars
You can learn about plotting options from online documentation, FAQs, tutorials, and websites with examples, all easily found by google. But you can also quite conveniently learn from built in help. Try:
gnuplot> help plot
OK, you have plotted the data. Don’t forget to make it look decent with commands like “set xlabel” etc. Now, on to fitting. First, you need to specify a function to fit. The fitting routine will use a smart trial-and-error on the parameters of the function until it achieves a good fit. The mathematical details of fitting is beyond the scope of this tutorial. You can tell it worked if you overlay the fit on the data, which we will do at the end, and it looks good.
For this example, we want to fit the amplitude of driven oscillation, which is given in your text and was derived in class. Here it is.
# amplitude of mechanical resonance y(x) = (F0/m)/sqrt((x**2-w0**2)**2 + b**2*x**2/m**2)
Note that I specified the mass m as the fixed value that we measured. That will allow me to extract the force F0 from the result of the fit. The parameters of the fit are F0, w0, and b. The fit is executed by this command:
gnuplot> fit y(x) 'yellow-ball-data.txt' via F0,w0,b
You will see a lot of numbers scroll by on your screen, these are the trial-and-error steps of the fit. The last set has the results. I wonder if they are good? You can check, by plotting them:
gnuplot> plot y(x),'yellow-ball-data.txt' with yerrorbars
Doesn’t look good? One of the tricks with fitting algorithms is to get them off to a good start. If the initial values of the parameters are far from the best fit, it may not find the best fit. You can help by specifying good starting values. For example, you can easily see that the resonant frequency, omega_0, is near 6.7 radians/s. If the fit looks bad, specify some initial values, for example:
gnuplot> w0 = 6.7
Then execute the fit command. The value stored will be changed by the fitting program (which you can see by typing the command “print w0″). The fit results are all printed at the end, automatically. Note that the program did the work of propagating errors and reports the uncertainty in each parameter. Life is good!
So that just about does it. This tutorial really walked you through the homework problem, but that is OK. These skills will hopefully prove useful to you over the next four years. If you move on to another program besides gnuplot, the principles are fairly universal, even if the details are not.
Midterm Results
Here are the midterm results. First is a graph of the exam scores. Pretty good job! The mean was 80 points, probably the highest of any exams I have ever given. I think it was a bit on the easy side. Only one 100% score, congratulations Lina!
I have also calculated your total points so far. It is out of 41.2 percent, taking into account the remaining points for the next 7 homeworks and 4 labs and final exam. As promised, I took the 2 discussion quiz scores plus your 4 midterm question scores, each of which was worth 25 points, and dropped the lowest of those 6 scores. For labs I temporarily took into account missing labs. By the way, if you have missed one lab, you really better not miss another, otherwise you will have a painful makeup session at the end of the semester! You really should do each lab the week it is offered, even if you have to attend another section.
The distribution of total scores is grouped by my very approximate and conservative guess at letter grades: D/C/B/A. I will worry about + and - at the end of the semester, and I will also look much more carefully at the best and fairest places to make divisions. But this should give you some idea of where things stand.
-Ed K.
This week in PY 251
Hello,
* Tuesday’s lecture is on Gravitation. Read chapter 9.
* Solutions and new homework are posted.
* Discussion quiz this week.
* Thursday’s lecture is a review. I am open to suggestions and requests!
* No class next Tuesday; Midterm on Thursday.
See you tomorrow,
Ed Kearns
PDF file format
Dear Students,
Here are some notes about the PDF file format. PDF stands for Portable Document
Format, and is a good way to make platform independent files for final hand-in
for any course. So it is worth your while to figure this out. You may have noticed
that the Homeworks I post are in PDF format and the scanned handwritten solutions
are in PDF format. I keep most of my research papers (eg. from journals) on my
computer in PDF format. Indexing software such as Spotlight (Mac) and Google
Desktop will index the PDF files and make them searchable.
Saving as PDF is often found under the printer menus, since it is closer to a printing
function that a “Save As” function. For example, you probably can’t open a PDF file
of a spreadsheet or word processing document back for editing.
If you have Mac OS, PDF writing is built in. If you are using Linux, you probably don’t
need my help. It seems mostly to be an issue for Windows users.
The BU personal computing support center has some words about saving as PDF:
http://www.bu.edu/pcsc/desktop/acrobat/
They suggest you get Acrobat (full version, not reader) from University Computers.
They list Acrobat Professional for $69. You don’t need most of that power, Acrobat
Standard will do, but I don’t see it listed.
If you are using Microsoft Office (i.e. Excel, Word), Microsoft seems to offer an
add-on for saving as PDF. This is my first recommendation.
There are also third party software offerings with funny names like CutePDF etc. These
may be OK. After browsing around a little, it looks like the open source PDF Creator
is a reliable option. (Watch out for imitators). Here is a helpful link:
http://en.wikipedia.org/wiki/PDFCreator
Best regards,
Ed K.
Solutions 4, Quiz 1, Homework 5
Dear Students,
I hope you had a nice weekend. I see some of you have uploaded your solution to the
numerical homework problem already. If you haven’t please remember to do so. To
set a firm deadline, let’s make it due 9 PM Monday. So you can upload in the AM
before you leave your room, or in the evening after you get back. I will apply a
firm cutoff at 9 PM.
I have posted this week’s homework. I think it is a good idea to look over the problems
before lecture so you know what to watch and listen for. I also posted the solution to
last week’s homework.
I posted the solutions to the discussion quiz and entered your grades. The average was
just under 20 points. Nine students got 24 or 25 points. So many of you are obviously
“getting it”. If you scored fewer than 15 points, I believe there is cause for concern.
You should probably come see me. This quiz was definitely a warm-up to get you ready
for the midterm, but I would also say it was on the easy side.
See you Tuesday. More work and energy this week.
Ed K.



