Expt. 2 Graphing and Curve-Fitting
Expt. 2 Graphing and Curve-Fitting
Graphs in Analytic Geometry normally have four “quadrants”: above or below the
horizontal, left or right of the vertical axes. Most graphs in Physics use a single
“quadrant”; Above the horizontal and to the right of the vertical axes. Numerical scales
are placed along each axis. Numbers along the horizontal axis represent distances
measured to the right of the vertical axis. Likewise, numbers along the vertical axis
measure distances above the horizontal axis. A data item associates two quantities,
such as room temperature and time of day. On the graph, a single point represents this
data item; distance from the vertical axis proportional to time of day, distance above
the horizontal axis proportional to room temperature.
What about the range of numbers along any axis? The numbers should be
equally spaced. They need not start from zero. Rather, examine first the range of
data values along each axis, and from this, select the appropriate range values, so that,
as far as possible, your points cover most of the graph area. Graphs are more easily
constructed and read if the numerals are multiples of 2, 5 or 10.
The sample (wrong) graph shows temperature and time. Notice that for each
time value, there is only one temperature, while the same temperature may occur at
two or more different times (perhaps both morning and late afternoon). Here time is
said to be the independent variable, temperature the dependent. Normally the
independent variable is placed along the horizontal axis. Actually the temperature had
a definite value at every moment during the day, even though we have no data pairs for
this. Often a smooth curved line (temperature does not change abruptly during the
day) is drawn on the graph representing our “best guess” for the actual values. Do NOT
connect the points with short straight lines!
Curve-fitting
If we expect a linear relationship between the x and y coordinates of N points,
but admit that our measurements may not be too accurate, we might try to sketch a
“best-fit” straight line passing as close as possible to each point . Let the equation of the
supposed line be y = Ax + B, where A and B are constants, the slope and y-intercept
respectively. For any given point, [xj,yj] , its displacement is the vertical distance
between the point and the “best fit” line: yj – (Axj + B). This may be positive or
negative, as the point is above or below the line. For “best fit”, the sum of the absolute
value or of the square of these displacements should be a minimum.
The mean square displacement is the sum, given by (1), divided by N, the number of
points. The root-mean-square displacement, also called the standard deviation, is
just the square root of the mean square displacement and is a measure of the spread
of points about the “best fit” line. Of course the standard deviation depends on our
choice of A and B.
To find the magic A and B, the first step is the expand the mean square
displacement expression ( Eq. 1 divided by N):
Notice both expressions have the same denominator, the difference between the
square of the average and the average of the squares.
To find the standard deviation, substitute these A and B values into (3) and take the
square root.
Procedure:
1: Use the computer program CURV-FIT.EXE to generate your personal set of 10
data points, based on your own birthday. Print these or copy them from the screen
display.
3: Enter into the table below your [x,y] data values. With a calculator, fill in values for all
the remaining table locations.
5: Compute the %error of your A, B, and standard deviation values where your
manually-computed” values are the “experimental values”, and the “computer-
calculated” values are the standard values. Analyze if your experimental values are
accurate enough to be acceptable (i.e. 5% error).
6: Examine the best-fit line of your graph. What does it visually show or indicate about
the relationship between the plotted distance and time graph? What is the purpose,
therefore, of sketching the best-fit line of graphs? Include a brief discussion on this in
your data analysis.
*NOTE: In later experiments you will collect data and will need to display this in graphical form and find the
expression for the “best-fit” graph line. For this purpose, the computer program LEAST-2.EXE can be helpful. It
accepts up to 60 data pairs, and graphs the points and provides the best fit linear ( y = mx + b ) and quadratic ( y =
Ax2 + Bx + C ) equations. However, you need to master graphing the points manually before using the graphing
program later.
---Nothing follows.---