Skip to content

Commit 7a482ed

Browse files
fixup! feat: support arbitrary systems in remake_initialization_data
1 parent 23d22cb commit 7a482ed

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/systems/nonlinear/initializesystem.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ function SciMLBase.remake_initialization_data(
232232
end
233233
if !(eltype(u0) <: Pair) && !(eltype(p) <: Pair)
234234
oldinitdata = odefn.initialization_data
235+
oldinitdata === nothing && return nothing
236+
235237
oldinitprob = oldinitdata.initializeprob
236238
oldinitprob === nothing && return nothing
237239
if !SciMLBase.has_sys(oldinitprob.f) || !(oldinitprob.f.sys isa NonlinearSystem)
@@ -257,7 +259,7 @@ function SciMLBase.remake_initialization_data(
257259
if p !== missing
258260
for sym in parameter_symbols(oldinitprob)
259261
push!(pidxs, parameter_index(oldinitprob, sym))
260-
if isequal(sym, get_iv(sys))
262+
if is_time_dependent(sys) && isequal(sym, get_iv(sys))
261263
push!(pvals, t0)
262264
else
263265
push!(pvals, getp(sys, sym)(p))
@@ -341,7 +343,7 @@ function SciMLBase.remake_initialization_data(
341343
pmap[p] = getp(sys, p)(newp)
342344
end
343345
end
344-
if t0 === nothing
346+
if t0 === nothing && is_time_dependent(sys)
345347
t0 = 0.0
346348
end
347349
filter_missing_values!(u0map)

0 commit comments

Comments
 (0)