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.
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:
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
...```