Skip to content

Commit

Permalink
test: test that singular initialization systems throw a warning
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Nov 25, 2024
1 parent 61b53ec commit a0de0c3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/initializationsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a0de0c3

Please sign in to comment.