Excel for Physics

advertisement
Excel for Physics
Excel and other spreadsheets provide a way of quickly doing repetitive
calculations for data analysis or modeling. They also allow quick ways of
producing graphs and the equations which best fit them. This not will talk
about the basic functions of spreadsheets useful to physics students.
Data tables:
Data tables can be quickly and neatly
produced by simply entering the titles for
the columns in the first row and the
numbers in the columns below them:
Highlighting the area as shown at right and
going to File, Print Area, Set will set the
table to print and then using File, Page
Setup, select Gridlines to have the cell
boundaries print to make the table:
Then print the table.
Calculations:
The cells in the spreadsheet can be used as variables in calculating. In the
example table above, Cell B2 is -3 and cell B4 is -3.5. To find the
displacement or change in position, take (-3.5) – (-3) = -0.5. In the
spreadsheet, you could enter, in cell C4, the formula = B4-B3. This will give
you the displacement and will recalculate it if you enter new data! To
calculate displacements for the rest of the data, click on cell C4, move the
mouse to the lower right corner until the cursor changes to a +, click and
drag down the column. All the other calculation cells will be filled in. Other
calculations are similar:
Addition:
Division:
Multiplication: square of a number:
=B4+B5
=B4/
=B2*B3
=B5^2
Several other functions are also available:
average : =Average(B2..B13)
standard deviation: =stdev(B2..B13)
sin(C4°) :
=sin(C4*pi()/180)
The calculation inside parentheses converts the number in C4
from degrees to radians; so
sin(30°) = sin(30*pi()/180)
Graphing:
For our purposes, we will always use x-y scatter plots in this class.
Highlight the columns of data to be plotted and click the chart wizard icon,
shown highlighted at
left. In the resulting
menu, choose XY
scatter, as circled in
red. Then follow the
menus to create a
graph.
To add a best-fit curve, click on Chart, Add Trendline :
Clicking on
the
trendline
will give a
menu of
curve
choices:
To put the equation on the chart, click on the
options tab and check the box next to Display
equation on chart, as shown in the menu
image at left.
Logger Pro Program
Many of the experiments use the Labpro interface and Loggerpro software
to collect data. This short description will show you the most frequently
used commands and how to find them in the menu structure.
The menu bar and icons for the program are shown below.
The icons on the left are the usual file and print icons. If a graph on the
screen is chosen, the print icon will print the graph. The icon under “Help”
showing an A inside a square is the autoscale icon. clicking this when a graph
is chosen will scale the graph so the data trace fills the majority of the
graph area. The rightmost icon says Collect when the program is not
running and says Stop when it is collecting data. Clicking this begins
collecting data.
Sometimes it is necessary to set up an experiment, choosing sensors,
collection times and frequencies and perhaps which graphs to display.
Sensors are usually sensed and identified automatically. To select sensors,
select positive directions, click on Experiment, Show Sensors to get the
menu below. To set up a sensor, click on the sensor in the column on left or
right and drag it to an empty square next to the Labpro image which
corresponds to the port the sensor is connected to.
Right
clicking on
the sensor
after this
allows you
to set
direction,
zero and
calibrate
the sensor.
There are other parameters which can be adjusted in the experiment menu.
Clicking on Experiment gives the following menu:
The other frequently useful command in the
Experiment menu is the Data Collection
command. Clicking this gives the following menu:
This menu
is useful
for setting
the length
of time
data is
collected
and how
frequently the interface reads the
sensor.
The other main portion of setting up an experiment is to select what
quantities to graph. To do this, click Insert and Graph.
A new graph will appear as a new window which can be
resized and moved. The variables on the plot can be
changed to others by clicking on the axis labels and
choosing the desired variable from the list which pops up.
The scale can be changed by moving the mouse so the
cursor is over the highest or lowest value on the axis.
When the cursor changes to I , type in the desired value
and the graph will rescale.
Analysis:
Once the data are collected and you are happy with
them, you can analyze them in several ways.
Clicking on the Analyze menu on the bar will give
the menu at right.
Examine gives a cursor which follows the curve
and a box which displays the x and y values for the
point on the curve.
Tangent changes the cursor to a line segment and
the readout to give the x value and slope of the
tangent.
Integral will give the area under the curve for the
area highlighted on the graph. To highlight an area, click on the graph and
drag to the other end of the desired region. The area chosen will be shaded
gray.
Statistics will calculate the mean and standard deviation of the y values in
the shaded area.
Linear Fit or Curve Fit will give a best fit to the highlighted data and give
you the equation for the best fit curve.
Those are the basics to get you up and running, as other commands are
needed for specific experiments, you will be told how to use them. You
should also feel free to explore other features if they seem useful.
Download