From ff443e48dbc9120f015116663aed92f2042f730a Mon Sep 17 00:00:00 2001 From: Herman Sletmoen Date: Thu, 18 Jul 2024 12:43:43 +0200 Subject: [PATCH] Test a system that really should have a guess --- test/initializationsystem.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/initializationsystem.jl b/test/initializationsystem.jl index f4097ecd97..13d797d189 100644 --- a/test/initializationsystem.jl +++ b/test/initializationsystem.jl @@ -456,3 +456,11 @@ sys = structural_simplify(unsimp; fully_determined = false) sys = extend(sysx, sysy) @test length(equations(generate_initializesystem(sys))) == 2 @test length(ModelingToolkit.guesses(sys)) == 1 + +# https://github.com/SciML/ModelingToolkit.jl/issues/2873 +@testset "Error on missing defaults" begin + @variables x(t) y(t) + @named sys = ODESystem([x^2 + y^2 ~ 25, D(x) ~ 1], t) + ssys = structural_simplify(sys) + @test_throws ArgumentError prob = ODEProblem(ssys, [x => 3], (0, 1), [] #=; guesses = [y => 5]=#) +end