Skip to content

Commit ee84d23

Browse files
fix: dispatch on AbstractODESystem to avoid use-before-define problems
1 parent ef75b33 commit ee84d23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/systems/nonlinear/nonlinearsystem.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Convert an `ODESystem` to a `NonlinearSystem` solving for its steady state (wher
239239
Any differential variable `D(x) ~ f(...)` will be turned into `0 ~ f(...)`. The returned system is not
240240
simplified. If the input system is `complete`d, then so will the returned system.
241241
"""
242-
function NonlinearSystem(sys::ODESystem)
242+
function NonlinearSystem(sys::AbstractODESystem)
243243
eqs = equations(sys)
244244
obs = observed(sys)
245245
subrules = Dict(D(x) => 0.0 for x in unknowns(sys))
@@ -555,7 +555,7 @@ function DiffEqBase.NonlinearProblem{iip}(sys::NonlinearSystem, u0map,
555555
return remake(NonlinearProblem{iip}(f, u0, p, pt; filter_kwargs(kwargs)...))
556556
end
557557

558-
function DiffEqBase.NonlinearProblem(sys::ODESystem, args...; kwargs...)
558+
function DiffEqBase.NonlinearProblem(sys::AbstractODESystem, args...; kwargs...)
559559
NonlinearProblem(NonlinearSystem(sys), args...; kwargs...)
560560
end
561561

0 commit comments

Comments
 (0)