15.4: Sketch of how to present data in laboratory (i.e. graph with errors)
- Page ID
- 44031
This page is a draft and is under active development.
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)This is notes (yes it is actual just a bunch of random notes) on how to present data for your laboratory report. This is just one example and the student is encouraged to investigate how to present data beyond this (there are many examples on the web).
The main idea of this lab is to take data at different intervals (of length, time, speed, or something else that can be done in intervals). Your could image that this would give you some sort of line or curve on an xy graph, but for an experiment it is desirable (and might even be demanded) to have error associated with your data.
So how do we get a numerical error? One possibility and the method normally used in academic exercises is to take data multiple times for each interval. From this you can calculate a mean and a standard deviation (square root of the variance). This method of calculating error is in general conservative and should suffice for simple lab experiments.
Here is an example (in octave style) for calculating the mean and standard deviation:
% Ok, let us say we have some measured data y at x.
%
% The data is x which is a distance (for example) that we will assume is errorless (not completely correct,
% but good enough here). The test data is y which is time (for example). We will repeat the experiment at
% the same distance at least five times in order to get a good representative
% value (the mean). Associated with this value will be an error (standard deviation).
%
%
% So at distance 1 feet we measured times of 2.200 sec, 2.000 sec, 2.400 sec, 1.600 sec, 1.065 sec,
% 1.800 sec,and 2.935 sec. %
y1 = [2.200,2.000,2.400,1.600,1.065,1.800,2.935];
mean(y1)
% ans = 2
std(y1)
% ans = 0.59839 -- which for clarity purposes I used as 0.6 for sy.
%
% So at distance 2 feet we measured times of 4.0500 sec, 4.000 sec, 4.1500 sec, 3.6900 sec, 3.8500 sec,
% 3.9500 and 4.3100 sec. %
y2 = [4.0500,4.0000,4.1500,3.6900,3.8500,3.9500,4.3100];
mean(y2)
% ans = 4
std(y2)
% ans = 0.200991 -- which for clarity purposes I used as 0.2 for sy.
%
% Repeat for all the other x values...how many x's you use will depend on what type of fit you wish
% to achieve. For a linear fit you need at least 3 values of x, for a quadratic fit
% you need at least 4 values of x, for a cubic fit you need at least 5 values of x, and for
% a quartic at least 6 values of x, and so on. Obviously more data points would always be preferable
% to get the best fit possible. This assumes polynomial fits, if it is an exponential fit (or sinusoidal)
% then you should have even more values of x.
%
% x = [1,2,{other values}];
% y = [2,4,{other values}];
% sy =[0.6,0.2,{other values}];
%
On paper you would write the first data point calculated above as \(y_1 = 2 \pm 0.6\)
Assuming we have already calculate the mean and standard deviation of a lab with five data points, here is the presentation of the data for you to run.
Finally we have a graph with the data, the error on the data, the model of the data (linear fit in this case), and the error on the model data (note the error bar is different for different model data points just like for different points of the actual data).
You will note (if you run the octave program above) that the error bars on the model (the fitted line) have different values (which they should have though most algorithms do not do that). If you believe your model is a polynomial curve then you should change the 1 to the degree polynomial you believe would best fit your data in wpolyfit (which is from the optim package which if you have octave you may have to go get). In the help for wpolyfit is a description of how to use a chi-squared test to see which polynomial fit might be better.
From the data that wpolyfit and polyconf provide an equation for the line (or polynomial) with error can be formulated to be part of your laboratory report.