LabCalc2: Scientific Calculations and Uncertainty Analysis

LabCalc2 is a Scientific Calculator designed to meet the demands of professionals and students in laboratories in the fields of science and engineering. LabCalc2 is not just a calculation tool; it is an advanced platform for accurate and reliable uncertainty analysis.

Main Features:

  • Comprehensive Mathematical Functionalities: LabCalc2 provides essential mathematical functions, supporting double precision numbers and measurements with uncertainties.
  • Optimized Navigation: Intuitive navigation system, allowing easy interaction with the expression being edited and the calculation history.
  • Memory for Results: Store up to 8 different results for quick and efficient access.
  • Diverse Statistical Models: With 3 models for calculating averages and 3 for mean deviations, LabCalc2 is an indispensable tool for statistical analyses and determination of uncertainties.
  • Final Value Truncation: Obtain clear and precise results with the final value truncation functionality.

Precision and Rigor in Uncertainty Analysis

LabCalc2 excels in calculations with uncertainties, following the guidelines of the numerical method detailed in the article “Mechanical Measurements and Uncertainties” (available in Portuguese and English). This modular methodology is widely used in Physics laboratories in higher education, ensuring an effective combination of theory and practice.

Whether you are an engineer, scientist, student, or teacher, LabCalc2 is ready to become an indispensable tool in your daily routine.

Vocabulary

Before proceeding with the presentation of LabCal2, we will provide a brief section with some common terms that may appear throughout the text, for a better understanding.

  • value – refers to any numerical value, generally a real number;
  • measurement – here, it refers to a value (real number) followed by another real value, like its uncertainty. As the aim of this application is to work with uncertainties, the set (value ± uncertainty) will be frequently referenced throughout the text and, therefore, it is convenient to name it as measurement;
  • uncertainty – a value that expresses the imprecision in a measurement;
  • stack – the stack of values used in the statistical part of the calculator;
  • expression – refers to a valid mathematical expression or just a value or measurement.

Introduction

Generally speaking, LabCalc2 consists of four fundamental elements:

  1. Header – with access to the menu, title, and the button for selecting the color theme (light, dark, and system).
  2. Display – the display is where mathematical expressions are entered, the history of entries is recorded, and results are presented.
  3. Information Bar – this bar displays the calculator’s settings such as the status/value of fix, radians/degrees, truncation status, mathematical models for averages and mean deviation, and the number of values entered for statistical calculation.
  4. Keyboard – the input keys for the calculator.

The following sections will detail some of these elements.

Display

In this version, the display uses simple text and not the more sophisticated drawing of the expression on the display, as in modern calculators. Therefore, functions are explicitly presented and not drawn, such as the expression x³ will be represented by the expression pow3(x).

Although visually it may not be very attractive, this simplified the first version so that it could focus on developing operations and functions with values and measurements more comprehensively.

In a future version, I plan to implement some graphical interface for the display, but I think this will still be after adding vector algebra to the project.

Keyboard

The keys on the keyboard are grouped by color according to their applications and functions. Taking a tour through the lines of the keyboard:

2nd Key

The $2nd$ key enables access to the second function of the keyboard, changing the labels and icons of the keys that have a second function. These keys are highlighted in yellow to stand out when changed.

Directional Keys

The directional keys allow you to navigate through the expression being edited (left and right) or through the history of entered expressions (up and down).

To facilitate the entry of functions, the movement with the right and left keys prioritizes the selection of the elements of the function that have not yet been filled in, rather than just moving laterally.

Memory Management

On the second line of the keyboard are the keys for managing memories. LabCalc2 has eight dynamically used memories, capable of storing both a value and a measurement. Memories A, B, C, and D are accessed directly from the keyboard, and memories E, F, G, and H when the $2nd$ key is active.

To store a value in memory, simply press the STO (storage) key and then the key for the target memory. When the STO key is pressed, it turns orange, waiting for a memory key to be pressed to complete the operation. If pressed twice in succession, STO is deactivated, returning to its original color, white.

The storage of a value/measurement in memory always occurs in the order:

  1. If there is an expression on the display, it will be executed and its value sent to memory.
  2. If there is no expression on the display, the last processed result (Ans) will be sent to memory.

For instance, the sequence:

\begin{equation}
1.2*(4.4\pm.2)\, \text{STO\, A}
\end{equation*}

will execute the expression $1.2*(4.4±.2)$ and its result ($5.28 ± 0.24$) will be stored in memory A. If STO B is pressed next, the previous result will be stored in memory B.

To use a value in memory, just select the letter of the memory, adding it to an expression, and it will be used.

\begin{equation}
\text{A} – 2\text{B}
\end{equation*}

Note that the result of this operation will be $-5.28 ± 0.72$. Although the value is the same, the uncertainty will increase with each operation, as predicted by the mathematical model employed here.

The next sections will continue with the description of the keyboard functionalities.

Measures and Statistics

In the third line of the keyboard are the buttons related to measures, with the first three being:

  • Input for a measure, button $x ± δx$. This button simply adds a measure to the expression.
  • Button $\pm$. This button is used to navigate between the value and the uncertainty of a measure, always selecting them, or to add a measure if used between parentheses, as in a function or even between simple parentheses.
  • Button $\simeq$ activates the truncation of the results of a measure. With truncation enabled, the results of a measure are truncated, leaving the uncertainty with one significant figure and the value rounded to the same order of magnitude as the uncertainty’s figure.

Thus, with truncation activated, the result of the previous operation would be printed as $5.3 ± 0.7$, i.e., the uncertainty would be truncated to one significant figure ($0.72 → 0.7$) and its value to the same order of magnitude as the uncertainty, tenth of a unit ($5.28 \rightarrow 5.3$).

The next two buttons are for calculating averages and deviations as the uncertainty.

The expressions for the average and deviation are selected in the Settings menu. The expressions for determining the averages are presented as follows:

Mean MethodEquation
Arithmetic Mean
Harmonic Mean
Root Mean Square

And the deviations:

Mean DesviationsEquation
Simple Mean Deviation
Sampling Standard Deviation
Population Standard Deviation

The first button adds the element on the display to the stack for calculating averages. With each insertion of a new value, the stack is displayed. A long press on this button will clear the display and show the stack entered up to that moment.

If a measure is passed to the stack, only its value will be inserted into the stack, with its uncertainty being discarded.

If an unwanted value is inserted into the stack, it can be removed by pressing $2nd$ to activate the stack removal button. Note that only the last value of the stack can be removed in this way.

The button $\bar{x}$ inserts into the display the measure defined by the average $\pm$ deviation.

To clear the stack, use the second function of the button $\bar{x}$.

Control Buttons and Functions

From the fourth to the sixth lines of the calculator are some control buttons and the calculator’s functions.

The first button Fix opens the dialogue for controlling the Fix function, which allows fixing the number of digits after the decimal point to be displayed. By default, up to 10 digits after the point are displayed, although internally the calculator works with 17 significant digits. Fix allows adjusting up to 15 digits after the decimal point, although it is not

advisable to go beyond 12.

The rad button switches the use of radians to degrees and vice versa for trigonometric functions. The 𝜋 (pi) button adds the value of pi to the equation.

The following buttons are functions or support for constructing expressions:

  • $Abs$ — invokes the abs(x) function, which returns the absolute value of the expression;
  • $Pol/Rec$ — invokes the pol(x,y), or rec(r,𝚹) with $2nd$ active, which return the polar and rectangular forms of the passed arguments;
  • $sin$/$sin^{-1}$, $cos$/$cos^{-1}$, and $tan$/$tan^{-1}$ — invoke the corresponding trigonometric function;
  • $e^x$ — invokes the exp(x) function, the natural exponential;
  • $10^x$ — invokes the pow10(x) function, a power of 10;
  • $x^2$/$\sqrt{x}$ — invoke the pow(x) and sqr(x) functions, for power of 2 and square root, respectively;
  • $x^3$/$\sqrt[3]{x}$ — invoke the pow3(x) and sqr3(x) functions, for power of 3 and cube root, respectively;
  • $x^y$/$\sqrt[y]{x}$ — invoke the powy(x,y) and sqry(x,y) functions, for power of y and y-th root, respectively;
  • $\cdots$ — opens a pair of parentheses. Parentheses are always inserted and removed in pairs;

ATTENTION: Currently, the $Pol/Rec$ functions only return values to the display and do not store for future calculations. I find these functions quite useful from my study times and as a physics teacher, but not very effective in the way they appear on scientific calculators I have used. I plan to add vector algebra to LabCalc, which would give more meaning to these functions, even extending to a three-dimensional system. However, these implementations require some care that I have not yet had time to work on.

The other buttons are numeric inputs, operators, $EE$ power of 10, $Ans$ previous response, and the decimal point.

Among the red buttons, the first, Backspace ($BS$), is used to remove elements from the display at the cursor’s position. $BS$ primarily removes a complete sentence like pow3(x), regardless of the cursor’s position the entire expression will be removed. If there is a numeric value, the value is removed character by character, or the name of the function, depending on where the cursor is.

$BS$ never removes a parentheses element, be it open or close parentheses, unless it is empty. If triggered to remove a parenthesis containing some content, the cursor will move one character to the left, entering or exiting the pair of parentheses.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.