From b1c999fe88c98897dfda23a5db64758b48629dad Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 7 Jun 2024 12:12:19 +0530 Subject: [PATCH] test: fix `DiscreteProblem` initialization in mtk-remake tests --- test/downstream/modelingtoolkit_remake.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/downstream/modelingtoolkit_remake.jl b/test/downstream/modelingtoolkit_remake.jl index 33ee43cd8..e1e2c9da6 100644 --- a/test/downstream/modelingtoolkit_remake.jl +++ b/test/downstream/modelingtoolkit_remake.jl @@ -69,8 +69,9 @@ k = ShiftIndex(t) # Roundabout method to avoid having to specify values for previous timestep fn = DiscreteFunction(discsys) ps = ModelingToolkit.MTKParameters(discsys, p) +discu0 = Dict([u0..., x(k-1) => 0.0, y(k-1) => 0.0, z(k-1) => 0.0]) push!(syss, discsys) -push!(probs, DiscreteProblem(fn, [1.0, 0.0, 0.0, 0.0, 0.0, 0.0], (0, 10), ps)) +push!(probs, DiscreteProblem(fn, getindex.((discu0,), unknowns(discsys)), (0, 10), ps)) for (sys, prob) in zip(syss, probs) @test parameter_values(prob) isa ModelingToolkit.MTKParameters