-
-
Notifications
You must be signed in to change notification settings - Fork 126
Closed
Description
Solving a system ODEs using unitful fails:
Running:
`using DifferentialEquations, Unitful
function g(dydt, y, p, t)
dydt[1] = -p[1] / p[2] * sin(y[2])
dydt[2] = y[1]
end
tspan = (0.0u"s",4.0u"s")
Y0=[0. * u"rad/s", .5u"rad"]
p = [9.8u"m/s^2",1u"m"]
prob = ODEProblem(g,Y0, tspan,p)
#Pass to solvers
sol = solve(prob,Tsit5())
`
produces:
MethodError: no method matching Quantity{Float64,D,U} where U where D(::Int64)
Closest candidates are:
Quantity{Float64,D,U} where U where D(::T<:Number) where T<:Number at boot.jl:725
Quantity{Float64,D,U} where U where D(!Matched::Base.TwicePrecision) where T<:Number at twiceprecision.jl:243
Quantity{Float64,D,U} where U where D(!Matched::AbstractChar) where T<:Union{AbstractChar, Number} at char.jl:50
Metadata
Metadata
Assignees
Labels
No labels