diff --git a/src/systems/diffeqs/odesystem.jl b/src/systems/diffeqs/odesystem.jl index d1cd01ce7b..ec2c5f8157 100644 --- a/src/systems/diffeqs/odesystem.jl +++ b/src/systems/diffeqs/odesystem.jl @@ -335,11 +335,7 @@ function ODESystem(eqs, iv; kwargs...) end end for eq in get(kwargs, :parameter_dependencies, Equation[]) - if eq isa Pair - collect_vars!(allunknowns, ps, eq, iv) - else - collect_vars!(allunknowns, ps, eq, iv) - end + collect_vars!(allunknowns, ps, eq, iv) end for ssys in get(kwargs, :systems, ODESystem[]) collect_scoped_vars!(allunknowns, ps, ssys, iv) diff --git a/src/utils.jl b/src/utils.jl index 2ff6af2231..d2e8a3ea38 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -252,6 +252,7 @@ end function collect_defaults!(defs, vars) for v in vars + symbolic_type(v) == NotSymbolic() && continue if haskey(defs, v) || !hasdefault(unwrap(v)) || (def = getdefault(v)) === nothing continue end @@ -262,6 +263,7 @@ end function collect_var_to_name!(vars, xs) for x in xs + symbolic_type(x) == NotSymbolic() && continue x = unwrap(x) if hasmetadata(x, Symbolics.GetindexParent) xarr = getmetadata(x, Symbolics.GetindexParent) diff --git a/test/odesystem.jl b/test/odesystem.jl index d00d9228a5..9446d105e0 100644 --- a/test/odesystem.jl +++ b/test/odesystem.jl @@ -1442,3 +1442,8 @@ end end end end + +@testset "Parameter dependencies with constant RHS" begin + @parameters p + @test_nowarn ODESystem(Equation[], t; parameter_dependencies = [p ~ 1.0], name = :a) +end