Skip to content

Commit bc53299

Browse files
Add broken test for initializing with observed
1 parent f3de1aa commit bc53299

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
@@ -418,3 +418,14 @@ tspan = (0.0, 10.0)
418418
prob = ODEProblem(simpsys, [D(x) => 0.0, y => 0.0], tspan, guesses = [x => 0.0])
419419
sol = solve(prob, Tsit5())
420420
@test sol[1] == [0.0, 0.0]
421+
422+
# Initialize with an observed variable
423+
prob = ODEProblem(simpsys, [z => 0.0], tspan, guesses = [x => 2.0, y => 4.0])
424+
sol = solve(prob, Tsit5())
425+
@test sol[1] == [0.0, 0.0]
426+
427+
prob = ODEProblem(simpsys, [z => 1.0, y => 1.0], tspan, guesses = [x => 2.0])
428+
sol = solve(prob, Tsit5())
429+
@test sol[1] == [0.0, 1.0]
430+
431+
@test_broken @test_warn "Initialization system is underdetermined. 1 equations for 3 unknowns. Initialization will default to using least squares. To suppress this warning pass warn_initialize_determined = false." prob = ODEProblem(simpsys, [], tspan, guesses = [x => 2.0])

0 commit comments

Comments
 (0)