# Using DifferentialEquations with treatment of uncertainties

**URL:** <https://discourse.julialang.org/t/using-differentialequations-with-treatment-of-uncertainties/51501>\
**Category:** General Usage\
**Tags:** diffeq\
**Created:** [December 9, 2020, 8:20am UTC](https://discourse.julialang.org/t/using-differentialequations-with-treatment-of-uncertainties/51501 "2020-12-09T08:20:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [December 9, 2020, 8:20am UTC](https://discourse.julialang.org/t/using-differentialequations-with-treatment-of-uncertainties/51501/1 "2020-12-09T08:20:19Z")

</div>

I try to reproduce the code found on the site:  
[The accelerating adoption of Julia](https://lwn.net/Articles/834571/)

The first part of the code is reproduced without problem. Loading the Plots package, not mentioned in the article.

But in the part of the treatment of uncertainties I present the following problem:  
**ERROR: UndefVarError: ± not defined**  
What package should I include in order for the code run successfully?

```julia
#https://lwn.net/Articles/834571/
using DifferentialEquations
using Plots
r(f,p,t) = f - f^2
tint = (0.0, 8.0)
r0 = 0.05
prob = ODEProblem(r, r0, tint)
sol = solve(prob)
plot(sol.t, sol.u, key=false)
#Suppose there was some uncertainty attached to our knowledge of the initial condition in the above problem
Julia>r0m = 0.05 ± 0.01
ERROR: UndefVarError: ± not defined
Stacktrace:
 [1] top-level scope at REPL[10]:1
rm(f,p,t) = (1 ± 0.0)*(f - f^2)
tintm = (0.0*1 ± 0, 8.0*1 ± 0)
probm = ODEProblem(rm,r0m,tintm)
solm = solve(probm)
plot(solm.t, solm.u, key=false)

```

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [December 9, 2020, 8:22am UTC](https://discourse.julialang.org/t/using-differentialequations-with-treatment-of-uncertainties/51501/2 "2020-12-09T08:22:43Z")

</div>

Did you do `using Measurements`?

---

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [December 9, 2020, 11:39am UTC](https://discourse.julialang.org/t/using-differentialequations-with-treatment-of-uncertainties/51501/3 "2020-12-09T11:39:58Z")

</div>

_ **My apologies, As I read the article more carefully, I found where it is mentioned:** _

> We will want to use the packages [Plots](http://docs.juliaplots.org/latest/) and [Measurements](https://juliaphysics.github.io/Measurements.jl/stable/) in our demonstration as well, so we install them and repeat the using commands on them.

I pay more attention in future reading before reaching the Forum

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [December 9, 2020, 2:30pm UTC](https://discourse.julialang.org/t/using-differentialequations-with-treatment-of-uncertainties/51501/4 "2020-12-09T14:30:34Z")

</div>

No probs! Arguably, the article should provide working code samples.
