# ISO 7066-2-1988

BRITISH STANDARD CONFIRMED MARCH 1998 BS7118-2: 1989 ISO7066-2: 1988 Measurement of fluid flow: assessment of uncertainty in the calibration and use of flow measurement devices — Part 2: Non-linear calibration relationships [ISO title: Assessment of uncertainty in the calibration and use of flow measurement devices — Part2 Non-linear calibration relationships] UDC 532.57.089.6:681.121.089.6:532.57.088.3BS7118-2:1989 This British Standard, having beenprepared under the directionof the Industrial-process Measurement and Control Standards Policy Committee, waspublished under the authorityof the Board of BSI andcomes into effect on 29September1989 © BSI 10-1999 The following BSI references relate to the work on this standard: Committee reference PCL/2 Draft for comment85/29857 DC ISBN 0 580 17382 8 Committees responsible for this British Standard The preparation of this British Standard was entrusted by the Industrial-process Measurement and Control Standards Policy Committee (PCL/-) to Technical Committee PCL/2, upon which the following bodies were represented: British Compressed Air Society British Gas plc Department of Energy (Gas and Oil Measurement Branch) Department of Trade and Industry National Engineering Laboratory Electricity Supply Industry in England and Wales Energy Industries Council GAMBICA (BEAMA Ltd) Institute of Measurement and Control Institute of Petroleum Institute of Trading Standards Administration Institution of Gas Engineers Institution of Mechanical Engineers Water Authorities’ Association The following bodies were also represented in the drafting of the standard, through subcommittees and panels: Ministry of Defence Yorkshire Water Authority Amendments issued since publication Amd. No. Date of issue CommentsBS7118-2:1989 © BSI 10-1999 i Contents Page Committees responsible Inside front cover National foreword ii 0 Introduction 1 1 Scope and field of application 1 2 References 1 3 Definitions 1 4 Symbols and abbreviations 1 5 Curve fitting 2 5.1 General 2 5.2 Computational methods 3 5.3 Selecting the optimum degree of fit 3 6 Uncertainty 4 Annex A Regression methods 5 Annex B Orthogonal polynomial curve fitting 8 Annex C Computer program using orthogonal polynomials 9 Annex D Examples 15 Annex E Finite-difference method 25 Figure 1 — Calibration data fitted using a second-degree polynomial 21 Figure 2 — Calibration data fitted using a third-degree polynomial 22 Figure 3 — Calibration data fitted using a fifth-degree polynomial 23 Figure 4 — Stage-discharge curve fitted using a fourth-degree polynomial 24 Table 1 — Calibration data for a differential pressure flow-meter 19 Table 2 — Calibration data for a turbine meter 19 Table 3 — Calibration data for a stream flow station 20 Table 4 — Finite-difference table 25 Publications referred to Inside back coverBS7118-2:1989 ii © BSI 10-1999 National foreword This Part of BS7118has been prepared under the direction of the Industrial-process Measurement and Control Standards Policy Committee and is identical with ISO7066-2 “Assessment of uncertainty in the calibration and use of flow measurement devices — Part2: Non-linear calibration relationships”, published by the International Organization for Standardization (ISO). It is envisaged that BS7118-1, dealing with linear calibration relationships, will be identical with ISO7066-1 1) . Terminology and conventions. The text of the International Standard has been approved as suitable for publication as a British Standard without deviation. Some terminology and certain conventions are not identical with those used in British Standards; attention is drawn especially to the following. The comma has been used in certain places as a decimal marker. In British Standards it is current practice to use a full point on the baseline as a decimal marker. Wherever the words “this part of ISO7066” appear, referring to this standard, they should be read as “this Part of BS7118”. A British Standard does not purport to include all the necessary provisions of a contract. Users of British Standards are responsible for their correct application. Compliance with a British Standard does not of itself confer immunity from legal obligations. Summary of pages This document comprises a front cover, an inside front cover, pagesi andii, pages1 to26, an inside back cover and a back cover. This standard has been updated (see copyright date) and may have had amendments incorporated. This will be indicated in the amendment table on the inside front cover. 1) In preparation Cross-reference International Standard Corresponding British Standard ISO5168:1987 BS5844:1980 Methods of measurement of fluid flow:estimation of uncertainty of a flow-rate measurement (Identical)BS7118-2:1989 © BSI 10-1999 1 0 Introduction The method of fitting a straight line to flow measurement calibration data and of assessing the uncertainty in the calibration are dealt with in ISO7066-1. ISO7066-2 deals with the case where a straight line is inadequate for representing the calibration data. 1 Scope and field of application This part of ISO7066describes the procedures for fitting a quadratic, cubic or higher degree polynomial expression to a non-linear 2)set of calibration data, using the least-squares criterion, and of assessing the uncertainty associated with the resulting calibration curve. It considers only the use of polynomials with powers which are integers. Because it is generally not practicable to carry out this type of curve fitting and assessment of uncertainty without using a computer, it is assumed in this part of ISO7066 that the user has access to one. In many cases it will be possible to use standard routines available on most computers; as an alternative the FORTRAN program listed in Annex C may be used. Examples of the use of these methods are given in Annex D. Extrapolation beyond the range of the data is not permitted. Annex A, Annex B, Annex C, Annex D and Annex E do not form integral parts of this part of ISO7066. 2 References ISO5168, Measurement of fluid flow — Estimation of uncertainty of a flow-rate measurement 3) . ISO7066-1, Assessment of uncertainty in the calibration and use of flow measurement devices — Part1: Linear calibration relationships 4) . 3 Definitions For the purposes of this part of ISO7066, the following definitions apply. 3.1 method of least squares technique used to compute the coefficients of a particular form of an equation which is chosen for fitting a curve to data. The principle of least squares is the minimization of the sum of squares of deviations of the data from the curve 3.2 polynomial (function) for a variable x, a series of terms with increasing integer powers of x 3.3 regression analysis the process of quantifying the dependence of one variable on one or more other variables NOTEMany of the available computer programs suitable for curve fitting have the word “regression” in the title. For the purposes of this part of ISO7066, the terms regression and least squares may be regarded as interchangeable. 3.4 standard deviation the positive square root of the variance 3.5 variance a measure of dispersion based on the mean of the squares of deviations of values of a variable from its expected value 4 Symbols and abbreviations 2) These procedures are also suitable for a linear set of calibration data. 3) At present at the stage of draft. (Revision of ISO5168:1978.) 4) At present at the stage of draft. b j coefficient of x j C jb element of the inverse matrix e r ( ) random uncertainty of variable contained in parentheses a e s ( ) systematic uncertainty of variable contained in parentheses a total uncertainty of calibration coefficient a g j coefficient of jth orthogonal polynomial m degree of polynomial n number of data values p j (x) jth orthogonal polynomial s( ) experimental standard deviation of variable contained in parentheses s r residual standard deviation of data values about the curve t Student’s t x the independent variable x* arbitrary specified value of x arithmetic mean of the data values x i x i value of x at the ith data point x j jth independent variable (in multiple linear regression) x ji value of x jat the ith data point y the dependent variable e y ˆ c () xBS7118-2:1989 2 © BSI 10-1999 5 Curve fitting 5.1 General Before attempting polynomial curve fitting, consideration should be given to whether a simple transformation of the x variable or the y variable or both may effectively linearize the data to enable the straight line methods described in ISO7066-1 to be used. Some appropriate transformations are suggested in ISO7066-1. If it is not possible to establish a straight line, then the objective is to find the degree and coefficients of the polynomial function which best represents a set of n pairs of (x i , y i ) data values obtained from calibration. If, for example, a quadratic expression is chosen, the curve will be of the form The general polynomial expression is = b 0 + b 1 x+.+b j x j +.+b m x m or By applying the least-squares criterion, the coefficients b jare computed to minimize the sum of squares of deviations of the data points from the curve: where is the value predicted by equation (2) atx = x i . In some cases, the degree m of the polynomial will be predetermined; for example, it may be known from experience that the calibration data will be satisfactorily represented by a cubic (m =3) expression. Otherwise, the degree of fit is chosen by increasing the degree until an optimum is achieved (see5.3). If in increasing the degree of fit beyond a moderate degree significant improvements in the fit, as described in5.3, continue to occur, then it is likely that the functional dependence is not suitable for representation by a polynomial; further, if the equation fitted has too many terms, the curve may display spurious oscillations. A not uncommon example is data which are virtually constant over most of the x range, but which vary strongly close to one end of the range. In such cases, it is appropriate to divide the range into sections (see ISO7066-1) which either are linear or can be fitted by a low-degree polynomial. Alternatively, transforming one or both variables may lead to a linear or low-degree polynomial function; transforming the independent variable to its reciprocal1/x will in some cases result in adequate linearity. The least-squares methods described in this part of ISO7066 may not be appropriate if the effect of the random uncertainty e r (x) of the data values x iis not negligible in comparison with that of the random uncertainty e r (y) of the y values. As in ISO7066-1, if the magnitude of the slope 5)of the calibration curve is always less than one-fifth of e r (y)/e r (x), the methods may be regarded as appropriate; where this does not apply the mathematical treatment is outside the scope of this part of ISO7066. If therefore the normal practice in calibrating any particular meter is to plot the variables in such a way that the above condition does not hold, then either the conventional choice of abscissa and ordinate is to be reversed or this part of ISO7066cannot be used. If either variable is transformed before fitting, then the uncertainties referred to above, and later (clause6), relate to the new transformed variables. If, as a result of transforming the dependent variable, the random uncertainty e r(y) cannot be regarded as constant over the range, then a weighted least-squares method should be used. The weighted least-squares method is not described in this part of ISO7066 but many computer library routines allow the data to be weighted. arithmetic mean of the data values y i value of y predicted by the equation of the fitted curve y i value of y at the ith data point value of at x = x i number of degrees of freedom a In some International Standards, the symbols U and E have been used instead of e. = b 0 + b 1 x + b 2 x 2 . . . (1) . . . (2) y y ˆ y ˆ i y ˆ y ˆ y ˆ y ˆ i 5) “Slope” here means the derivative=b 1 +2b 2 x +. . dy ˆ dx ⁄BS7118-2:1989 © BSI 10-1999 3 5.2 Computational methods Standard library routines for least-squares curve fitting are available on most computers. The method for fitting a straight line described in ISO7066-1 is commonly known as linear or simple linear regression: the equivalent method for fitting a polynomial may be described as polynomial or curvilinear regression, which is a special type of multiple linear regression. Annex A gives further information on regression methods and how to use them. As an alternative to the standard regression routines, the orthogonal polynomial method described in Annex B may be used: this method is particularly suitable when the degree of fit is not known beforehand. Annex C lists an appropriate orthogonal polynomial computer program. When a computer is not available and the x values are uniformly spaced, a finite-difference method (seeAnnex E) may be used to provide a quick indication of what degree of fit may be appropriate to represent the data. The coefficients of a polynomial representing the data may also be calculated, but this will not be the least-squares polynomial. The calculation of uncertainty using this method is beyond the scope of this part of ISO7066. 5.3 Selecting the optimum degree of fit The optimum fit is determined by trying increasing values of the degree m, either up to a specified maximum or until no further significant improvement occurs. The residual standard deviation s rshould be computed for each degree (s r is the square root of the residual variance) using the equation where is the value predicted by the polynomial expression [equation (2)] at x = x i . NOTEs r 2is equivalent to the term s 2 (y, x) used in ISO7066-1. The degree m should always be much less than the number n of data points. If the data are well represented by a polynomial of degree m, then s rwill decrease significantly until the degree m is reached; thereafter s rwill remain approximately constant. In general, however, the degree at which the decrease in s rceases to be significant is not obvious, and an objective test of significance should be used as an aid to finding the optimum degree of fit. Increasing the degree from m–1 to m is regarded as providing a statistically significant improvement in the fit if the new coefficient b mdiffers significantly from zero, i.e.if b m + t 95s (b m ) and b m – t 95s(b m ) (the95% confidence limits of b m ) do not include zero. This condition may be expressed as where t 95is the Student’s t value for the95% confidence level with = n–m–1. The value of t 95as a function of the number of degrees of freedom v can be computed from the following empirical equation: For the orthogonal polynomial coefficient g m(seeAnnex B), the condition is Expressions for the variances of the coefficientss 2 (b m ) and s 2 (g m ) are given in Annex A and Annex B respectively. It is important to test the effect of increasing the degree at least one degree beyond that whi