(Button will not show in the printout) (Page uses the ActiveX component ScriptX to control printer settings)
<% session("flgPrint")=true %>

## Graphing

### Graphical Analysis:  Introduction

In any scientific work much time is usually spent in determining relationships between two quantities such as distance and time or voltage and current. Let us assume that during the course of an experiment a number of length (L) measurements were made for a number of different temperatures (T). One might then immediately wonder if there was some pattern (some relationship) between the two quantities L and T. Looking at only the numbers from the measurements, one would have difficulty in discovering any patterns. Hence one forms a pictorial representation, a graph, to display the data.

 Figure 1

The graph is usually prepared with the independent variable (the quantity that is varied or set by the experimenter) along the x-axis and the dependant or measured variable along the y-axis. In lab work, this might not be followed but is commonly followed in published work. Then if the data of Temperature and Length follows a linear relationship, a straight-line equation y = mx + b will describe the experiment and can be easily determined from the slope and intercept of a a graph fit. Note that the parameters are determined from the graph and not from the data.

If the graph of L and T does not follow a straight line but rather some sort of non-linear curve, then the analysis becomes more complicated. From the graph alone one can infer the general trend of the data and obtain unknown values by interpolation. However, this still leaves one without an exact description of what is happening in the experiment. In our situation we can only determine the equation of a straight line. Therefore, once we have established that a relationship does exist (ie. the data forms some sort of curve on the graph), then the objective is to find some way of transforming the data into a linear relation. This might be done by guessing as to what the relationship might be or by using some theory to suggest an equation or by using a little of both - theory and guesswork. The following are some of the standard relationships and methods used in analyzing them.

### Graphical Analysis

 Figure 2

When the relationship is suspected to be of a quadratic form L = mT2 + b then plotting L versus T2 should yield a straight line (figure 2). How well the graph follows a linear fit is an indication of how well the data follows a quadratic relationship. General scatter in the plotted points or noticeable trends (such as a curve) in the graph indicated the certainty of the fit.

For a suspected form of L = KTn one first takes logarithms of both sides lnL = nlnT + lnK and then plots lnL versus lnT which should yield a straight line (figure 3). Once the slope n and the intercept lnK have been determined then one must double check the values obtained by plotting L versus Tn which should yield a straight line with slope K. This is because logarithm graphs are very inaccurate.

Similarly for a suspected form of L = KaT , lnL = Tlna + lnK. Comparing this with the straight line equation (y = mx + b) on sees that a plot of lnL versus T should be linear. Again because of logarithms one must check this by plotting L versus aT. A special case of this equation (which does occur often in physics) is L = Kect where e = 2.71828... (the base of natural logarithms). This then on taking logarithms reduces to lnL = ct + lnK.

Note that natural logarithms are generally used in physics since in many cases (see, for instance, error analysis of logs) they simplify the math involved. Common logarithms will also work as well in most cases.

 Figure 3
 Figure 4

### Uncertainties in Graphs

Error Bars
To indicate the uncertainty of data on a graph on uses vertical and horizontal bars through the data point to indicate the range that the data might assume. For instance, $$5 \pm 1$$ would be a bar drawn from 4 to 6. When the uncertainty is too small to be indicated on the graph then a single point is used.

 Figure 5

Worst Fits
When determining parameters, such as slope, from a graph there is always an uncertainty associated with it - similar to making any sort of measurement. In determining the slope of a straight line graph one draws a best fit line. To estimate the uncertainty of the best fit one draws two worst fit lines. These indicate the largest and smallest slopes which might still reasonably fit the plot. The uncertainty of the best fit is then taken as half the difference between the worst fits. Note that the best fit may not lie exactly half way between the two worst fits.

Graph slope =$$m_{best} \pm \Delta m$$

where slope uncertainty is
$$\Delta m = \frac{1}{2}(m_{high} - m_{low})$$

A special case may occur when the best fit line hits all the points dead-on, so that drawing worst fit lines is unfeasible. The uncertainty in the slope is now determined from the reading error of the graph by treating the graph paper as a measuring instrument. This is done by considering the x-values as fixed and measuring the uncertainty in reading of the y-values from the graph (as read from the graph, not from the data). This uncertainty is then propagated through the slope calculation. Note that the uncertainties in the data points themselves are not used here and the error bars are too small to be visible on the graph.

$m \pm \Delta m = \frac{(y_{2} \pm \Delta y) - (y_{1} \pm \Delta y)}{x_{2} - x_{1}}$

### Slope Calculations with Worst Fits

 Show on the graph where the slope is taken from, by a triangle. Make the triangle as large as possible using two widely separated points on the line that are not from your original data. Do not use your original data to calculate slope. The slope that you are determining is of the line drawn (the data plotted no longer plays a role). State the graph points used when calculating slope using the point form for calculating slope. Clearly show the calculation of slope for all three lines (best and two worst). Then calculate the uncertainty from the two worst fit slopes. Figure 6 $slope ~m = \frac{y_2 - y_1}{x_2 - x_1}=\frac{29v - 15v}{110ma - 50ma}=\frac{14v}{60ma}= 0.23333\frac{v}{ma}$ $\text{worst high slope }m_{high}= \frac{y_2 - y_1}{x_2 - x_1}=\frac{31v - 15v}{110ma - 55ma}=\frac{16v}{55ma}= 0.2909\frac{v}{ma}$ $\text{worst low slope }m_{low}= \frac{y_2 - y_1}{x_2 - x_1}=\frac{28v - 15v}{110ma - 47ma}=\frac{13v}{63ma}= 0.2063\frac{v}{ma}$ The final slope uncertainty is $$\Delta m = \frac{1}{2}(m_{high} - m_{low}) = \frac{1}{2}(0.2909 - 0.2063)\frac{v}{ma} = 0.042 \frac{v}{ma}$$ The final slope is quoted as    $$m = m_{best} \pm \Delta m = (0.233 \pm 0.042)\frac{v}{ma}$$

### Slope Calculations with an exact fit

 Figure 7
An example of the special case where all the data points line dead on a line and the uncertainties are too small to show as error bars. Determine two widely spaced locations on the best fit by selecting an x value and reading the y value with a reading uncertainty from the graph scale. Do not use data points or data values that where used to plot the graph.

 slope = $\frac{(174 \pm 1) - (118 \pm 1) c}{(110-40)s}$ = $\frac{56 \pm 2}{70}$ = $\frac{56c \pm 3.6\%}{70s}$ = $0.800c/s \pm 3.6\%$ = $0.800 \pm 0.029 c/s$

It is important to emphasize that the slope with its uncertainty is calculated from the graph and not from data used to plot the graph.

### 3. Some Hints

Plotting

• graph in pencil
• a title and axis labels is required
• include units on each axis
• define all symbols on the graph itself
• use as full an area of the graph paper as will permit a reasonable scale
• choose a scale that is simple to use (multiples of 10, 20, 25, 40 or 50)
• for rough graphs speed of plotting is most important, so you may restrict the scale to multiples of 1, 2, or 5
• offset the axis to around the data plotted, include 0,0 only if it is part of you data
• do not break an axis to show an offset, simply begin the scale at the offset value. An offset shown as break in the axis is sometimes used in buisiness (eg. currency graph shown starting with $0 and then scaled$0.85 to $1.10). This is not done in scientific work (eg currency graph would be shown starting with$0.85 and scaled to \$1.10).

Graph Calculations

• In general, all slope calculations can be shown on the graph (provided there is room).
• Slope has units (in contrast to math where often one graphs functions without units)
• Slope is calculated using widely spaced locations on the drawn line (not from data points plotted)
• When a point is known to be an exact point (such as the origin sometimes is), then both the best and worst fit lines should pass through the exact point. Also the exact point is used as one point in the slope calculation

Benefits of Graphs

Pictorial models are very useful for analyzing and comparing data and for presenting information about the data to others. Summarizing a data set with a chart or graph often allows us to recognize special characteristics (such as the shape or distribution) of our data that may not be obvious from the numerical statistics. In addition, "pictures" are more easily understood than numerical summaries, even by someone with no formal training.

Graphical analysis has several advantages over numerical techniques for determining fits to data. By presenting data visually, one can make determinations as to the importance of points based on their uncertainties as well as their locations on the graph. Although there are numerical techniques for making these determinations, one finds that a visual analysis provides one of the best (and simplest) approaches.

Many calculators now provide simple regression tools (such as "least squares fit") for determining linear fits to data. These regression tools in general do not account for the certainty of a data point nor do they do point rejection of "bad points". The numerical tools work well if just a simple data fit is required with no detailed analysis or if the consistency of the data is well known and fits are need to many sets of data. In general though, for the first look at some data set, a graph is drawn and used in the analysis.

Notes