Metas.UncLib

Metas.UncLib (Metas Uncertainty Library) is a generic measurement uncertainty calculator developed by METAS. It's written in C# within the .NET Framework. There is a wrapper library Metas.UncLib.Matlab, which allows the use of Metas.UncLib from MATLAB through the COM interface. It allows the easy treatment of multivariate uncertainties with MATLABs syntactic sugar for vector and matrix calculations.

Features

Metas.UncLib is a generic measurement uncertainty library which supports

  • Multidimensional treatment of measurement uncertainty
  • Correlations
  • Complex-valued measurands
  • Measurement uncertainty propagation - linear, higher order, numerical (preliminary!)
  • Advanced mathematics - vector and matrix algebra, fft, ...
  • Archiving and storage of results - keeping full information
  • Interfacing with other applications - COM and .NET

Metas.UncLib will not help to build a measurement model and it does not provide a fancy user interface. The latter however is compensated by its interface capabilities, which allows the use of the library from many applications (as e.g. MATLAB) and programming or scripting languages.

Examples

C#

using Metas.UncLib.Core;
using Metas.UncLib.LinProp;
...
// Definition of the inputs
UncNumber a = new UncNumber(3.0, 0.3);
UncNumber b = new UncNumber(4.0, 0.4);
// Compute the output
UncNumber c = Math.Sqrt(a * a + b * b);
// Display some results
System.Console.WriteLine("c      = {0,7:f3}", c.Value);
System.Console.WriteLine("u(c)   = {0,7:f3}", c.StdUnc);

MATLAB

> unc = @LinProp;
> a = unc(3, 0.3);
> b = unc(4, 0.4);
> c = sqrt(a.*a + b.*b)
c = (5 ± 0.367151)

Concept

Uncertain quantities are represented by an abstract data type which contains not only the value of the quantity but also the sensitivities with respect to basic input quantities. Sensitivities are updated at each computational step by applying the chain rule, a technique called automatic differentiation. Uncertainties of quantities and correlations between quantities can be calculated on demand. An object oriented implementation with overloaded operators hides the complexity of the calculations from the user.

The Metas.UncLib implementation is optimized for speed and low memory requirements and is thus particularly well suited for the multivariate treatment of larger data sets.