Skip to content

Commit 6dd6890

Browse files
committed
Add indepsym
1 parent d096482 commit 6dd6890

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,15 @@ function DiffEqBase.ODEFunction{iip}(sys::AbstractODESystem, dvs = states(sys),
166166

167167
_M = (u0 === nothing || M == I) ? M : ArrayInterface.restructure(u0 .* u0',M)
168168

169-
ODEFunction{iip}(f,
169+
ODEFunction{iip}(
170+
f,
170171
jac = _jac === nothing ? nothing : _jac,
171172
tgrad = _tgrad === nothing ? nothing : _tgrad,
172173
mass_matrix = _M,
173174
jac_prototype = sparse ? similar(sys.jac[],Float64) : nothing,
174-
syms = Symbol.(states(sys)))
175+
syms = Symbol.(states(sys)),
176+
indepsym = Symbol(independent_variable(sys)),
177+
)
175178
end
176179

177180
"""
@@ -227,12 +230,15 @@ function ODEFunctionExpr{iip}(sys::AbstractODESystem, dvs = states(sys),
227230
tgrad = $_tgrad
228231
jac = $_jac
229232
M = $_M
230-
ODEFunction{$iip}(f,
231-
jac = jac,
232-
tgrad = tgrad,
233-
mass_matrix = M,
234-
jac_prototype = $jp_expr,
235-
syms = $(Symbol.(states(sys))))
233+
ODEFunction{$iip}(
234+
f,
235+
jac = jac,
236+
tgrad = tgrad,
237+
mass_matrix = M,
238+
jac_prototype = $jp_expr,
239+
syms = $(Symbol.(states(sys))),
240+
indepsym = $(QuoteNode(Symbol(independent_variable(sys)))),
241+
)
236242
end
237243
!linenumbers ? striplines(ex) : ex
238244
end

0 commit comments

Comments
 (0)