You are on page 1of 8

Excel Notes

Phys244

© 2005, B.J. Lieb

Calculating Velocity

V =

Y

t

Calculating Velocity V = Y t •The velocity is calculated by entering the following: =(B3-B2) /

•The velocity is calculated by entering the following:

=(B3-B2) / (A3-A2).

Calculating Velocity V = Y t •The velocity is calculated by entering the following: =(B3-B2) /

•Then drag the box in the lower right corner of the cell down to calculate other values.

•Note that there must be one fewer velocity value than position value.

Useful Functions

•Excel has a number of functions that are useful in PHYS

244

• = SUM(A1:A10) — calculates the sum of the data in cells A1 to A10

• = AVERAGE(A1:A10) — calculates the average of the data in cells A1 to A10 • = STDEV(A1:A10) — calculates the standard deviation of the data in cells A1 to A10 • = SQRT(A1) — square root of number in cell A1.

• = ROUND(A1,3) — rounds the number in cell A1 to three significant digits.

Excel’s Trig Functions

•You are likely to use SIN(A1), COS(A1), ASIN(A1) and

ACOS(A1)

•Trig functions in Excel assume the argument is in radians.

• = Radians(A1)– assumes that the value in cell A1 is an angular measurement in degrees and converts it into radians.

• =SIN(RADIANS(A1)) – converts the value in cell A1 into radians and then takes the sine of it.

Least Squares Fitting

•The least squares fitting method minimizes the sum of the squares of the differences between the data points and a theory curve

•When working with linear data, the lab manual often asks you to insert a trendline and then do a linear regression

•The difference between the two operations in Excel is that the

•trendline plots the theory line on your graph

•the linear regression gives the uncertainties in the fit parameters.

•You will want to do both

Linear Regression

•In Excel, to do a linear regression you must have selected a cell, not a graph

•In Excel, the Data Analysis Tools must be installed •Select “Tools>Data Analysis>Regression

SUMMARY OUTPUT

Intercept

Regression Statistics

Multiple R 0.987261 R Square 0.974684 Adjusted R 0.973101 Standard E 0.295571 Observatio 18 ANOVA df
Multiple R
0.987261
R Square
0.974684
Adjusted R
0.973101
Standard E 0.295571
Observatio
18
ANOVA
df
SS
MS
F
ignificance F
Regression
1
53.81518
53.81518
616.001
3.35E-14
Residual
16
1.397795
0.087362
Total
17
55.21297
Coefficientstandard Err
t Stat
P-value
Lower 95%Upper 95% ower 95.0%pper 95.0%
Intercept 2.856962 0.13372 21.36519 3.45E-13 2.573487 3.140436 2.573487 3.140436
X Variable -9.999313 0.402883 -24.81937 3.35E-14 -10.85339 -9.145239 -10.85339 -9.145239
Linear Regression •In Excel, to do a linear regression you must have selected a cell, not

Slope

Uncertainties

Graphs

•Plot experimental data as points or points with error bars •Plot theory as continuous lines—usually this is done using the “trendline” feature •To add error bars, double click on a data point and select X or Y error bars. (Do this before you add a trendline.) •Trendlines can be linear, logarithmic, polynomial, power, exponential or a moving average. •When adding trendlines, select the options to display equation and R 2 . •The equation of the trendline gives the fit parameters. •R 2 is a measure of the goodness of fit and R 2 =1 is optimal.

Graphs

Velocity vs. Time 4.00 3.00 y = -9.9993x + 2.857 R 2 = 0.9747 2.00 1.00
Velocity vs. Time
4.00
3.00
y = -9.9993x + 2.857
R 2 = 0.9747
2.00
1.00
Equation of
trendline —
note that
Velocity
0.00
Linear Fit
0.000
0.100
0.200
0.300
0.400
0.500
0.600
-1.00
-2.00
-3.00
parameters
are the same
as linear
regression
on previous
slide.
-4.00
Time (seconds)
Velocity (m/s)