How does the Around command at zero work?
The first order approximation to Around[0, .5]^2
is 0. If you want higher order approximations, you can use AroundReplace
. For example, the second order approximation is:
AroundReplace[s^2, s->Around[0,.5], 2]
Around[0.25, 0.3535533905932738]
Addendum
For uncorrelated Around
objects, use:
AroundReplace[s t, {s->Around[0,.5], t->Around[0,.5]}, 2]
Around[0., 0.25]
Around
works based on the error propagation rules used in physics (and I assume other sciences) where we add errors in quadrature. If we want to know the total amount of error in a formula, we can take the root of the sum of the squares of the partial derivatives.
So if we have some formula $f(x, y) = x y$, then $\delta f = \sqrt{\left(\frac{\partial f}{\partial x}\delta x\right)^2+\left(\frac{\partial f}{\partial y}\delta y\right)^2} = \sqrt{y^2 \delta x^2 + x^2 \delta y^2}$ (where I use $\delta variable$ to mean the uncertainty in that variable. In the case of $f(x) = x^2$, this simplifies to $\sqrt{2x^2\delta x^2}$.
We can check that Around
is working in the same way (here I use dvar
to mean the uncertainty in a value):
Around[x, dx] Around[y, dy]
Around[x, dx]^2
Around[x, dx] Around[x, dx]
The second and third results look slightly different, but are identical. Essentially, you can't get away from multiplying zero into your result at some point, which causes the whole thing to be zero.
Anyways, that's the formula that Around
is using. That might suck for whatever application you need it for, but I can assure you that it's really nice for uncertainty propagation, and it's also nice that plots can automatically create error bars based on Around
numbers.
If you need the higher order expansion, Carl Woll's answer should work for you. Also, if you need to specify asymmetric uncertainties, you can use Around[0, {-0.2, 0.3}]
, and again MMA will take care of the propagation in a similar manner.
Around
:
- Two different instances of the same Around object are assumed to be uncorrelated:
a = Around[x, δ]
a^2
Around[x^2, 2 Abs[x δ]]
With x = 0
we get Around[0, 0]
(giving 0 since Around[x,0]
is taken as 0.)
a+a
2 x ± Sqrt[2] Sqrt[δ^2]
a a a
x^3 ± Sqrt[3] Sqrt[x^4 δ^2]
a + a + a + a
4 x ± 2 Sqrt[δ^2]