Vous êtes sur la page 1sur 17

Uncertainty Analysis

2 | P a g e

Abstract

The objective of this lab is to provide the students with an overview of uncertainty
analysis as it pertains to sampled results recorded during the experiment. Uncertainty analysis is
used during experiments when certain measurements or results stray significantly from the
standard results. This occurrence in a lab experiment is expected. If an unidentifiable reason for
the existence of the outliers is not available, it becomes essential to make use of statistical
reasoning to remove these data points. This lab experiment will employ a method called the
Chauvenets Rejection Criterion. By ascertaining the standard deviation and the mean of the
data, a ratio required to employ Chauvenets Criterion is established. The Arduino along with a
Potentiometer, bulb thermometer, and LM3335 Temperature Sensor was utilized in order to
obtain the data to be tested. The first portion of the lab involved recording the temperature of ice
water right after being placed in room temperature water. A SPDT Switch was also used to
deliberately skew the results of the section portion of the lab in order to apply the uncertainty
analysis in order to remove the outliers and modify the results to give more accurate results.




















3 | P a g e

Table of Contents

Page Number
Abstract2

Background..4

Procedure......5

Data, Analysis & Results...8

Conclusion15

References.16

Appendix...17











4 | P a g e

Background
When analyzing data it is imperative that the accuracy of the data is known. To
accommodate this Engineers have access to instruments that can be either carefully calibrated or
highly specialized to take measurements that are as close to the values they are measuring as
possible. While this can get one close to an actual value, no piece of equipment is perfect.
Anytime a number of measurements are taken, no matter how advanced the measuring device,
there is always a chance that external variables can influence the results. When measuring a
signal this could be electrical interference. If length is the value of interest the temperature of the
object being measured could warp it and throw off results. When a large group of measurements
is being examined these anomalies are called outliers.
An outlier is essentially a value that does not fit well with the rest of the dataset. This is
an informal definition that is not terribly useful in practice though, for a more useful idea of what
an outlier is we need Chauvenets criterion. Chauvenets criterion uses probability to determine
which values are outliers and which should be included as part of the dataset. By using a normal
distribution of the data the probability of a value falling within a certain range of numbers can be
determined. This probability is mostly influenced by the number of values contained within the
dataset of interest. Anything outside this probable range of values is deemed an outlier.
Once these outliers have been detected through such a method they can be removed from
the dataset, thus cleaning up the data. One must be careful when using a method such as this
however, as if not enough data points are gathered outliers become less obvious, to remove
outliers from a small set of data is to risk losing legitimate information from that data.
This experiment uses data from a temperature sensor submersed in ice water to collect a
dataset to be analyzed. Temperature fluctuations at the end of the senor produce different
voltages that are sent back to the Arduino. Each voltage corresponds to a set temperature. In this
way the Arduino is able to produce a set of temperature data from the sensor.
To calibrate this sensor a potentiometer was used. This made it possible to adjust the
voltages that the temperature sensor was putting off up or down until they reached an expected
value, thus calibrating the sensor. In this experiment the sensor was calibrated using the freezing
point of water.





5 | P a g e

Procedure
The general procedures provided are used to generate a greater with the use of uncertainty
analysis. The experiment aided in the overall understanding of the use of the Arduino and also
testing its capabilities in a more in-depth manner. The procedure contains instructions on how to
produce two series of measurements with the purpose of practicing the calculating of various
statistical parameters. The first experimental procedure is meant to introduce a certain amount of
random error. In the second part, the effect of a sample size, N, is examined by use of the
computer to take a large amount of samples at high speed. For a more detailed procedure and
understanding of the operations completed, reader should refer to the MAE 311 Lab 3 Manual.


1) As the Figure 1 shows below, which is referenced from MAE 311 Lab 1 Manual [1], the
Arduino and breadboard was set up to include a Potentiometer, an LM355 sensor, and a
SPDT (Single Pole Double Throw) Switch. These devices, which are described in the
background, were vital towards the conducting of this experiment. The Arduino software
was also setup and the necessary sketches were downloaded.



Figure 1- Circuit Diagram

2) After connecting the Arduino to the computer the three sketches provided were tested in
order to ensure that the sketches and the Arduino set-up were all functioning correctly.
Processing). This software looks very similar to the Arduino software but it has some
differences and features that are not present in the Arduino software. Figure 2 below
shows the Processing Software and a total of three Serial Ports. It was noted that the
6 | P a g e

numbering for the ports begin at 0. As stated in the Lab Manual, If the Arduino was
using COM5, then it is considered Port 1. The Processing software allows you to record
data and it also has a built-in scrolling graph as seen in Figure 4 of the Appendix that will
show the temperature information as well as a window that will show the time, raw
voltage and temperature.




Figure 2- Diagram showing the Processing Software

3) The LM355 releases a voltage that varies by 10 mV/degree but it needs the potentiometer
to bring the readings as close as possible to ambient temperature. The procedures as
stated in the Lab Manual were followed in order to calibrate the instruments as accurately
as possible.
7 | P a g e


4) The Processing TemperatureRecorder sketch was then turned on and left running in order
to record the data. This portion of the lab involved submerging the LM335 in an ice-
water bath, followed by a room temperature bath. This is repeated 20 times at specific
time intervals and relevant data was recorded during this process in order to create a
sample of data to be analyzed.

5) The second portion of the procedure involves collecting around 2000 data points which
will be used in order to test the uncertainty analysis of the measurements. This exercise is
focused on building a greater understanding of uncertainty analysis.

6) The Processing sketch was again turned on for use in this section. The LM355 then
begins the reading of temperature and the data is being recorded using the
TemperatureRecorder. By clicking the switch intermittently, a brief connection was
created which essentially means that the circuit was shorted. The click was switched over
the course of two minutes. After the two minute recording, the data was then imported
into a Microsoft Excel sheet and then manipulated in order to identify and eliminate any
outliers. The mean and standard deviation for the data set was calculated, and
Chauvenets Criterion was used to identify the outliers. After observing the change in the
data, the remaining data was inserted into MathCAD in order to graphically depict the
accuracy of the data.













8 | P a g e

Data, Analysis & Results

Sample of Ice Bath Data
Run Number Temperature Data C


1 10.89
0.3721
2 10.89
0.3721
3 10.39
1.2321
4 10.89
0.3721
5 11.39
0.0121
6 10.89
0.3721
7 10.40
1.21
8 12.39
0.7921
9 11.89
0.1521
10 12.89
1.9321
11 10.00
2.25
12 13.39
3.5721
13 11.89
0.1521
14 11.89
0.1521
15 12.39
0.7921
16 12.89
1.9321
17 11.00
0.25
18 10.89
0.3721
19 10.89
0.3721
20 11.89
0.1521
Sum 230.03
16.82
Average 11.50


Table 1 : Ice Bath data using the Processing TemperatureRecorder
2.3 Questions and Calculations I
1. Calculate the mean and standard deviation of the readings collected.

Equation 1 below, is the equation used in determining the mean of the data. The variable
n is the number of samples:
(1)


Table 1 shows the sum total of the

though

is 456.6 which can be inserted into


equation 1 to calculate the mean.


9 | P a g e




Equation 2 below demonstrates how to calculate the standard deviation of a sample
population:
(2)




Table 1 shows the sum total of

is 10.5629 which can be inserted into equation


2 to calculate the standard deviation of a sample population.




2. Calculate the precision limits for the distribution for a 95% confidence level. In other
words, calculate the range over which a random reading will fall with 95% confidence.

Equation 3 below demonstrates how to calculate the Students t-Distribution. The
variable will represent the range:
(3)



When this equation is rearranged it can be used to solve for the range.



To solve for t the Student-t Distribution table must be used:
Table 2: Student t-Distribution Table


Equation 4 below demonstrates how to calculate the Degrees of Freedom (v):
10 | P a g e

(4)




Using the v value of 19 at a .950 confidence limit the t value can be found to be:



With the t value calculated the range can be calculated using the rearranged equation 3:






3. Calculate the uncertainty of the mean for a 95% confidence level. In other words, pretend
that many sets of 20 readings were taken and the mean and standard deviation calculated
in Question 1 are the population mean and standard deviation as opposed to the sample
mean and standard deviation. This will find the uncertainty in the location of the
population mean based on many sample populations.

Equation 5 below demonstrates how to calculate the Random Uncertainty (

):
(5)

0.44

4. Apply Chauvenets Criterion to remove any outliers. If any samples are rejected as a
result of calculations, recalculate the sample mean and standard deviation and compare to
the original values determined in Question 1.


11 | P a g e

Table 3: Chauvenet's Criterion applied to Ice Bath Data
Run Number Temperature Data C (x) Z Outlier?
1 10.89 0.650005 No
2 10.89 0.650005 No
3 10.39 1.181488 No
4 10.89 0.650005 No
5 11.39 1.118521 No
6 10.89 0.650005 No
7 10.40 1.170858 No
8 12.39 0.944446 No
9 11.89 0.412963 No
10 12.89 1.47593 No
11 10.00 1.596045 No
12 13.39 2.007414 No
13 11.89 0.412963 No
14 11.89 0.412963 No
15 12.39 0.944446 No
16 12.89 1.47593 No
17 11.00 0.533078 No
18 10.89 0.650005 No
19 10.89 0.650005 No
20 11.89 0.412963 No
Average Temp () 11.5
Standard Deviation 0.94
Chauvenet's n=20 2.24

The Chauvenets Criterion for n=20 can be found in Figure 3 of the Appendix. Equation
6 below demonstrates how to calculate the Z value above in the chart:
(6)
|

|

2.5 Questions and Calculations II
1. What is the temperature resolution of this device? Show the information and equations
used to determine this information.
The temperature resolution was 0.74 which was calculated through use of the standard
deviation formula located on Excel (STDEV). It can also be calculated by hand using Eq.
2 stated above.

12 | P a g e


2. Provide a detailed description of a suitable method for removing any outliers.

The best way to remove outliers from a large population is to use an IF statement as
suggested in the lab manual. A Z value from equation 6 must be calculated for each data
point. This can be done by entering the Z equation in an excel cell and double clicking
the cell so that it will carry this formula to the rest of the data points. The average and
standard deviation should be set in its position before carrying the equation to the rest of
the data points. This can be achieved by placing a $ before the number in the Formula
Bar. The IF statement IF(ABS(Data Point)>Chauvenets Value,"OUTLIER","") will
check if the calculated Z value is greater than the calculated Chauvenets value and if not
it will output the word Outlier in the cell. The cell will remain empty if nothing is the
IF statement is false. In a new column use the same IF statement to output original data
point value if not an outlier, IF(ABS(Data Point)>Chauvenets Value,"","Data Point")
and output nothing if it is an outlier. The data that it outputted using this formula can be
used to calculate a more accurate mean and standard deviation with all outliers removed.

What are the mean and standard deviation before and after the application of Chauvenets
Criterion?
Table 4: Mean and Standard Deviation for temperature before and after Chauvenet's
Criterion
Before Outlier Removal After Outlier Removal
Mean 20.64279712 23.49574512
Standard Deviation 15.13198971 2.192363472

There was a minor change between the original mean and the actual mean values. This
can be attributed to the large pool of 2000 data points making the few outliers almost
irrelevant in the average. The standard deviation however showed greater difference
between original values and the values after the outliers had been removed.









13 | P a g e

3. From step 6.iii in section 2.4: Based on the graph generated, are the 2000+ random points
enough to assume a Gaussian distribution?


Graph 1: True Gaussian Distribution Before Application of Chauvenets


Graph 2: True Gaussian Distribution After Application of Chauvenets

Graph 1 depicts the Gaussian distribution before the Chauvenets criterion where all of
the outliers are outside of the histogram graph. Graph 2 shows Gaussian distribution after
Chauvenets Criterion where the data more accurately fits the histogram graph as a result
of the outliers being removed. The graph clearly demonstrates that 2000+ points are
sufficient enough to assume a Gaussian distribution.




14 | P a g e

4. From step 7.iii in section 2.4: Looking at the graph generated, how does the actual
distribution compare to a true Gaussian? How does it compare to the random data?



Graph 3: Actual Distribution Before Application of Chauvenets


Graph 4: Actual Distribution After Application of Chauvenets



15 | P a g e

The outliers are so elevated that the histogram can hardly be seen. Graph 4 shows that the
actual data after Chauvenets Criterion was applied. The actual data appears to be
meager. As a result of all the gaps in the data, the histogram cannot really be
distinguished. The Gaussian distribution random points fit the histogram graph better
than the actual data. The actual data graph in Graph 3 also has more outliers then the
Gaussian distribution.

5. What can be done with the experimental procedure to improve the distribution generated
in step 7 of section 2.4?

The best way to improve the distribution generated in step 7 would be to record data for a
longer period of time. More recorded data normally improves the overall results of the
experiment because it provides a greater range of information that can be used. The
appearance of the graphs would also benefit from more data.

Conclusion
This lab demonstrates the importance of removing any outliers from data to clean up
results. When the outliers are left in the curves produced by the graphs are not as neat as when
they are, this allows the data to be more easily analyzed. It also increases the accuracy of the data
because the outliers, if not removed, skew the results. Additional data would have been
beneficial here. More data points would have allowed for outliers to be more easily detected and
would have smoothed out the graphs somewhat.
This experiment would have benefited from a more diverse set of data than a steady
temperature measurement. The outliers that were artificially added to this experiment were far
removed from the rest of the data. While this is indeed by definition what an outliers is meant to
be, some outliers may not be so easy to spot and blend in with the rest of the data when viewed
with the naked eye until a mathematical analysis is performed.

References







16 | P a g e




Appendix



Figure 3: Chauvenets Criterion for Rejecting a Reading



17 | P a g e


Figure 4: Temperature Graph

Vous aimerez peut-être aussi