diff --git a/test/initializationsystem.jl b/test/initializationsystem.jl index f39ec3c2f2..6d3e677c1e 100644 --- a/test/initializationsystem.jl +++ b/test/initializationsystem.jl @@ -947,3 +947,14 @@ end @test_nowarn remake(prob, p = prob.p) end + +@testset "Singular initialization prints a warning" begin + @parameters g + @variables x(t) y(t) [state_priority = 10] λ(t) + eqs = [D(D(x)) ~ λ * x + D(D(y)) ~ λ * y - g + x^2 + y^2 ~ 1] + @mtkbuild pend = ODESystem(eqs, t) + @test_warn ["structurally singular", "initialization", "guess"] ODEProblem( + pend, [x => 1, y => 0], (0.0, 1.5), [g => 1], guesses = [λ => 1]) +end