GumCalc
|
![]() |
To install the measurement-modeling software (GumCalc, Borland C++ version) on your Windows-based computer:
Generally you can accept the default answers in the installation program. You should not need administrator privileges to perform the installation.
The Borland C++ version of GumCalc is no longer maintained or updated.
Download Borland C++ version (updated 2005-10-17)
The more recent work on GumCalc has been done using Microsoft Visual C++. The Visual C++ version provides a better user interface and more features than the original version. The newer development system also provides a more standard version of the C++ language and standard library.
The links below allow you to download an installer package, Gum Calculator.msi, which will install GumCalc and required files on your computer. The 2009 version has a couple of known minor bugs. The bugs in the 2010 version (produced using Visual Studio 2008 and Windows 7) are still unknown.
Download Microsoft Visual C++ version
(2009-09-06 build)
Download Microsoft Visual C++ version
(2010-06-29 build)
GumCalc began as a Windows XP project, although I’ve seen it run under Vista too. I only recently acquired a Windows 7 computer (64-bit). I installed GumCalc on it without any obvious problems and now I’m maintaining it there, but I can’t yet promise that there are no issues at all.
The 2010 version provides the ability to include arbitrary positive numerical factors in a unit expression, allowing expressions like pCi/100 cm2. I’m not sure how kosher this is, but it is a common practice when reporting swipe measurement results in the U.S. This feature raises new questions about the syntax of unit expressions, since an expression of the form a2/3 b could reasonably be interpreted now as either a2/3 b or a2 / (3 b). The parser currently uses the first of these interpretations, but I recommend that you use parentheses to eliminate any possible ambiguity (either a(2/3) b or a2/(3 b)).
GumCalc is an automated measurement-modeling tool. The most important feature, which makes it different from most other calculation tools, is its ability to propagate measurement uncertainty automatically. A second unusual feature is its ability to propagate the dimensions of measurable quantities. These two features together provide the developer’s rationale for calling it a “measurement-modeling tool” rather than a calculator program.
The program allows the user to specify a measurement model as a collection of definitions of variables and functions. Each model may be saved in an electronic file and reopened and edited later. GumCalc also provides a capability to “run” a model on imported sets of data, with the values of specified variables being obtained from import files in CSV format. When the model runs, it can also export results to CSV files, which presumably can then be uploaded to other software systems or even a LIMS.
Model variables come in four types:
Measurement uncertainty is introduced into a model via the input quantities. The user specifies the value and uncertainty of an input quantity by specifying a type of probability distribution and the values of the parameters of the distribution. When other results (output quantities) are calculated from input quantities, they acquire uncertainty too. The uncertainty of an output quantity (combined standard uncertainty) is automatically determined by uncertainty propagation.
The creator of a model can define variables and functions in any order, without worrying about the order of evaluation. The application itself determines the evaluation order that is needed to obtain meaningful results. It is possible for the model creator to create circular definitions, but GumCalc will detect any circularity without entering an infinite recursion, which would crash the program.
Dimensions in GumCalc are built up from the seven base quantities of the International System of Units (SI). The seven base units of the SI are “hard-coded” in the program, while all other units are defined in XML setup files. The unit prefixes of the SI are also hard-coded in the program, and the unit setup files specify which units can be used with prefixes.
GumCalc is directly descended from a primitive DOS-based ancestor called “LabCalc,” which was developed at the USEPA National Air and Radiation Environmental Laboratory about 1994. Keith never enjoyed using electronic spreadsheet programs to automate typical laboratory calculations; so, he designed LabCalc to let the user define a measurement model by typing a set of equations that defined variables and functions, each identified by name. A model could be developed conceptually as a set of written equations (e.g., in Word, WordPerfect, or TEX) and then translated easily into LabCalc’s language, one equation at a time. Although LabCalc propagated uncertainty automatically, it did not propagate the dimensions of quantities. It provided some features for unit conversions, which were useful but hardly breathtaking.
Since LabCalc was DOS-based and command-line oriented, almost nobody but the developer ever took advantage of its capabilities.
During the late 1990s Keith borrowed the concepts he had used to provide automatic uncertainty propagation in LabCalc (a standalone application), and created C++ library classes and functions to allow other software systems to propagate uncertainty automatically. The classes were designed so that a programmer could write code to calculate the result of a measurement and let the library propagate uncertainty in the background. Eventually this library was presented at the 2003 Radiobioassay and Radiochemical Measurements Conference (RRMC) in Jackson, WY, and the source code was made available for free download at this web site. (In 2007 the old code was removed from public view, because Keith had a newer, better implementation.)
For several years, while Keith was a member of the MARLAP workgroup, Dr. Carl Gogolak, another workgroup member, occasionally suggested that LabCalc be rewritten as a Windows GUI application, or that Keith develop a GUI application to wrap around the class library described at the RRMC. Keith agreed with Carl in principle, but he knew that either task would be less simple than it sounded. From time to time, Keith’s boss, Dr. John Griggs, who chaired the MARLAP workgroup, also said that new software would be needed to help radiochemistry labs implement MARLAP’s guidance. The MARLAP manual was finally approved and released in 2004; and in late 2004 Keith started the GumCalc project. GumCalc is intended to be what LabCalc always wanted to be when it grew up.
GumCalc is still a work in progress, but it has many of the features envisioned, including:
Features available only in the Visual C++ version:
Ideas for future work include:
The first four of these items are likely to be implemented first. When these four features are in place and the system has been rigorously tested, GumCalc might be considered to be fully operational. On the other hand the next two items (Monte Carlo and effective degrees of freedom) seem important too, and they might be implemented together with the first four.
Although it is listed last, providing built-in functions to calculate ingrowth factors with uncertainties is appealing. The functions would probably be called decayP and decayA, and they would calculate decay/ingrowth factors based on probability (or atoms) and activity, respectively. There would also be overloaded versions for average decay and ingrowth factors during a counting interval.
GumCalc has some aspects that may seem odd on first encounter. Many of us are accustomed to performing a series of calculations with numbers, using mathematical functions such as exp, log, or sin, without worrying about the units of measurement till the final result is obtained. Since GumCalc propagates the dimensions of quantities step by step as it calculates the results of these functions, it must enforce some restrictions on the values of the arguments.
Since the dimension of a quantity is a product of powers of the seven “base dimensions,” it makes sense to raise a quantity x to a power or take its square root, but it makes no metrological sense to say exp(x), log(x), or sin(x) unless x is dimensionless. This does not mean that x cannot be expressed in some unit of measurement, but the unit must be a dimensionless unit, such as the radian, degree, or percent.
Similar observations can be made about raising a quantity y to the power x. The expression yx makes no sense unless x is dimensionless.
One may encounter expressions of this sort in the literature, but they make sense only if the unit of measurement is specified. When an equation is written in terms of the numerical values of quantities relative to specified units, all the variables in the equation become dimensionless and anything goes. GumCalc on the other hand allows one to write equations in terms of the values of the quantities, not just the numerical values, and this fact requires one to be more careful. It also helps the software detect logical errors in the user’s work.
Looking at it another way, writing “yx where x is the mass of the residue in milligrams” is equivalent to writing “yx/(1 mg) where x is the mass of the residue.” The latter version makes it clear that the exponent is a dimensionless ratio. It would be nonsensical to say “yx where x is the mass of the residue” without specifying the unit of measurement for x.
A second issue is the fact that GumCalc cannot distinguish between different types of quantities unless they have different dimensions. For example, activity, count rate, and frequency are three different types of quantities and are usually expressed in different units. However, since all three have the dimension of reciprocal time, T−1, GumCalc cannot distinguish one type from the other, and it allows you to express any of these quantities in any unit of measurement that has the dimension of reciprocal time. For example, you can convert a frequency from hertz (Hz) to becquerels (Bq), and GumCalc won’t detect the error. Of course GumCalc will not let you use a unit with the wrong dimension for the quantity being expressed.
One other quirk exists because of the software’s need to compare dimensional exponents without rounding error when adding or subtracting quantities. To eliminate rounding error, GumCalc requires that dimensional exponents be rational numbers, not floating-point numbers. So, a quantity that is not dimensionless cannot be raised to a power that isn’t rational. Therefore, if the dimension of x is not unity, you can evaluate x3/5 but not x0.6, because GumCalc obtains a rational value for the expression 3/5 and a floating-point value for the expression 0.6. With an enhanced numeric parsing function, this limitation might be partially eliminated, so that the program would recognize 0.6 as equivalent to 3/5, but the requirement that dimensional exponents be rational is likely to remain.
Combining automatic uncertainty propagation with “unit propagation” reveals relationships between the two that may not be obvious. In particular, the uncertainty of the result of a measurement depends on the unit of measurement. It should be clear that the numerical value of the uncertainty depends on the unit of measurement, but in fact the actual value of the uncertainty depends on it too.
Why does the uncertainty depend on the unit of measurement? Because measuring a quantity really means determining the ratio of that quantity to another specified quantity — the unit of measurement — and the uncertainty of that ratio depends on the unit. The value of the ratio may be known better for some units than others. For example, if you want the uncertainty of the mass of the prototype kilogram standard, it matters whether the value is expressed in kilograms or unified atomic mass units. If the unit is the kilogram, the uncertainty is exactly zero. If the unit is the unified atomic mass unit, the uncertainty is positive. Conversely, the mass of an atom of carbon-12 in its ground state is known with no uncertainty if it is expressed in atomic mass units, but it has positive uncertainty if it is expressed in kilograms.
Although the uncertainty of a measurement result depends on the unit, the interface that GumCalc presents does not make this fact obvious, because it provides a function u(x) that returns the standard uncertainty of the argument x, and the unit of measurement is not specified. GumCalc can do this only because it implicitly bases all quantities on the International System of Units (SI), which provides a frame of reference in which the concept of the uncertainty is unambiguous.
In GumCalc the expression u(x) returns u({x}) × [x], where [x] is the appropriate SI unit for x (base unit or coherent derived unit) and {x} is the numerical value of x with respect to that unit. When you evaluate the expression x in the Evaluation window, you can specify any appropriate unit for the result, and GumCalc will evaluate the uncertainty properly for the chosen unit. Note: The uncertainty you get may differ from what you would get by evaluating the expression u(x) with the same unit.
The GumCalc icon (a red-green-blue delta) has no significance. It was designed only to be easily recognizable on the desktop.
| Feedback |
top | 25 Apr 2010 Keith |