You are on page 1of 4

Lab 0

Graphical Methods

Lab 0 is not an experiment. The purpose of this meeting is to introduce you to the course and to
make sure you are familiar with the software we will use for the remainder of the semester.

Introduction
Graphical techniques are essential in experimental physics. Although much can be learned with
pencil, graph paper, and a ruler, computer graphics offers tools that both simplify and improve
graphing and plotting. Learning to use these tools early in your career will be repaid both in time
saved and in the production of clearer, more informative results.
The exercises here will review some common graphical techniques and provide practice in using
computers for plotting and analysis. The directions here and in Appendix C refer to Excel,
one of the most common spreadsheet programs. It is available for both Mac and Windows, but
all spreadsheet programs provide similar functionality. You can use whichever you find most
convenient.
The lab computers run Mac OS X. They are unstable enough that you should be fearful of losing
your work. You are encouraged to save your work often.

A good plot should be able to be understood without much supplement from the reading. It
must have a descriptive title and axis labels. If you fit a distribution, you must include the
fit equation and its R2 value on the plot (R2 is a quantitative representation of how well a fit
describes a set of data). If there is more than one data set on the plot, you must include a
legend on the plot.

1
Exercises
1. The motion of a cart along a track was measured with the results in the following table1 :

t(sec) 0 1 2 3 4 5 6 7
x(m) 1.1 1.5 1.9 2.6 3.0 3.5 4.1 4.5

Using graph paper, plot x(t). What is the apparent relation between x and t? With a ruler, sketch
a good linear fit to the points and calculate the slope of the line. Calculate the equation of your
line in the form

x(t) = mt + b, (1)
where m is the slope. By eye, sketch the lines of maximum and minimum slope that could be
plausible fits. Calculate the range of slopes,

m = max(m) min(m). (2)


Where max(m) is the maximum slope that fits the distribution and min(m) is the minimum slope.
These are crude estimates, but m is a rough indication of uncertainty in the slope. Any numbers
you calculate using m will thus have a rough uncertainty calculated from m. Now plot this data
using a computer. Add a linear fit to the plot. How does it compare with the equation from your
hand-drawn graph?
2. An object is thrown upwards and the position is measured as shown in the following table (with
the same precision as in the previous case):

t(sec) 0 0.5 1 1.5 2 2.5 3 3.5 4


h(m) 1.5 21 35 50 61 70 77 81 82

Plot h(t) with a computer. Does the plot look linear? Fit a quadratic function to the curve. Does
the parabola seem like an adequate fit? Plot t(h) using the same points (reverse the dependent
and independent variables). Fit a quadratic function to this new curve. Is this fit better or worse
than the fit for h(t)? What happened?
3. The x, y coordinates of a puck on a table are measured at a sequence of times and found to be
as follows:2

x(m) 0.01 0.03 0.05 0.07 0.09 0.11 0.13 0.15 0.17
y(m) 0.010 0.027 0.043 0.055 0.066 0.074 0.079 0.083 0.083
1
As you may have noticed in homework problems from the lectures, the values given may have greater precision
than indicated. These times are from the cameras we use in this lab, which have an accuracy of 1 ms.
2
Distances have an error of 2 mm.

2
Plot y(x). Is the plot linear? Explain how you know (Because it isnt is not a good response,
reinforce your statement using the R2 value of a linear fit and, if possible, demonstrate how the fit
can be improved with a polynomial).
4. The x, y coordinates of a puck on a table in a second experiment are measured at a sequence
of times and found to be as follows:

x(m) 0.010 0.031 0.052 0.075 0.098 0.123 0.148 0.175 0.202
y(m) 0.010 0.019 0.026 0.031 0.034 0.035 0.034 0.031 0.026

Plot y(x). Is the plot easily described or fitted? Assume that this data represents the position
of the puck from snapshots with uniform time intervals. Plot y(t) and x(t), where the time is in
arbitrary units (with equal intervals to high accuracy). Describe the plots.
5. The x, y coordinates of a puck on a table in a third experiment are measured at a sequence of
times and found to be as follows:

x(m) 0.021 0.032 0.058 0.111 0.182 0.269 0.38 0.51 0.66
y(m) 0.029 0.206 0.33 0.406 0.431 0.402 0.33 0.205 0.031

Plot y(x). Is the plot easily described or fitted? Assume that this data represents the position
of the puck from snapshots with uniform time intervals. Plot y(t) and x(t), where the time is in
arbitrary units (with equal intervals to high accuracy). Describe the plots.3
6. An object was dropped with results as given in the following table:4

t(sec) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7


y(m) 0 0.06 0.21 0.42 0.85 1.26 1.79 2.51

Make a plot of y(t). Our hypothesis is that

1
y(t) = gt2 . (3)
2
To evaluate this hypothesis, fit y(t) with a quadratic function. Compare your fit with the hypothesis
and report a value of g. Does our hypothesis look reasonable? Note that it is not easy to estimate
the uncertainty in g using this quadratic plot.
One way to convert the fit to a straight line would be to perform a change of variable, u = t2 .
Plot y(u) and estimate the best fit for g, along with an estimate of its uncertainty from m (recall

Equation (2)). An even more useful linear plot is y(t). Plot this function and estimate g and its
uncertainty. Compare your calculations of g (including uncertainty) from all three plots.
3
This simplifying analysis is possible only if the timing is known. In general, y(x) data for a trajectory has no
associated time information, and more complex analysis is required.
4
Precisions are associated with those given in Exercise 1.

3
7. Excel offers a wide variety of functions that are quite useful. The following exercise will guide
you through using functions and will result in generating plots of a general sinusoid

y(t) = A sin(t + ) . (4)

Open a new excel spreadsheet and begin reproducing the spreadsheet in the figure on this page.
Be sure to press Enter or Return after placing the indicated contents in each cell. In row 2, cell B2
contains Angular Frequency, C2 contains =PI()/10, E2 contains Amplitude, F2 contains 2,
H2 contains Phase, and I2 contains =PI(). In row 4, A4 contains Time and B4 contains y.
Enter 0 in cell A5. Select A5 again and go to Edit > Fill > Series. In the popup box, select
Series in columns, step value 1, stop value 100, then return. The Time column should now
contain the integers from 0 to 100. In cell B5, you should enter the formula as follows:

= F$2 SIN(C$2 A5 + I$2) (5)

This is the formula for y(t). To complete the y column, select all the cells from B5 to the end of
the t data. Choose Edit > Fill > Down. The column will fill with the y(t) data. To see what
happened, select one of the cells, say A10. You will see that the constants are unchanged, but A5
has become A10. The excel fill operation will duplicate constants and increment cell indices. The
$ in the formula above instructs excel to not increment those indices, and you should experiment
with this function of excel to become more comfortable with it. The top part of the completed
spreadsheet should look like the picture below. Two features are apparent. First, only numerical
values appear in the cells. If the number is the result of a formula, that can be seen only by
selecting the cell and inspecting the Formula Bar, which appears at the top of the screen with the
excel menu and other toolbars. Second, values that should be zero are nonzero, albeit extremely
small. This is an indication of the numerical accuracy of the functional calculations in excel.

Make a plot of y(t), and explain what each of the constants in row 2 do on the plot (experiment
by changing each of the constants (one at a time), and note what happens to the plot). 5 See how
easy it is to change the plot parameters once you have constructed the spreadsheet. Constants
entered in formulas may be changed by addition, subtraction, multiplication, division, or other
changes in the formula. Constants entered as numbers may only have different numbers entered,
although if you had entered =2 instead of 2 in cell F2, you could change it to =2/3 or =2*2,
retaining a sort of memory where you started.
5
You will note that the argument of SIN() in excel is measured in radians.

You might also like