9

Is there a built-in or fairly elegant way to handle uncertainties in measurement data and/or physical constants?

For instance, the 2010 CODATA for the elementary charge is given as $\mathsf{1.602 176 565(35) \times 10^{19}}\textrm{ C}$, where the $(35)$ represents uncertainly of $\mathsf{0.000 000 035 \times 10^{19}}\textrm{ C}$. Or, in my case the D2 transition in $^9Be^+$ $\nu = \mathsf{31928.7436(40) \times 10^{19}}\textrm{ cm}^{-1}$.

I want to not only specify the uncertainty, but carry it through equations and calculate resultant uncertainties. I don't want to recreate my own system of doing this if there are already functions and notation for doing this.

rhermans
  • 36,518
  • 4
  • 57
  • 149
C Perkins
  • 193
  • 3

1 Answers1

8

Since Mathematica 12, you can use the new Around function to deal with uncertainties and error propagation. You can even retrieve uncertainties in physical constants, like elementary charge:

Around@@Entity["PhysicalConstant", "ElementaryCharge"][{"Value","StandardUncertainty"}]

Outputting:

$1.60217663 (4 \pm 8 )\times 10^{-19}\text{C}$

Or you can define your own value such as the D2 line in your example:

\[Nu] = Around[31928.7436/Quantity[1, "Centimeters"], 
   0.0040/Quantity[1, "Centimeters"]]*10^19
balping
  • 438
  • 5
  • 7