Graphing Module II Table of Contents

advertisement
Graphing Module II
UCCS Physics Labs
Table of Contents
Error bars
Equation of Straight line
Best-fit line with error bars
Plotting an equation
FYI
FYI
On average, 100 people choke to death on ball-point pens every year.
Graphing Module II - 1
2
3
7
7
Error in Graphs - “Error bars”
We have already talked about how to record an error inherent with any
measurement. Now the question is how do we graphically represent the error?
The point on a graph is the data itself. We also need a way to graphically show
the uncertainty in that data point. The solution is error bars. Error bars are the lines that
extend from the data point a distance equal to the value of the uncertainty. A data point
is made up of two parts, the x coordinate and y coordinates. Both coordinates can contain
uncertainty. Therefore, error bars can extend away from the data point in both directions.
Any point within the error bars is a valid value for the data point.
Below is a sample set of data with error and the resulting graph.
Close-up of error bars
extending from a data point.
Only an example. Each
situation will be different.
Graphing Module II - 2
The Equation of a Straight Line
At this point all you know is how to plot data points. For a graph to become truly
useful we need to find the function that interrelates the data points. The simplest
functional relationship is the linear relationship. A linear relationship will produce data
that lie along a straight line. The data points will most likely not lie perfectly along a
straight line because of error in the measurements. We will need to make a line that
“best-fits” the data, which is called… a “best-fit line”, surprise! Let’s try an example
now. Examine the following graph:
y
These two lines are other
possible “best-fit lines” for
this data. They don’t appear
to do as good of a job
representing all the data as
the solid black line.
This line divides the data
points evenly. The line also
gives the general trend the
data is following.
data points
x
0
Drawing a best-fit line is an art form that you will quickly learn. Just remember
that the best-fit line should be as close as possible to all the data points.
Graphing Module II - 3
Equation of the best-fit line
Once we have a best-fit line, we need to know how to represent it mathematically.
A line is a functional relationship between the two variables plotted on the vertical and
horizontal axis. The equation of a line is as follows:
y=mx+b
y ⇒ the variable located on the vertical axis.
m ⇒ the slope of the line. (Explained below, wait for it!)
x ⇒ the variable located on the horizontal axis.
b ⇒ y-intercept. (Also explained below, try to be more patient!)
To find the equation of any line is to find the value of the slope and the y-intercept.
The slope (m) represents how rapidly the line will rise or fall, the larger the value
for the slope the steeper the line. If the value of the slope is positive, then the line will be
increasing in y as x is increasing. If the slope is negative, the line will be decreasing in y
as x is increasing. If the slope is zero the line will not increase or decrease but will stay
at a constant value of y no matter the value of x.
The y-intercept (b) is the value of the vertical axis where the line intersects that
axis. If the line does not reach the vertical axis, then simply extend the line until it does
and record the value.
The slope is defined by the ratio “rise over the run”, which is how many vertical
units the line will “rise or fall” divided by the number of units the line will “run” in the
horizontal direction. A more mathematical way of looking at the slope is:
The change in the y coordinate (∆y) divided by the change in the x coordinate
(∆x) as you travel along the line.
Graphing Module II - 4
Let’s try calculating the slope of a straight line:
To find the “rise” or the ∆y, just take the difference between the two y coordinates:
“rise” = 3.8 m - 1.5 m = 2.3 m
To find the “run” or the ∆x, just do the same difference calculation for the x coordinates:
“run” = 4.3 s - 1 s = 3.3 s
Now to find the slope divide these two numbers:
slope =
" rise" 2.3 m
=
= 0.7 m
s
" run" 3.3 s
Graphing Module II - 5
Some tips and tricks for calculating the slope
•
Try to spread out the two points you are using to calculate the slope over the
length of the line. This will give a more accurate slope calculation.
•
Remember you are measuring the slope of the line, so use the x and y
coordinates of the line.
•
If it is possible use the coordinates of data points that lie on the line. This will
reduce any extra error gained in reading coordinates off the line because you
already have the exact coordinates from the data.
We now have a value for the slope of our line. All we need to complete the
equation of this line is to find the value of the y-intercept (b). This should be a simple
task. The line crosses the y-axis at a value of about 0.8 m, so b = 0.8 m.
The equation of a line is:
y=mx+b
Filling in the values for the slope and the y-intercept from our example gives:
y = (0.7 m ) x + 0.8 m
s
Graphing Module II - 6
That’s it!
Find the best-fit line with error bars
If your data contains a known error, finding the best-fit line isn’t any different.
You still have to draw a line so that it is as close as possible to all the data points, or at
least the error bars. Error bars represent all the possible values for that data point, so you
have a little bigger target for the best-fit line.
Example:
The line comes as close as possible to
all the data points and/or error bars.
Plotting an equation
In many cases, once you have the equation of the best-fit line, you will need
something for comparison. What we would like to compare our best-fit line to is the
expected result (theoretical function). For an easier comparison we need to plot this
function on the same graph as our data. What we have at this point is the theoretical
function, but no data, and therefore no way to plot a line. To generate data, assign a
value to one of the variables and then get out your calculator and algebra book and solve
for the remaining variable. Repeat this process until you have enough data points to draw
a line connecting the data points.
Graphing Module II - 7
Let’s try graphing this theoretical equation:
y=2x+4
Let’s assign values to x and solve for y. This will limit the amount of math steps
needed to get the data. You can assign y values and solve for x. This will give the same
results, but it will just be more work.
y
assign
calculate
x
y
0
y = 2(0) + 4 = 4
1
y = 2(1) + 4 = 6
2
y = 2(2) + 4 = 8
4
y = 2(4) + 4 = 12
10.2
y = 2(10.2) + 4 = 24.4
You can assign any
value you want to x,
but integers seem to
make the math easier!
24
22
20
18
16
14
12
10
8
6
4
2
x
0
1 2 3 4 5 6 7 8 9 10 11
Your best-fit line should lie exactly over the data points. Remember, it was an
equation of a straight line you were graphing in the first place!
Graphing Module II - 8
Download