Download Expt Stats

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Multimeter wikipedia , lookup

Soft error wikipedia , lookup

Immunity-aware programming wikipedia , lookup

Transcript
G.Tungate@bham.ac.uk
Office Poynting R8
Precision and Error Analysis
Why bother with error analysis?
Random Errors
Determining errors on parameters
Combining Random non-correlated errors
Quoting errors
2 values
Least Square fitting
Systematic Errors
Do the errors look right?
Why bother with error analysis?
To allow a meaningful comparison between one result and another
and between experiment and theory.
Lord Rayleigh in 1897 measured a 0.5% difference in
the density of nitrogen obtained from Air and from NH3.
Was this significant?
O.5% was outside estimated error.
Discovered Ar got Nobel Prize.
“The subject of the densities of gases has engaged a large part of my attention for
over 20 years. ... Turning my attention to nitrogen, I made a series of
determinations ... Air bubbled through liquid ammonia is passed through a tube
containing copper at a red heat where the oxygen of the air is consumed by the
hydrogen of the ammonia, the excess of the ammonia being subsequently removed
with sulphuric acid. ... Having obtained a series of concordant observations on
gas thus prepared I was at first disposed to consider the work on nitrogen as
finished. ... Afterwards, however, ... I fell back upon the more orthodox procedure
according to which, ammonia being dispensed with, air passes directly over red hot
copper. Again a good agreement with itself resulted, but to my surprise and
disgust the densities of the two methods differed by a thousandth part - a
difference small in itself but entirely beyond experimental errors. ... It is a
good rule in experimental work to seek to magnify a discrepancy when it first
appears rather than to follow the natural instinct to trying to get quit of it.
What was the difference between the two kinds of nitrogen? The one was wholly
derived from air; the other partially, to the extent of about one-fifth part, from
ammonia. The most promising course for magnifying the discrepancy appeared to
be the substitution of oxygen for air in the ammonia method so that all the nitrogen
should in that case be derived from ammonia. Success was at once attained, the
nitrogen from the ammonia being now 1/200 part lighter than that from air. ...
Among the explanations which suggested themselves are the presence of a gas
heavier than nitrogen in air ...”
http://www-groups.dcs.st-and.ac.uk/~history/Biographies/Rayleigh.html
Simple example:Opinion polls prior to an election show how the political parties are
standing, but different polls show different results. Even if we can
rely on the polls being random, without knowing the size of the poll
we cannot say whether or not the discrepancy is significant or not.
Example:- Noughts and crosses.
Class choose either a nought or a cross.
Random Errors
Errors which differ from measurement to measurement.
u
v
We measure u the distance between the object and the
lens and v the distance between the lens and the image.
With finite sized object, image and lens, how do we decide
where to measure to and from?
How accurately can we make these measurements?
How subjective is the position of the image? A real lens
does not give a perfect focus!
Note that the errors on u and v are not just the errors found
from the accuracy to which we can read the ruler!
In general the error on u should be smaller than that on v.
Why?
Because there will be some difficulty in deciding exactly
where the best focus is.
How can we check that our errors are realistic?
Repeat the measurement several times.
Over estimation of errors is as bad as under estimation of errors.
Why?
Because this may hide discrepancies between other
measurements and theoretical predictions.
Taking the values and errors to be u ± u and v ± v..
1 1 1
 
Calculate the focal length of the lens from
u v f
How do we calculate the error on f ?
uv
The lens formula can be rearranged to give f 
u  v 
Take partial differentials of f with respect to the parameters
f
v2
f
u2
u and v


2
v u  v 2
u u  v 
What is the significance of these partial differentials?
f
v 2u
f
u 2v
fu  u 
f v  v 
2
u
v
u  v 
u  v 2
For independent random errors the total error is the square
root of the sum of the squares of the individual errors.
Hence for the lens:- f  fu2  fv2
Will be justified later.
The partial derivatives give the rate of change of f
with respect to a change in the parameters u and v.
Hence if we multiply these partial derivatives by the errors
u and v we will get an estimate of the error on f
due to an error on u or an error on v.
However, this is only valid over regions where the slope
is relatively constant.
For some arbitrary function y the variation with x might bey
x
y
x
y
y = x
x
x
Beware of problems when derivatives are zero.
Some examples- Find the errors y given errors a, b,
for -
y  ab
y  sin( a
 ),
and
y
y
1
ya  a  a
2
2
a
a
y  a  b
y
y
yb  b  b
1
b
b
y
  cosa  ya   cosa a
a
y  ya2  y2
y
 a cosa  y  a cosa 

Which gives y  cosa  a 2  a 2
y  xn
Find the errors on y for the following, y  ab
when a,b,x,m and c are variables
mx
y

me
ya
and n is a constant. b
and show that they are reasonable.
y mx
m
xc
y  ln x
What do we mean by saying the focal length of the lens is f ± f ?
If the errors are random and symmetric with respect to the true
value of f then the error f is taken to be the standard deviation f
of the distribution of measured values of f .
In other words if we make many measurements of the focal length
we will get a range of values for f. Quite often this will approximate
to one of a set of analytical distributions such at the Normal or
Gaussian distribution and in this case approximately 70%
of the measurements will lie within ± f of the true value of f .
The probability of a particular value being measured, given as a
percentage of all possible measurements, is symmetric about the
mean for a Normal distribution and ~15% of measurements lie
below one standard deviation from the mean and ~15% lie
above one standard deviation from the mean.
mean = 20
Cumulative
percentage of
total
Percent
of total
8
6
4
=-5
=+5
2
100
50
0
0
20
40
Normal or Gaussian distribution functions showing percentage
of events in unit width bins and cumulative percentage in bins.
True Mean , Variance  and standard deviation .
From a data set one gets estimates of these.
Note change of symbols.
An estimate of the mean value  of a set
of N measurements of xi is given by
1
x   xi
N i
The variance , is the mean square deviation s 2  1  x   2

i
of the distribution and is estimated by
N i
If, as is usually the case we do not know the
1
2
true mean and have to use an estimated mean x , s 2 


x

x

i
N

1
then our value for the estimated variance is
i
We make use of the idea of a distribution of values about the mean
by assigning errors to our data such that the errors approximate to
the standard deviation for the distribution of data points.
If we do this correctly then the standard deviation
calculated from a set of equally precise
independent measurements should be equal
to the assigned error on each data point.
One way of assigning an error to a measurement
is to make multiple measurements and take the
standard deviation of the distribution of results.
σ
Note that the standard deviation is a measure of the width of the
distribution of results. It tells us, for a set of equally precise results,
that each has an error which is given by the standard deviation
δxi = .
Thus if we have N results
the error on the mean is-
x 
1
N

2
xi
i

x
N
A set of N measurements of x will have a mean value -
1
x   xi
N i
With a standard deviation s is given by
1
2


s
x

x

i
N 1 i
The final result for x with error x is given by -
x
s
N
The standard deviation s should agree with the
estimated error xi on each measurement of xi .
This is OK if all the measurements have the same errors.
Weighted means.
For multiple measurements of some quantity x where the
errors are not the same, it would make sense to give higher
weighting to the more accurate measurements.

The weighted mean is now given by -
x
i

i
The error on the weighted mean is given by -
xi
xi2
1
xi2
1
x
2

i
1

2
xi
Relating the standard deviation to experimental errors allows
us to justify adding errors in quadrature.
If the errors are random and uncorrelated then for- a  b  c
sa2
1
2



a

a
 i
N 1 i
1
2







b

c

b

c
 i i
N 1 i
1
2
2
bi  b   ci  c 
sa 

N 1 i
sa2

sa2
1
1
2
2
2
bi  b  
bi  b ci  c 
ci  c  




N 1 i
N 1 i
N 1 i
sa  sb  sc
2
2
2
0
for uncorrelated errors
Experimental errors is not just sorting out the errors
after doing the experiment !
You need to think carefully about how to do the experiment.
V
A
R
5V
Which circuit is the
best one to find R?
R V
I
Need to think
about influence of
the measurement
on the system
V
A
R
5V
Find the currents though the circuit when the volt meter has a
resistance of 10 MΩ and the Ammeter has a resistance of 1 Ω.
Use Ohm’s law to get the reading of the volt meter for
R = 1Ω and R=10 MΩ
For each volt recorded on the voltmeter a current of
V/R = 10-7 A flows through the meter.
V
10MΩ
1Ω
A
1Ω
5V
V
5
 2.5 A
1  1
10MΩ
1Ω
5V
Current flowing I 
Voltage displayed on meter is
voltage across 1 Ω resistor.
V  RI  1  2 .5  2.5 V
1Ω
A
For the current flowing we
can ignore the 10MΩ.
We still have 2.5 A flowing
but now the voltmeter registers
the voltage across the resistor
and the meter
V  RI  2  2 .5  5 V
A
V
10MΩ
1Ω
A
10 MΩ
5V
Now current through voltmeter is equal
to the current through the resistor.
We can ignore the voltage drop across
the ammeter.
Current flowing through resistor
I V
7
5

7  5  10 A
R
10
Current through voltmeter
B
V
10MΩ
1Ω
A
10 MΩ
5V
7
5

7  5  10 A
R
10
Current through Ammeter in A= 10-6A
Voltmeter reading in A= 5 V
I V
Current through Ammeter in B= 510-6A
Voltmeter reading in B= 5V
R V
I
 ? for A and B
Do the errors look right?
You should always do a quick order of magnitude check to
see if the error you assign to a final result is reasonable.
It is difficult to give advice for all possible situations but start
with the followingDetermine which parameters have the largest absolute errors
and which have the largest relative errors.
Absolute errors are more important when adding or
subtracting quantities
Relative errors are important in multiplication and division.
Which error will make most impact on the final result?
E.g. P  AT
P
4
 AT

and
But
4

P  AT 

4
P 

P

PA A

P
A
PT
T
4
P
T
Relative error on T is 4 times more important than relative
errors on σ or A!
Because of the high power on T, P will be more sensitive
to T than to  or .
Beware of situations where the error can introduce
sign changes.
If z  1  x 1  y 
and both x and y are close to unity
which will have the most impact on the error on z ?
Try x,y= 0.9,1.0 and 1.1
X
Y
0.9
1.0
1.1
0.9
0.19
0.2
0.21
1.0
0
0
0
1.1
-0.19
-0.2 -0.21
What is wrong with the following graph ?
Systematic Errors
These by their very nature are difficult to deal with.
The reason being that a good experiment should be designed to
eliminate or at least minimise systematic errors.
Suppose we have to measure the current passing through a circuit
and that we have a meter which has a zero offset. It reads 5mA even
when no current is flowing. If we did not know about the offset we
would have a 5 mA systematic error but of course we do not know
this. If we did know about the offset we could simply deduct 5 mA
from all of our readings and we would have eliminated the error!
Hence we have a problem. We must try and evaluate possible
systematic errors when we think they will be as significant as any
random error.
Systematic errors do not add in the same way as random errors.
See next page.
For example;- Consider the errors made by a tape rule which
had a zero offset of about 0.5 mm.
End of scale has error of half a division
2
4
6
8 10 12 14 16 18 20
x1=8.0±0.2±0.5
Random
error
22 24
x2= 16.0±0.2±0.5
Systematic
error
Quote random and significant systematic errors separately
What is the error on x2+ x1?
24.0±0.3±1.0
What is the error on x2- x1?
8.0±0.3±0.0
24.0±0.28282±1.0
Read section 1.5 and appendices 3 and 4 from
“A practical guide to data analysis .. “, L. Lyons
or section 3.5 and appendices D.1 and D.2
“Practical Physics” G.L.Squires
Think how we should have analysed the results
of our noughts and crosses survey.
Poisson distribution.
Random events with expected number l in a given time.
Probability of getting r events in a unit time interval is -
l l
P r   e
r!
Mean and variance both = l.
r
Gaussian or Normal distribution f  x 

   x   2 
f x 
exp 

2
 2

2 
1 1
Bell shaped curve
f  x x is probability of result being in the interval between
x and x+x.  is the mean and  the standard deviation.
Central limit Theorem
– if each observation has a large number of random
errors the distribution will tend to a Gaussian.
x
Binomial distribution
Event has two outcomes A and B
with probabilities p and q =1-p
Probability that r out of N results will give outcome A is
N!
P r  
p r q N r
r!  N  r !
Mean
r  Np
Variance
 2  Npq
Large N small p binomial tends to Poisson.
Large l Poisson tends to Gaussian.
Least Squares Fitting
Fitting a straight line. Let y  mx  c represent the fitted line.
y
Problem is we do not
know m and c.
yi
xi
mxi  c
yi
x
 mx  c  y 
i
Evaluate S    i


i

y


i
the weighted sum of the
squared deviation of the
data (xi,yi) from the line.
This is a problem in finding m and c by minimising S.
2
We need to find the values of m and c which give the smallest
value for S.
Maximum-minimum problem  differentiation.
The variables are m
c and we need to take partial
? and ?
differentials with respect to m
c and set these equal to zero.
? and ?
 mx  c  y 
i
i

 2 xi
0


2
i
m

y


i
 mx  c  y 
S
i
i
 2 
0


2
i
c
yi


S
 mxi2  xi c  xi yi 
S
  0
 2 
2
m
yi
i 

Using the notation 1  
i
1
and x  
yi2
i
we get from the partial differentials-
 
➀ m x 2  cx  xy   0
Likewise
gives
 mx  c  y 
i
i
 2 
0


2
i
c

y


i
➁ mx  c1   y   0
NOTE x2
yi2
etc
Don't worry about the [ ]
and treat just like normal
simultaneous equations.
S
➀ × [x] - ➁ × [x2] gives
xi

 x 
 
 
c x2  1 x 2  xyx   y  x 2
2
Likewise
 
Rearrange to get m 
Sum
x
1.0
2.0
3.0
6.0
y
0.5
1.0
1.5
3.0
m=
0.5
2
xy 1   y x
x 1  x 
y
0.3
0.3
0.3
0.9

m x 2 1  x  xy 1   y x
➀ × [1] - ➁ × [x] gives
2
2
1
11.1
11.1
11.1
33.3
c=
and
c
xy x   y x
x  1x 
2
[x]
[x2]
[y]
11.1 11.1 5.6
22.2 44.4 11.1
33.3 100.0 16.7
66.7 155.6 33.3
0.0
2

2
[xy]
5.6
22.2
50.0
77.8
What about the errors on the parameters m and c ?
From the figure we see that changing the slope will change
the intercept on the y-axis if we force the fit to go through
the mean value of the data.
Remove the correlation by
transforming the data to a
system with the mean x
y
at the origin. x  x  x
x
y
y  mx  c
x
Now the intercept c´ = y is
independent of the slope.
x
Errors on m and c are correlated.
This makes calculating the errors
more difficult.
The error on y is also the
error on c´ which is just the
error on the weighted mean :-
1
cc2

i
1
yi2
It is easy to see that the error on the intercept
(for the x´ distribution)
is just the error on the mean but what about
the error on the slope?
 S
2
Error on intercept can be related to
2

c
 S
2
2
Similarly, but without proof
m
Error on the slope of the line is given by
Where x  x  x
2
2
1
2

c
 2
1
m 2
1
m2
i
1

 2
i

i
2
yi
2
xi
yi2
2
xi
yi2
y  mx  c'
Remember that
x  x  x
so
 y2  x2m2  c2
y  mx  c
and
The error on c this is the same as the error on y at x  0, x   x
So
c  x m  c
2
2
2
2
where
Plot S as a function of m or c
S
1
c2

i
1
yi2
S
2S
m
m 2
m
Which curve has smaller error on m ?
m
m