Details of ScientificErrorAnalysis
Description
In ScientificErrorAnalysis, a structure that has numerical quantities with associated errors is called a quantity-with-error structure. Instances of such structures, which have a particular quantity and error, are called quantities-with-error.
There is a quantity-with-error structure native to ScientificErrorAnalysis, constructed using the Quantity constructor.
with(ScientificErrorAnalysis):
Quantity( 10., 1. );
Quantity⁡10.,1.
In the above, the first argument is the central value and the second argument is the associated error, which can be specified in absolute, relative, or units in the least digit form. In the returned object, the error is in absolute form.
The minimal interpretation placed on a quantity-with-error by ScientificErrorAnalysis is that of an unknown value with central tendency, where the error value is some statistical measure of the spread of the distribution of particular values (as obtained from an experiment or trial, for example).
Nevertheless, many calculations of both error analysis and the ScientificErrorAnalysis package are only strictly valid for Gaussian distributions. However, in any particular application, this condition may not be strictly satisfied, and the interpretation of error values is the responsibility of the application.
What the ScientificErrorAnalysis package does not do is perform what is called interval arithmetic. The error value of an object in the ScientificErrorAnalysis package does not represent an interval in which possible values must be contained.
To extract the central value and error of a quantity-with-error, for example the above object, use evalf and GetError.
x := (1):
evalf( x ), GetError( x );
10.,1.
The central feature of ScientificErrorAnalysis is the ability to combine quantities-with-error in a mathematical expression, that is, to propagate the errors through an expression. This is done using combine/errors.
y := Quantity( 20., 1. );
y≔Quantity⁡20.,1.
combine( x*y, errors );
Quantity⁡200.,22.36067977
The significance of this result is that, because x and y are uncertain quantities, the product has an uncertainty, as given by the error in the result. In the theory of error analysis, this is called error propagation. (Again, these errors do not represent closed intervals.)
In an error, usually only 1 or 2 digits are meaningful. To appropriately round a result, use ApplyRule with a rounding rule.
ApplyRule( (4), round[2] );
Quantity⁡200.,22.
A rounding rule can be directly specified in combine/errors.
combine( x*y, errors, rule=round[2] );
Alternatively, the default rounding rule used by combine/errors can be changed.
UseRule( round[2] );
UseRule( digits );
Several rounding rules are available in ScientificErrorAnalysis, and more can be added by the user.
Errors can be propagated through any differentiable function.
combine( x*exp(0.1*y), errors );
Quantity⁡73.89056099,10.44970335
Correlations can be defined between quantities-with-error.
SetCorrelation( x, y, 0.3 );
Quantity⁡200.,24.89979920
See SetCorrelation and GetCorrelation for more information.
For more information on error propagation, see any text on error analysis for the physical sciences.
Other quantity-with-error structures are the Constant( ) and Element( ) objects of the ScientificConstants package. For example:
ScientificConstants:-Constant( G );
Constant⁡G
combine( (10), errors );
Quantity⁡6.67408×10−11,3.100000000×10−15
Quantity-with-error structures are defined using the AddStructure command.
Quantity-with-error structures can be defined so that their objects are defined as functions of other objects. In such cases, Variance, Covariance, and combine/errors use this functional dependence. For more information, see Variance, Covariance, and combine/errors.
The derived Constants of ScientificConstants are treated as quantities-with-error with functional dependence by ScientificErrorAnalysis. For example:
ScientificConstants:-GetConstant( m[e] );
electron_mass,symbol=me,derive=2⁢R∞⁢hc⁢α2
combine( ScientificConstants:-Constant( m[e] ), errors );
Quantity⁡9.109383560×10−31,1.114295438×10−38
See ScientificErrorAnalysis and ScientificConstants for more information.
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. For more precision, set Digits to a higher value, for example, 15.
See Also
combine/errors
evalf
Rounding rules
ScientificConstants
ScientificConstants/Constant
ScientificConstants/Element
ScientificErrorAnalysis
ScientificErrorAnalysis and ScientificConstants
ScientificErrorAnalysis[AddStructure]
ScientificErrorAnalysis[ApplyRule]
ScientificErrorAnalysis[Covariance]
ScientificErrorAnalysis[GetCorrelation]
ScientificErrorAnalysis[GetError]
ScientificErrorAnalysis[Quantity]
ScientificErrorAnalysis[SetCorrelation]
ScientificErrorAnalysis[UseRule]
ScientificErrorAnalysis[Variance]
Download Help Document