# Error when using Unitful and MonteCarloMeasurements with DifferentialEquations

**URL:** <https://discourse.julialang.org/t/error-when-using-unitful-and-montecarlomeasurements-with-differentialequations/103464>\
**Category:** Modelling & Simulations\
**Created:** [September 2, 2023, 2:08pm UTC](https://discourse.julialang.org/t/error-when-using-unitful-and-montecarlomeasurements-with-differentialequations/103464 "2023-09-02T14:08:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rwalters31](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rwalters31/32/25594_2.png) [@rwalters31](https://discourse.julialang.org/u/rwalters31)\
**Post date:** [September 2, 2023, 2:08pm UTC](https://discourse.julialang.org/t/error-when-using-unitful-and-montecarlomeasurements-with-differentialequations/103464/1 "2023-09-02T14:08:51Z")

</div>

I am trying to use both Unitful and MonteCarloMeasurements with DifferentialEquations to better understand the impact of uncertainty on a second order ODE. Using either Untiful or MonteCarloMeasurements alone with DifferentialEquations is fine but if I try to use all three together I get a lengthy error message.

```julia
using Plots,Unitful,MonteCarloMeasurements,DifferentialEquations
g3 = 9.81u"m/s^2"
du4 = [10.0±.1,10.0±.1].*u"m/s"
tspan3 = (0.0,1.0).*u"s"
f3(du,u,p,t) = [0.0u"m/s^2",-g3]
u3 = [0.0,0.0].*u"m"
problem4 = SecondOrderODEProblem(f3,du4,u3,tspan3)
solve(problem4)

```

Here are the top few lines of the error:

````julia
MethodError: no method matching (Unitful.Quantity{Float64})(::Int64)

Closest candidates are:

(::Type{T})(::T) where T<:Number

@ Core boot.jl:792

(::Type{T})(!Matched::AbstractChar) where T<:Union{AbstractChar, Number}

@ Base char.jl:50

(::Type{T})(!Matched::Base.TwicePrecision) where T<:Number

@ Base twiceprecision.jl:266

...```
````

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [September 2, 2023, 10:46pm UTC](https://discourse.julialang.org/t/error-when-using-unitful-and-montecarlomeasurements-with-differentialequations/103464/2 "2023-09-02T22:46:48Z")

</div>

> [@rwalters31](#):
>
> Here are the top few lines of the error:

You missed the helpful part. Please share the rest.

---

<div class="post-metadata">

**Author:** ![rwalters31](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rwalters31/32/25594_2.png) [@rwalters31](https://discourse.julialang.org/u/rwalters31)\
**Post date:** [September 3, 2023, 1:55am UTC](https://discourse.julialang.org/t/error-when-using-unitful-and-montecarlomeasurements-with-differentialequations/103464/3 "2023-09-03T01:55:31Z")

</div>

1. **convert** (::Type{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}}, ::Int64)@_particles.jl:331_
2. **one** (::Type{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}})@_number.jl:346_
3. **recursive\_unitless\_bottom\_eltype** (::Type{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}})@_utils.jl:240_
4. **recursive\_unitless\_bottom\_eltype** (::Type{RecursiveArrayTools.ArrayPartition{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}, Tuple{Vector{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(m, s^-1), 𝐋 𝐓^-1, nothing}}, 2000}}, Vector{Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}}})@_utils.jl:237_
5. **recursive\_unitless\_bottom\_eltype** (::RecursiveArrayTools.ArrayPartition{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}, Tuple{Vector{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(m, s^-1), 𝐋 𝐓^-1, nothing}}, 2000}}, Vector{Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}})@_utils.jl:231_
6. **var"#\_\_init#740"** (::Tuple{}, ::Tuple{}, ::Tuple{}, ::Nothing, ::Bool, ::Bool, ::Bool, ::Nothing, ::Nothing, ::Bool, ::Bool, ::Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}, ::Nothing, ::Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}, ::Bool, ::Bool, ::Rational{Int64}, ::Nothing, ::Nothing, ::Rational{Int64}, ::Int64, ::Int64, ::Int64, ::Nothing, ::Nothing, ::Rational{Int64}, ::Nothing, ::Bool, ::Int64, ::Int64, ::typeof(DiffEqBase.ODE\_DEFAULT\_NORM), ::typeof(LinearAlgebra.opnorm), ::typeof(DiffEqBase.ODE\_DEFAULT\_ISOUTOFDOMAIN), ::typeof(DiffEqBase.ODE\_DEFAULT\_UNSTABLE\_CHECK), ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Int64, ::String, ::typeof(DiffEqBase.ODE\_DEFAULT\_PROG\_MESSAGE), ::Nothing, ::Bool, ::Bool, ::Bool, ::Bool, ::OrdinaryDiffEq.DefaultInit, ::Base.Pairs{Symbol, Bool, Tuple{Symbol, Symbol}, NamedTuple{(:default\_set, :second\_time), Tuple{Bool, Bool}}}, ::typeof(SciMLBase.\_\_init), ::SciMLBase.ODEProblem{RecursiveArrayTools.ArrayPartition{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}, Tuple{Vector{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(m, s^-1), 𝐋 𝐓^-1, nothing}}, 2000}}, Vector{Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}}, Tuple{Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}, Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}}, false, SciMLBase.NullParameters, SciMLBase.DynamicalODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, typeof(Main.var"workspace#152".f3), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.var"#284#286", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.SecondOrderODEProblem{false}}, ::OrdinaryDiffEq.Tsit5{typeof(OrdinaryDiffEq.trivial\_limiter!), typeof(OrdinaryDiffEq.trivial\_limiter!), Static.False}, ::Tuple{}, ::Tuple{}, ::Tuple{}, ::Type{Val{true}})@_solve.jl:164_
7. **var"#\_\_solve#739"** (::Base.Pairs{Symbol, Bool, Tuple{Symbol, Symbol}, NamedTuple{(:default\_set, :second\_time), Tuple{Bool, Bool}}}, ::typeof(SciMLBase.\_\_solve), ::SciMLBase.ODEProblem{RecursiveArrayTools.ArrayPartition{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}, Tuple{Vector{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(m, s^-1), 𝐋 𝐓^-1, nothing}}, 2000}}, Vector{Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}}, Tuple{Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}, Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}}, false, SciMLBase.NullParameters, SciMLBase.DynamicalODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, typeof(Main.var"workspace#152".f3), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.var"#284#286", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.SecondOrderODEProblem{false}}, ::OrdinaryDiffEq.Tsit5{typeof(OrdinaryDiffEq.trivial\_limiter!), typeof(OrdinaryDiffEq.trivial\_limiter!), Static.False})@_solve.jl:5_
8. **var"#\_\_solve#1"** (::Bool, ::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:second\_time,), Tuple{Bool}}}, ::typeof(SciMLBase.\_\_solve), ::SciMLBase.ODEProblem{RecursiveArrayTools.ArrayPartition{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}, Tuple{Vector{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(m, s^-1), 𝐋 𝐓^-1, nothing}}, 2000}}, Vector{Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}}, Tuple{Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}, Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}}, false, SciMLBase.NullParameters, SciMLBase.DynamicalODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, typeof(Main.var"workspace#152".f3), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.var"#284#286", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.SecondOrderODEProblem{false}}, ::Nothing)@_default\_solve.jl:14_
9. **var"#\_\_solve#62"** (::Bool, ::Bool, ::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(SciMLBase.\_\_solve), ::SciMLBase.ODEProblem{RecursiveArrayTools.ArrayPartition{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}, Tuple{Vector{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(m, s^-1), 𝐋 𝐓^-1, nothing}}, 2000}}, Vector{Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}}, Tuple{Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}, Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}}, false, SciMLBase.NullParameters, SciMLBase.DynamicalODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, typeof(Main.var"workspace#152".f3), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.var"#284#286", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.SecondOrderODEProblem{false}})@_solve.jl:1249_
10. **\_\_solve** (::SciMLBase.ODEProblem{RecursiveArrayTools.ArrayPartition{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}, Tuple{Vector{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(m, s^-1), 𝐋 𝐓^-1, nothing}}, 2000}}, Vector{Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}}, Tuple{Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}, Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}}, false, SciMLBase.NullParameters, SciMLBase.DynamicalODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, typeof(Main.var"workspace#152".f3), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.var"#284#286", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.SecondOrderODEProblem{false}})@_solve.jl:1242_
11. **var"#solve\_call#34"** (::Bool, ::DiffEqBase.KeywordArgError, ::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(DiffEqBase.solve\_call), ::SciMLBase.ODEProblem{RecursiveArrayTools.ArrayPartition{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}, Tuple{Vector{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(m, s^-1), 𝐋 𝐓^-1, nothing}}, 2000}}, Vector{Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}}, Tuple{Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}, Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}}, false, SciMLBase.NullParameters, SciMLBase.DynamicalODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, typeof(Main.var"workspace#152".f3), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.var"#284#286", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.SecondOrderODEProblem{false}})@_solve.jl:511_
12. **solve\_call** (::SciMLBase.ODEProblem{RecursiveArrayTools.ArrayPartition{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}, Tuple{Vector{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(m, s^-1), 𝐋 𝐓^-1, nothing}}, 2000}}, Vector{Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}}, Tuple{Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}, Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}}, false, SciMLBase.NullParameters, SciMLBase.DynamicalODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, typeof(Main.var"workspace#152".f3), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.var"#284#286", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.SecondOrderODEProblem{false}})@_solve.jl:481_
13. **var"#solve\_up#42"** (::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(DiffEqBase.solve\_up), ::SciMLBase.ODEProblem{RecursiveArrayTools.ArrayPartition{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}, Tuple{Vector{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(m, s^-1), 𝐋 𝐓^-1, nothing}}, 2000}}, Vector{Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}}, Tuple{Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}, Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}}, false, SciMLBase.NullParameters, SciMLBase.DynamicalODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, typeof(Main.var"workspace#152".f3), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.var"#284#286", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.SecondOrderODEProblem{false}}, ::Nothing, ::RecursiveArrayTools.ArrayPartition{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}, Tuple{Vector{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(m, s^-1), 𝐋 𝐓^-1, nothing}}, 2000}}, Vector{Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}}, ::SciMLBase.NullParameters)@_solve.jl:976_
14. **solve\_up** (::SciMLBase.ODEProblem{RecursiveArrayTools.ArrayPartition{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}, Tuple{Vector{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(m, s^-1), 𝐋 𝐓^-1, nothing}}, 2000}}, Vector{Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}}, Tuple{Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}, Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}}, false, SciMLBase.NullParameters, SciMLBase.DynamicalODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, typeof(Main.var"workspace#152".f3), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.var"#284#286", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.SecondOrderODEProblem{false}}, ::Nothing, ::RecursiveArrayTools.ArrayPartition{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}, Tuple{Vector{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(m, s^-1), 𝐋 𝐓^-1, nothing}}, 2000}}, Vector{Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}}, ::SciMLBase.NullParameters)@_solve.jl:945_
15. **var"#solve#40"** (::Nothing, ::Nothing, ::Nothing, ::Val{true}, ::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(CommonSolve.solve), ::SciMLBase.ODEProblem{RecursiveArrayTools.ArrayPartition{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}, Tuple{Vector{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(m, s^-1), 𝐋 𝐓^-1, nothing}}, 2000}}, Vector{Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}}, Tuple{Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}, Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}}, false, SciMLBase.NullParameters, SciMLBase.DynamicalODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, typeof(Main.var"workspace#152".f3), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.var"#284#286", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.SecondOrderODEProblem{false}})@_solve.jl:882_
16. **solve** (::SciMLBase.ODEProblem{RecursiveArrayTools.ArrayPartition{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64}, 2000}, Tuple{Vector{MonteCarloMeasurements.Particles{Unitful.Quantity{Float64, 𝐋 𝐓^-1, Unitful.FreeUnits{(m, s^-1), 𝐋 𝐓^-1, nothing}}, 2000}}, Vector{Unitful.Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}}}, Tuple{Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}, Unitful.Quantity{Float64, 𝐓, Unitful.FreeUnits{(s,), 𝐓, nothing}}}, false, SciMLBase.NullParameters, SciMLBase.DynamicalODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, typeof(Main.var"workspace#152".f3), LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, SciMLBase.ODEFunction{false, SciMLBase.FullSpecialize, SciMLBase.var"#284#286", LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT\_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.SecondOrderODEProblem{false}})@_solve.jl:872_
17. **top-level scope** @_[Local: 1](http://localhost:1234/edit?id=d13134d0-4923-11ee-01fd-e1f7ddf75e8d#)_ [inlined]

---

<div class="post-metadata">

**Author:** ![rwalters31](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rwalters31/32/25594_2.png) [@rwalters31](https://discourse.julialang.org/u/rwalters31)\
**Post date:** [September 3, 2023, 4:12pm UTC](https://discourse.julialang.org/t/error-when-using-unitful-and-montecarlomeasurements-with-differentialequations/103464/4 "2023-09-03T16:12:24Z")

</div>

[MonteCarloUnitfulDiffEq.jl](https://discourse.julialang.org/uploads/short-url/wwCgFb6a5bErBvvA7TEAf3yMWIc.jl) (70.8 KB)  
I’ve attached a copy of the Pluto notebook I was testing.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [September 12, 2023, 6:26pm UTC](https://discourse.julialang.org/t/error-when-using-unitful-and-montecarlomeasurements-with-differentialequations/103464/5 "2023-09-12T18:26:42Z")

</div>

Awesome thanks, that lead me right to the spot. Took a second to find the time for it though, but the solution is in [Support nesting Unitful and MonteCarloMeasurements by ChrisRackauckas · Pull Request #279 · SciML/RecursiveArrayTools.jl · GitHub](https://github.com/SciML/RecursiveArrayTools.jl/pull/279) and it’ll be in the next patch release by the end of the day.
