Applications of the ScientificErrorAnalysis Package
The ScientificErrorAnalysis package provides representation and construction of numerical quantities that have a value and associated error, which is a measure of the degree of precision to which the quantity's value is known. Calculations of error analysis can be performed with these quantities.
Specification of Quantities with Error
The same quantity-with-error can be entered three different ways.
Important: These quantities do not represent intervals in which possible values must be contained - they represent unknown values with central tendency. See any text on error analysis for the physical sciences or engineering.
A Note about the Display of Maple Floating-Point Numbers
If a floating-point number is not displayed in scientific notation, it may not be apparent whether trailing zeros are significant figures.
Simple Error Analysis - Propagation of Errors
Errors can be propagated through calculations by using the combine/errors command.
Error in the sum of the above two quantities:
Relative error in their sum:
Error in their difference:
Relative error in their difference:
As expected, the relative error in the difference is greater than that in the sum.
Error in the product of the above two quantities:
Relative error in their product:
Error in their quotient:
Relative error in their quotient:
As expected, the relative errors in the product and quotient are the same.
Error in a power:
Error in differentiable functions:
Important: The above calculations are not interval arithmetic, and the quantities involved do not represent intervals in which values must be contained.
The Formulae of Error Propagation
The usual expressions for error propagation through simple functions are easily obtained.
Error in a sum:
Error in a product:
Relative error2 in the product:
Error in a square:
The general formula for the error σy in y, where y is a function of variables xi is:
where σxi is the error in xi and the partials are evaluated at the central values of the xi .
With covariances σxi,xj taken into account, the formula is:
The covariance σxi,xj may be expressed in terms of the correlation rxi,xj and errors σxi, σxj as follows:
Working with Rounding Rules
The initial default rounding rule is digits, for which no rounding is performed.
We can explicitly round a Quantity( ) object:
specify a rounding rule in combine/errors:
or change the default rounding rule using the UseRule function.
Another Note about Floating-Point Numbers
Adding a New Rounding Rule
The rounding rule round3g[n] rounds the error to n figures for a significant figure of 3 or greater and n+1 figures for a significant figure of 1 or 2. Here, we add a similar rule round2g[n], which rounds the error to n figures for a significant figure of 2 or greater and n+1 figures for a significant figure of 1.
AddRule⁡round2g=procx,ylocalxp,yp,n;ifnottypeprocname,'indexed'thenerror `round2g` must be indexed;end if;n:=opprocname;ifnottypen,'posint'thenerror invalid index to `round2g`;end if;xp,yp:=evalfx,evalfy;ifiquoSFloatMantissa⁡yp,10^ilog10⁡SFloatMantissa⁡yp<2thenn:=n+1;end if;`if`xp≠0,evalfn+ilog10⁡SFloatMantissa⁡xp − ilog10⁡SFloatMantissa⁡yp+SFloatExponent⁡xp − SFloatExponent⁡ypxp,Float0,−1,evalfnyp;end proc
We can use the new rule round2g[n].
Error Analysis with Physical Constants
A Simple Experiment
The period of oscillation T of a simple pendulum for small amplitude is given by:
where g is the standard acceleration of gravity and L is the length of the string of the pendulum (or, more precisely, the distance from the point of suspension to the center of the pendulum bob).
A student constructs a pendulum to determine a value for g. The student measures L to be 153.2 centimeters (cm). It is decided that the uncertainty in this measurement is primarily due to the difficulty in measuring L to the center of the bob, and that this uncertainty is about plus or minus 2 millimeters (mm). (In other words, it is estimated that the measurement is probably within 2 millimeters of the correct value.) Thus, L is taken to be 153.2 +/- 0.2 centimeters. In standard units:
Now, the student sets the pendulum swinging with a small amplitude (a few centimeters). Using a stopwatch, the student measures the time for 30 oscillations to be 75.3 seconds (s). The uncertainty in this measurement is due to the human reaction time in operating the stopwatch, and so the time measurement is taken to be 75.3 +/- 0.5 seconds.
Because the number of oscillations (30) is exact, the period of a single oscillation is:
The previous formula rearranges to:
and so, the student calculates the experimentally determined value of g to be:
The accepted value of g is:
Assuming the error in the experimental value represents a standard deviation, the accepted value thus lies farther than one standard deviation from the experimental central value. The student then must decide whether to repeat the experiment, or consider possibly overlooked sources of measurement error.
A sample of a gas is measured to have a volume of 20.3 liters (L), pressure of 105 kilopascals (kPa), and temperature of 297 kelvins (K). If all the measurements have uncertainty of 1%, what is the value and uncertainty of the number of moles in the sample?
The ideal gas law is:
where P is pressure, V is volume, T is temperature, and R is the ideal gas constant.
Constructing quantities-with-error for P, V, and T in standard units:
Thus, the number of moles n is:
Thus, the sample has 0.863 moles (mol) of gas molecules, with a relative error of:
or about 2%.
Working at higher Digits
Some physical constants have their values determined to more than 10 significant figures, hence calculations involving these objects at the default setting of Digits may result in a loss of precision. If more precision is desired, Digits may be set to a higher value, 15 for example.
Error in a Derived Physical Constant
Let us examine the formula for the electron mass.
As a demonstration, we manually construct the same expression using individual physical constant objects.
Propagating the errors gives us:
The above calculation is similar to the method ScientificConstants and ScientificErrorAnalysis use internally.
Return to ScientificErrorAnalysis
Return to Index for Example Worksheets
Download Help Document