Skip to content

Commit 4333c34

Browse files
Merge pull request #650 from SciML/mtkitize
fix modelingtoolkitize dispatching
2 parents 5aff915 + 95579a2 commit 4333c34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/systems/diffeqs/modelingtoolkitize.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ function modelingtoolkitize(prob::DiffEqBase.ODEProblem)
1414
p = prob.p
1515
end
1616

17-
var(x, i) = Sym{FnType{Tuple{symtype(t)}, Real}}(nameof(Variable(:x, i)))
17+
var(x, i) = Num(Sym{FnType{Tuple{symtype(t)}, Real}}(nameof(Variable(x, i))))
1818
vars = reshape([var(:x, i)(value(t)) for i in eachindex(prob.u0)],size(prob.u0))
1919
params = p isa DiffEqBase.NullParameters ? [] :
20-
reshape([Variable(,i) for i in eachindex(p)],size(p))
20+
reshape([Num(Sym{Real}(nameof(Variable(, i)))) for i in eachindex(p)],size(p))
2121

2222
@derivatives D'~t
2323

2424
rhs = [D(var) for var in vars]
2525

2626
if DiffEqBase.isinplace(prob)
27-
lhs = similar(vars, Any)
27+
lhs = similar(vars, Num)
2828
prob.f(lhs, vars, params, t)
2929
else
3030
lhs = prob.f(vars, params, t)

0 commit comments

Comments
 (0)