# Measurements.jl: how to zero values without eliminating the uncertainty / strange behavior with deepcopy

**URL:** <https://discourse.julialang.org/t/measurements-jl-how-to-zero-values-without-eliminating-the-uncertainty-strange-behavior-with-deepcopy/68221>\
**Category:** General Usage\
**Tags:** physics, measurements\
**Created:** [September 15, 2021, 5:45pm UTC](https://discourse.julialang.org/t/measurements-jl-how-to-zero-values-without-eliminating-the-uncertainty-strange-behavior-with-deepcopy/68221 "2021-09-15T17:45:02Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [September 16, 2021, 3:31pm UTC](https://discourse.julialang.org/t/measurements-jl-how-to-zero-values-without-eliminating-the-uncertainty-strange-behavior-with-deepcopy/68221/12 "2021-09-16T15:31:43Z")

</div>

> [@lmiq](#):
>
> I was initially expecting that the uncertainty would only increase, but it oscillates, and is zero when the forces are perpendicular to the velocity. That is why I think that the uncertainty is not correctly propagated here.

You may want to read about linear error propagation: [Appendix · Measurements](https://juliaphysics.github.io/Measurements.jl/stable/appendix/#Uncertainty-Propagation). In a nutshell, the error is proportional to the first partial derivative (hence the name “linear”, it’s a linear approximation) of the function with regard to the variable. If the derivate is zero (or very small, in the relevant scale)… the propagated uncertainty is zero (or very small) as well. Which is very likely what you have here.

> [@lmiq](#):
>
> Any chance that becomes fast enough for at least as simple particle simulation with a dozen of particles?

Correctly propagating uncertainties all the way down is _ **expensive** _:

> [@How to improve runtime with measurements.jl?](https://discourse.julialang.org/t/how-to-improve-runtime-with-measurements-jl/67343/7):
>
> Yes, unfortunately that’s exepcted, I made the example of the mean in the issue linked above. As @Sukera pointed out, tracking correlation is hard. It’s pretty easy to write a package to propagate uncertainties super quickly ignoring correlations, this is what Measurements.jl did until [v0.02](https://github.com/JuliaPhysics/Measurements.jl/releases/tag/v0.0.2), but that’s also incredibly dumb and useless: almost no identies would hold, for example x + x and 2 \* x would give you different results. Regarding the mean in particular, note that most of the time user…

---

_[View the full topic](https://discourse.julialang.org/t/measurements-jl-how-to-zero-values-without-eliminating-the-uncertainty-strange-behavior-with-deepcopy/68221)._
