errors - Maple Help

combine/errors

combine quantities-with-error in an expression

 Calling Sequence combine( expr, errors, opts )

Parameters

 expr - expression containing quantities-with-error opts - (optional) equation(s) of the form option=value, where option is one of 'rule' or 'correlations'; determine behavior

Description

 • The combine( expr, errors, opts ) command combines quantities-with-error in a mathematical expression, or in other words, propagates the errors through an expression.
 • The opts argument can contain one or more of the following equations that determine the behavior:
 'rule' = name
 If the optional parameter rule=name is given, the rounding rule name is applied to the result of combine. Otherwise, the default rounding rule is used ('digits', or as set by ScientificErrorAnalysis[UseRule]).
 'correlations' = true or false
 If 'correlations'=true, combine/errors uses correlations defined between the quantities-with-error combined. The default value of 'correlations' is true. If 'correlations'=false, combine/errors ignores any correlations defined between the quantities-with-error.
 If no correlations have been directly defined between the quantities-with-error in expr (using ScientificErrorAnalysis[SetCorrelation]), 'correlations'=false does not produce a result different from the default.
 'correlations'=false has no effect on further induced error analysis calculations. That is, when combine/errors requires the variance of a quantity-with-error with functional dependence, that calculation is performed using correlations.
 • The result of combine/errors is a quantity-with-error returned in a Quantity object.
 • The uncertainty is calculated using the usual formula of error analysis involving a first-order expansion with the variances of the quantities-with-error.
 The error $u\left(y\right)$ in $y$, where $y$ is a function of variables ${x}_{i}$, is

${u\left(y\right)}^{2}=\sum _{i=1}^{N}{\left(\frac{\partial }{\partial {x}_{i}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}y\right)}^{2}{u\left({x}_{i}\right)}^{2}$

 where $u\left({x}_{i}\right)$ is the error in ${x}_{i}$, and the partials are evaluated at the central values of the ${x}_{i}$.
 When correlations are included, the formula also involves the covariances $u\left({x}_{i},{x}_{j}\right)$ between the quantities-with-error.

${u\left(y\right)}^{2}=\left(\sum _{i=1}^{N}{\left(\frac{\partial }{\partial {x}_{i}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}y\right)}^{2}{u\left({x}_{i}\right)}^{2}\right)+2\left(\sum _{i=1}^{N-1}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}\sum _{j=i+1}^{N}\left(\frac{\partial }{\partial {x}_{i}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}y\right)\left(\frac{\partial }{\partial {x}_{j}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}y\right)u\left({x}_{i},{x}_{j}\right)\right)$

 The covariance $u\left({x}_{i},{x}_{j}\right)$ can be expressed in terms of the correlation $r\left({x}_{i},{x}_{j}\right)$ and errors $u\left({x}_{i}\right)$, $u\left({x}_{j}\right)$ as:

$u\left({x}_{i},{x}_{j}\right)=r\left({x}_{i},{x}_{j}\right)u\left({x}_{i}\right)u\left({x}_{j}\right)$

 where $u\left({x}_{i}\right)$ and $u\left({x}_{j}\right)$ are the errors in ${x}_{i}$ and ${x}_{j}$.
 • ScientificErrorAnalysis[Variance] and ScientificErrorAnalysis[Covariance] are used to calculate the variances and covariances of the quantities-with-error. Thus, any quantity-with-error combined can have functional dependence on other quantities-with-error.

Examples

 > $\mathrm{with}\left(\mathrm{ScientificErrorAnalysis}\right):$
 > $a≔\mathrm{Quantity}\left(10.,1.\right):$
 > $b≔\mathrm{Quantity}\left(20.,1.\right):$
 > $\mathrm{combine}\left(ab,\mathrm{errors}\right)$
 ${\mathrm{Quantity}}{}\left({200.}{,}{22.36067977}\right)$ (1)
 > $\mathrm{combine}\left(ab,\mathrm{errors},\mathrm{rule}=\mathrm{round}\left[2\right]\right)$
 ${\mathrm{Quantity}}{}\left({200.}{,}{22.}\right)$ (2)
 > $\mathrm{combine}\left(\frac{b}{a},\mathrm{errors}\right)$
 ${\mathrm{Quantity}}{}\left({2.000000000}{,}{0.2236067977}\right)$ (3)
 > $\mathrm{SetCorrelation}\left(a,b,0.1\right)$
 > $\mathrm{combine}\left(ab,\mathrm{errors}\right)$
 ${\mathrm{Quantity}}{}\left({200.}{,}{23.23790008}\right)$ (4)
 > $\mathrm{combine}\left(\frac{b}{a},\mathrm{errors}\right)$
 ${\mathrm{Quantity}}{}\left({2.000000000}{,}{0.2144761059}\right)$ (5)
 > $\mathrm{combine}\left(\frac{b}{a},\mathrm{errors},\mathrm{correlations}=\mathrm{false}\right)$
 ${\mathrm{Quantity}}{}\left({2.000000000}{,}{0.2236067977}\right)$ (6)
 > $\mathrm{with}\left(\mathrm{ScientificConstants}\right):$
 > $\mathrm{e5}≔\mathrm{Constant}\left(h\right)\mathrm{Constant}\left(c\right)a$
 ${\mathrm{e5}}{≔}{\mathrm{Constant}}{}\left({h}\right){}{\mathrm{Constant}}{}\left({c}\right){}{\mathrm{Quantity}}{}\left({10.}{,}{1.}\right)$ (7)
 > $\mathrm{combine}\left(\mathrm{e5},\mathrm{errors}\right)$
 ${\mathrm{Quantity}}{}\left({1.986445824}{×}{{10}}^{{-24}}{,}{1.986445824}{×}{{10}}^{{-25}}\right)$ (8)
 > $\mathrm{e6}≔\frac{\mathrm{Constant}\left(m\left[e\right]\right)}{\mathrm{Constant}\left(m\left[p\right]\right)}$
 ${\mathrm{e6}}{≔}\frac{{\mathrm{Constant}}{}\left({{m}}_{{e}}\right)}{{\mathrm{Constant}}{}\left({{m}}_{{p}}\right)}$ (9)
 > $\mathrm{combine}\left(\mathrm{e6},\mathrm{errors}\right)$
 ${\mathrm{Quantity}}{}\left({0.0005446170214}{,}{5.176301769}{×}{{10}}^{{-14}}\right)$ (10)