
NPL's Software to Support ISO/TS 28037:2010(E)
----------------------------------------------

This file describes the files that constitute Release 1 of NPL's Software to Support ISO/TS 28037:2010(E).

Software implementing the algorithms described in the ISO Technical Specification "Determination and use 
of straight-line calibration functions" has been developed by the National Physical Laboratory (NPL) in 
the United Kingdom. The software is available as a compressed ZIP folder from the web sites of NPL at

www.npl.co.uk/mathematics-scientific-computing/software-support-for-metrology/software-downloads-(ssfm) 

and the International Organization for Standardization at

standards.iso.org/iso/ts/28037/. 

The software should be extracted from the ZIP folder before use. 

Software, developed in the MATLAB programming language, is provided in the folder 'matlab' in the form 
of M-files and in the folder 'html' as HTML files published using MATLAB Version 7.10.0 (R2010a). 

For users of MATLAB, the M-files may be run directly and also modified to run the algorithms for different 
measurement data. To do this, the user can, for example, ensure the folder containing the M-files is 
included on the MATLAB path and run a MATLAB script from the MATLAB command line. 

For users who do not have access to MATLAB, the software is best viewed as the provided HTML files. To do 
this, the user can, for example, move to the folder containing the HTML files and open a file using a 
browser such as Microsoft Internet Explorer. The software may be used as the basis for preparing 
implementations of the algorithms in other programming languages. 

Within the files, calls are made to a number of MATLAB functions that are also included with the software. 
For example, the function algm_gdr1_steps_2_to_5 implements steps 2 to 5 of the calculation procedure for 
case b) of 5.3.2 (uncertainties are associated with the measured values xi and yi and all covariances 
associated with the data are regarded as negligible) specified in 7.2.1. In addition, some use of MATLAB 
built-in functions is made, such as for obtaining the Cholesky factorization of a matrix.

MATLAB scripts (having extension '.m') and HTML files ('.html') are provided as follows: 

1. TS28037_WLS1 runs the numerical example of weighted least squares (WLS) with known equal weights
	described in Clause 6, and performs the prediction described in 11.1 EXAMPLE 1 and forward 
	evaluation described in 11.2;

2. TS28037_WLS2 runs the numerical example of weighted least squares (WLS) with known unequal weights 
	described in Clause 6 and performs the prediction described in 11.1 EXAMPLE 2;

3. TS28037_WLS3 runs the numerical example of weighted least squares (WLS) with unknown equal weights 
	described in Annex E;

4. TS28037_GDR1 runs the numerical example of generalized distance regression (GDR) described in 
	Clause 7;

5. TS28037_GDR2 runs a numerical example to illustrate the algorithm for generalized distance regression 
	(GDR) described in Clause 8;

6. TS28037_GMR runs the numerical example of Gauss-Markov regression (GMR) described in Clause 9;

7. TS28037_GGMR1 runs the numerical example of generalized Gauss-Markov regression (GGMR) described in 
	Clause 10;

8. TS28037_GGMR2 runs the numerical example of GGMR described in Clause 10 and Annex C EXAMPLE 1 using 
	the orthogonal factorization approach described in C.2;

9. TS28037_GGMR3 runs the numerical example of GGMR described in Annex C EXAMPLE 2 using the orthogonal 
	factorization approach described in C.2.

NOTES 

A. While prediction and forward evaluation are implemented only in the scripts that solve WLS problems, 
	the MATLAB code corresponding to these uses of the calibration function may be copied and pasted 
	into any of the provided scripts. 

B. In a tableau generated by a script that solves a WLS, GDR or GMR problem, zero is displayed (to the 
	same number of digits of precision as other values in the tableau) where a blank cell appears in 
	the tableau in the corresponding example of the Technical Specification. 

C. For general user data, it is suggested that convergence is considered to have been achieved when the 
	magnitudes of all increments relative to the initial approximations to the straight-line 
	parameters are no greater than 1e-7. In this case, the tolerance can be assigned using the 
	command "tol = 1e-7*norm([ai, bi]);". For most practical purposes, this value will be sufficient. 

The software should be used in conjunction with the Technical Specification. It is strongly recommended 
that users study the Technical Specification before running the software.

The software is provided with a software licence agreement (REF: MSC/L/15/007) and the use of the software 
is subject to the terms laid out in that agreement. By running the MATLAB code, the user accepts the terms 
of the agreement. 

The software licence agreement supersedes the licence agreement (REF: MSC/L/10/001) referred to within 
several MATLAB and HTML files. In each HTML file that refers to the superseded licence agreement, the 
link "software licence agreement" no longer works. Otherwise the operation of the software should not be 
affected. 

Enquiries about the software should be directed to 

Ian Smith (ian.smith@npl.co.uk) 

or

Peter Harris (peter.harris@npl.co.uk). 

