Professional Documents
Culture Documents
Summary
SGUM is an add-in for Microsoft Excel. It is a framework for developing data-processing
applications that carry out measurement uncertainty calculations. SGUM simplifies such
calculations by automating most of the computational steps involved.
This document explains how to install and upgrade SGUM. It also describes the examples in an
Excel workbook distributed with SGUM. SGUM comes with Help files that document the
specific use of the worksheet functions.
SGUM has been developed with Excel 97 and tested using Excel 97 and Excel 2002 (XP).
SGUM is free, but its use is subject to a license agreement. A copy of that license is given in
section 6.
Contents
1
Change History
1.1
1.2
1.3
1.4
1.5
Installation
3.1
3.2
3.3
3.4
3.5
Distribution contents . . . . . . . . . . .
Unpacking the distribution archive . .
Activating the add-in . . . . . . . . . . .
Deactivating and removing the add-in
Upgrading . . . . . . . . . . . . . . . . .
Introduction
4.1
Examples
5.1
5.2
1
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1
1
1
1
1
2
2
3
3
3
6
6
7
8
8
11
1 Change History
1.1 Version 0.96 (17 June 2010)
Fixed a problem where the degrees-of-freedom calculation would fail instead of returning an
infinity.
A note has been included regarding the compatibility of SGUM.xll with recent Excel
versions.
License
Please note that use of this software is subject to a license agreement (see section 6).
If you do not agree to the terms of the license then you may not use the software.
Please contact us regarding any possible commercial use of the software. Enquiries can be
addressed to:
Dr. B. D. Hall,
Industrial Research Ltd.,
PO Box 31-310,
5040 Lower Hutt,
New Zealand.
tel.: +64 4 931 3198
fax.: +64 4 931 3194
email: b.hall@irl.cri.nz
3 Installation
3.1 Distribution contents
SGUM is distributed in a .ZIP archive that contains the following:
SGUM.xll, the Excel add-in
SGUM.cnt, the Microsoft table-of-contents file for the on-line help
SGUM.hlp, the Microsoft on-line help file
Examples.xls, an Excel workbook containing several examples.
Getting started with SGUM.PDF (this file)
3.5 Upgrading
When upgrading SGUM, the older versions of all distribution files should be replaced with new
ones.
First, SGUM should be deactivated within Excel, as described in section 3.4. Then the Excel
application should be closed while the files are replaced.
When the add-in is first activated, it will be necessary to browse for the file.
4 Introduction
The Microsoft Excel add-in SGUM is a framework for developing measurement data processing
applications that handle uncertainty. You can use SGUM to write spreadsheets that carry out
full uncertainty calculations according to the so-called Law of Propagation of Uncertainty
(LPU), described in the Guide to the Expression of Uncertainty in Measurement [1] (see also
[2, 3], which are available on-line).
SGUM is designed to allow uncertainty calculations to be included in any Excel-based
application. It is simple and flexible enough to be able to meet the requirements of many
different needs and applications. SGUM is definitely not just another uncertainty calculator
application, of which there are now quite a number on the market.
The distribution includes a file Example.xls that shows some ways of using SGUM.
Worksheet function documentation is provided in a Microsoft Help file. The Paste
Function button (fx ), in the standard Excel tool bar, can access on-line help (SGUM
functions are in the function category mstSGUM). The Excel Formula Palette also provides
guidance when entering SGUM function parameters.
The remainder of this section introduces the idea of an uncertain number, which is central to
SGUM. The rest of this manual then deals with some examples.
a component of uncertainty, represents the change that would occur to a result y if the
value of an influence quantity x were to change by an amount equal to its standard
uncertainty. For an elementary uncertain number, this is equal to the assigned standard
uncertainty.
Worksheet functions can evaluate these properties for any uncertain number.
5 Examples
The Excel workbook Examples.xls contains several spreadsheets that show how to use
SGUM functions to process measurement data.
(1)
= ls + d ls [ + s ] ,
where ls is the length of the standard at 20 C; s is the coefficient of thermal expansion for
the standard, and is the difference between the thermal expansion coefficients of the two
gauges; is the temperature deviation, from 20 C, of the gauge being calibrated, and is the
temperature difference between the two gauge blocks; d is the measured difference between
the lengths of the two blocks.
However, there are a total of nine of influence quantities. The intermediate quantities d and
are defined by
d = d1 + d2 + d3
(2)
= 1 + 2 .
(3)
Table 1 summarizes the influence quantities, their values and uncertainties, as well as the
names given to the uncertain numbers for each quantity in the Excel worksheet.
Table 1: Influence quantity data for the end-gauge problem
influence
quantity
ls
d1
d2
d3
s
1
2
Excel
name
ls
d1
d2
d3
alpha s
theta 1
theta 2
delta alpha
delta theta
type
Gaussian
Gaussian
Gaussian
Gaussian
uniform
Gaussian
arcsine
uniform
uniform
value
xi
5 107 nm
0.0 nm
0.0 nm
0.0 nm
11.5 106 C1
0.1 C
0.0 C
0.0 C1
0.0 C
uncertainty
u(xi )
25 nm
5.8 nm
3.9 nm
6.7 nm
2 106 C1
0.2 C
0.5 C
1 106 C1
0.05 C
degrees of
freedom
18
24
5
8
50
2
The Excel worksheet calculation The Excel calculation for this problem is on the End
gauge worksheet, in the Examples.xls workbook.
The raw data from Table 1 is used to create elementary uncertain numbers for the nine
influence quantities. The worksheet functions unGaussian, unUniform and unArcsine
are all used, according to the type of distribution associated with the uncertainty in the
influence quantity.
Intermediate results are calculated using unEquation. This function takes a string,
representing an equation of uncertain numbers, and a series of references to cells containing
uncertain numbers. Note, there are four intermediate results in the sheet, two more than used
in the Guide. These extra equations correspond to terms ls and ls s , from equation (1).
The result, l, is obtained by combining the intermediate uncertain numbers. The standard
uncertainty of l, the effective degrees of freedom and the coverage factor, for a 99% expanded
uncertainty interval, are calculated with unUncertainty, unDoF and unCover,
respectively.
The worksheet function unComponent can be used to find the contribution of individual
influence quantities to the uncertainty in l. It evaluates
ux (l) =
l
u(x) ,
x
(4)
where x must be an elementary uncertain number and u(x) is its standard uncertainty. The
worksheet evaluates the absolute value of ux (l) for x {ls , d1 , d2 , d3 , s , 1 , 2 , , }. A
chart displays the relative importance of each term.
Alternatively, the contribution of any uncertain number can be examined with the worksheet
function unIntermediate, which evaluates
uy (l) =
l
u(y) ,
y
(5)
where y need not be an elementary uncertain number and u(y) is the standard uncertainty of y.
The worksheet evaluates the absolute value of uy (l) for y {ls , d, s , , , } and displays
the values in a chart.
5.1.2 Reactance and impedance
In this example, estimates of three quantities associated with an electrical circuit element are
required: the resistance, R; the reactance, X and the magnitude of the impedance, Z [1, H.2].
Measurements have been made of the magnitude of the potential difference across the element,
V , the magnitude of alternating current flowing in the element, I, and the phase angle of the
potential difference with respect to current. Values of V , I and and their uncertainties are all
estimated from a set of repeated measurements of these quantities. Table 2 summarizes the
data used in the calculation. This table includes estimated correlation coefficients for the three
quantities.
The Excel worksheet calculation The Excel calculation is on the Impedance worksheet,
in the Examples.xls workbook.
The data from Table 2 are used to create elementary uncertain numbers for the three influence
quantities. Only the worksheet function unGaussian is used this time. Correlation
coefficients are assigned with unSetCorrelation. In addition, note that the function
Table 2: Influence quantities and correlation coefficients used in the resistance reactance example
influence
quantity
V
I
Excel
value
uncertainty
name
xi
u(xi )
v
4.9990 (V)
0.0032 (V)
i
19.661 (mA) 0.0095 (mA)
phi 1.04446 (rad) 0.00075 (rad)
Correlation coefficients
r(V, I) = 0.36
r(V, ) = +0.86
r(I, ) = 0.65
V
cos()
I
V
sin()
I
V
.
I
(6)
(7)
(8)
Because this probolem involves correlations, some worksheet functions require a trigger input
to synchronize their execution order with respect to other worksheet cells. This is the case for
the standard uncertainty calculation. unUncertainty takes a second argument referring to
the cell containing unCorrelations as a trigger. Calculation of correlation coefficients,
using unGetCorrelation, also needs synchronization. Excel may not calculate correctly
if these functions are executed in an arbitrary order.
As in the previous example, the relative importance of influences quantities on the uncertainty
in the results are examined using unComponent and displayed in charts.
due to errors in the scale as a whole, such as a manufacturing scale-factor error, or due simply
thermal expansion. The (unknown) systematic error will stay constant for a particular ruler,
given steady environmental conditions.
Each time a ruler is used, the accuracy of the measurement will be described by following
uncertain-number equation
x = scale (xraw + reading) ,
(9)
where x, scale and reading are uncertain numbers, shown in bold Roman font, and xraw is
the raw scale value.
The difference between a pair of measurements estimates the length of a widget and has three
sources of uncertainty: the systematic scale uncertainty, which is common, and an independent
uncertainty for each scale reading. As an uncertain-number equation we can write
li = scale [(xright + readingright ) (xleft + readingleft )] .
(10)
Here, the raw values are xleft and xright . We can think of the independent reading uncertainties
at each end of a widget, readingleft and readingright , as having value zero and uncertainty
0.03 mm. The systematic uncertainty, scale, has value 1 with relative uncertainty 1%.
Now the average length of N widgets is required, so the final step in the data processing
calculates
N
1 X
li .
(11)
lav =
N
i=1
It is interesting to see how the systematic and independent uncertainties propagate through this
last calculation into the mean. A full analysis of the problem shows that the systematic
uncertainty contribution to lav should not depend on the number of measurements in the
sample. On the other hand, the random errors should diminish in importance as the sample size
increases.
The Excel worksheet calculation The Excel calculation is in on the Length worksheet, of
the Examples.xls workbook.
Uncertain numbers for x left and x right, the raw data values, are created with
unConstant, which means that they are uncertain numbers of zero uncertainty. The reading
uncertainties, reading left and reading right, are created with a value of zero and a
standard uncertainty of 0.03 mm, using unGaussian. The scale uncertainty is defined just
once in the sheet, as scale. It has value 1 and standard uncertainty 0.01 (representing a
relative uncertainty of 1%).
Widget length is calculated using unEquation, taking references to uncertain numbers for
x left, x right, readingleft and readingright , as well as to scale. The single-cell
reference to scale ensures that it is treated as a single systematic source of uncertainty in the
calculations (there is a simple analogy here: each uncertain number cell corresponds to a
distinct source of uncertainty).
To sum up the widget lengths, unSum is used.2 The average widget length is obtained by
dividing by the number of widgets.
The components of uncertainty in the mean are calculated using unComponent. Note that the
uncertainty contribution in l av due to each of the reading left and reading right
influences is about 0.006 mm, smaller than the individual reading uncertainty of 0.03 mm.
2
There is also unSumIf, which can selectively include rows from a range.
These independent uncertainties are reduced by averaging. On the other hand, the uncertainty
contribution in l av due to scale is about 0.015 mm, which is 1% of the mean value. Hence
we see that the systematic uncertainty has not been reduced by averaging.
Correct treatment of systematic uncertainties is made easy by the way that individual uncertain
number (cells) are associated with corresponding (unknown) error values in the measurement
model.
References
[1] IS0 1995, Guide to the expression of uncertainty in measurement (International
Organization for Standardization, Geneva)
[2] B. N. Taylor and C. E. Kuyatt, Guidelines for Evaluating and Expressing the Uncertainty
of NIST Measurement Results, (NIST Technical Note 1297); see also
http://physics.nist.gov/cuu/Uncertainty/index.html
[3] United Kingdom Accreditation Service, The Expression of Uncertainty and Confidence
in Measurement, 2nd ed. (M3003, January 2007); see also
http://www.ukas.com/Library/downloads/publications/M3003.pdf
[4] B. D. Hall, Computing with Uncertain Numbers, Metrologia, 43 (2006) L56-L61.
[5] http://mst.irl.cri.nz/
10
A.
B.
C.
1.
Grant of Licence
11
1.2 The Licensee shall only be permitted to make Copies of the Software in accordance with
this Licence. The Licensee shall ensure that all Copies of the Software contain the copyright
and other proprietary notices which were on the original Software.
1.3 Only the individual Licensee is permitted to Use the Software under this License. If the
Licensee is part of a company or organisation, each person within that company or
organisation who Uses the Software must enter into a separate License with the Licensor.
Modifications
2.1 The Licensee may NOT modify, alter or distribute all or part of the Software. The
Licensee may combine the Software with other software, products or services. The Licensee
will compensate the Licensor against any loss or damage which the Licensor may suffer as a
result of any claim at any time that any modifications, alterations and/or combined works made
by or for the Licensee infringe any intellectual property rights of any third party.
3.1 The License does not include any assistance or training by the Licensor in connection
with the Software.
Licensees Undertakings
4.1 Other than as expressly provided for in this License, the Licensee will not:
4.1.1 copy or reproduce the Software;
4.1.2 translate, adapt, disassemble, decompile, reverse engineer, vary or modify the Software;
4.1.3 remove, obscure or alter any notice of patent, copyright, trademark or other proprietary
notice on the Software;
4.1.4 sub-license, distribute, rent, lease, or otherwise transfer the Software or any unique
access code for the Software;
4.1.5 make the Software accessible by any type of broadcast or transmission; or
4.1.6 enable a third party to do any of the acts set out in this clause 4;
4.2 The Licensee will:
4.2.1 ensure that any Use of Software is in accordance with the terms of this Licence; and
4.2.2 notify the Licensor as soon as possible where there is any change to the Licensees
contact details, either by written notice to the Licensor or where available, through a
function for updating contact details on the Licensors Website.
4.2.3 within fourteen (14) days after the date of termination or discontinuance of this Licence
for whatever reason, destroy the Software and all updates, upgrades or Copies, in whole
and in part, in any form including partial copies or modifications of the Software
received from the Licensor or made in connection with this Licence, and all
documentation relating thereto.
12
DISCLAIMER OF WARRANTY
LIMITATION OF LIABILITY
6.1 THE LICENSOR SHALL NOT BE LIABLE TO THE LICENSEE OR ANY OTHER
PERSON FOR ANY LOSS OF PROFITS, LOSS OF SAVINGS, LOSS OF DATA, OR
OTHER DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL OR INCIDENTAL LOSS OR
DAMAGE WHATSOEVER OR HOWSOEVER CAUSED ARISING OUT OF OR IN
CONNECTION WITH THIS LICENCE, THE SOFTWARE, ITS USE OR OTHERWISE.
7.1 The Software and all Intellectual Property Rights in the Software (including without
limitation all manuals and text incorporated into the Software, modifications and/or
enhancements to the Software made by the Licensor) are and shall at all times remain the
Licensors property.
7.2 To the best of the Licensors knowledge and belief, the Software does not infringe any
third partys intellectual property rights. If any valid claim of such infringement is brought to
the Licensors attention, it may, at its option:
7.2.1 obtain the right for the Licensee to continue to Use the Software; or
7.2.2 modify or replace the Software so it does not infringe; or
7.2.3 end this Licence immediately on giving written notice to the Licensee; or
7.2.4 take any other action as the Licensor deems appropriate in the circumstances.
7.3 The Licensee must immediately inform the Licensor, in writing, if the Licensee becomes
aware of any infringement of a third partys intellectual property rights.
8.1 This Licence shall commence on the date the Software is downloaded from the
Licensors Website and shall continue until terminated in accordance with this clause 8 or as
otherwise provided in this Licence.
13
8.2 The Licensor may by notice in writing to the Licensee terminate this Licence if:
8.2.1 the Licensee is in breach of this Licence and fails to remedy such breach (if capable of
remedy) within thirty (30) days of having received written notice from the Licensor
specifying such breach; or
8.2.2 if Licensee ceases to carry on business or a substantial part of its business or enters into
liquidation whether compulsory or voluntary other than for the purpose of amalgamation
or reconstruction or compounds with its creditors generally or has a receiver or manager
or administrator appointed over all or any part of its assets or in the reasonable opinion
of the Licensor becomes unable to pay its debts as they fall due.
8.3 Either party may terminate this Licence by giving the other party not less than thirty (30)
days written notice.
Consequences of Termination
10
General
10.1 The Licensee shall not assign, sub-license, or otherwise transfer all or any part of the
Software or this Licence without the prior written consent of the Licensor.
10.2 A failure by a party to enforce a provision of this License will not constitute a waiver of
any right to future enforcement of that or any other provision.
10.3 Headings used in this Licence are inserted for convenience or reference only and are not
intended to be part of or to affect the meaning or interpretation of any of the provisions of this
Licence.
10.4 In the event that any term or provision of this License is unlawful, such provision will
be severed to the extent of such violation and the remaining provisions enforceable, but only if
the severance does not materially affect the purpose of, or frustrate, this License.
14
10.5 This Licence shall be governed by and construed in accordance with the laws of New
Zealand and shall be subject to the exclusive jurisdiction of the New Zealand Courts.
10.6 Any notice to be given by either party to the other may be left at or sent by pre-paid post
or confirmed facsimile transmission (as appropriate) to the address notified by either party
from time to time.
10.7 This Licence supersedes all prior licences, agreements and arrangements of whatever
nature and sets out the entire agreement and understanding between the Parties relating to its
subject matter. No changes to this Licence shall be agreed unless they are signed by both
Parties.
10.8 The United States and other countries control the export of software and information.
The Licensee agrees to comply with such restrictions and not to export or re-export the
Software. By downloading the Software, the Licensee agrees that it is not in a country where
such export is prohibited or it is a person to which such export is prohibited. The Licensee is
responsible for compliance with the laws of its local jurisdiction regarding the import, export
or re-export of the Software.
10.9 The Licensee agrees that it has not relied on any prior representations in entering into
this Licence.
11
Definitions
11.1 In this Licence the following expressions have the following meanings:
Copy/ies either a copy of the Software made by the Licensee solely for backup or archival
purposes, or transfer of the Software to a single hard disk provided the Licensee keeps the
original solely for backup or archival purposes.
Licensors Website the website where the Licensee can download the Software the address
of which is mst.irl.cri.nz.
Manual the manual for the Software.
Intellectual Property Rights any and all copyright, trademarks, source code, patents and
pending patents and all other intellectual property rights in the Software, including, without
limitation, any modifications made by the Licensor.
Parties collectively the Licensor and Licensee.
Software means the executable version of the software programs identified in Schedule A
including any derivative of that design and software and any documentation supplied by the
Licensor relating to the design and software, including, without limitation, the Manual.
Use use of the Software by the Licensee, to load or incorporate the Software into, or to run
or load it into a product of the Licensee or service provided by the Licensee, or store and run it.
SCHEDULE A
The SGUM.xllproduct, including the Manual and other supporting files.
15