Skip to content

Commit 6632a29

Browse files
test: test that singular initialization systems throw a warning
1 parent beb16ec commit 6632a29

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/initializationsystem.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -947,3 +947,14 @@ end
947947

948948
@test_nowarn remake(prob, p = prob.p)
949949
end
950+
951+
@testset "Singular initialization prints a warning" begin
952+
@parameters g
953+
@variables x(t) y(t) [state_priority = 10] λ(t)
954+
eqs = [D(D(x)) ~ λ * x
955+
D(D(y)) ~ λ * y - g
956+
x^2 + y^2 ~ 1]
957+
@mtkbuild pend = ODESystem(eqs, t)
958+
@test_warn ["structurally singular", "initialization", "guess"] ODEProblem(
959+
pend, [x => 1, y => 0], (0.0, 1.5), [g => 1], guesses ==> 1])
960+
end

0 commit comments

Comments
 (0)