Skip to content

Commit 7a77645

Browse files
committed
add test
1 parent 2c8e100 commit 7a77645

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/downstream/initialization.jl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,21 @@ end
5858
@test getp(sys, p)(pobj) 1.0
5959
@test getp(sys, q)(pobj) sqrt(2)
6060
end
61+
62+
@testset "Initialization info printed" begin
63+
@parameters g
64+
@variables x(t) y(t) [state_priority = 10] λ(t)
65+
eqs = [D(D(x)) ~ λ * x
66+
D(D(y)) ~ λ * y - g
67+
x^2 + y^2 ~ 1]
68+
@mtkbuild pend = ODESystem(eqs, t)
69+
70+
prob = ODEProblem(pend, [x => 1, y => 0], (0.0, 1.5), [g => 1], guesses ==> 1])
71+
@test occursin("Initialization status: FULLY_DETERMINED", sprint(summary, prob))
72+
73+
prob = ODEProblem(pend, [], (0.0, 1.5), [g => 1], guesses ==> 1, x => 1, y => 0])
74+
@test occursin("Initialization status: UNDERDETERMINED", sprint(summary, prob))
75+
76+
prob = ODEProblem(pend, [x => 1, y => 0, λ => 2], (0.0, 1.5), [g => 1])
77+
@test occursin("Initialization status: OVERDETERMINED", sprint(summary, prob))
78+
end

0 commit comments

Comments
 (0)