From 8b156503157de2bb2d2c94e4c29db6cc43665cf6 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Mon, 13 Jul 2026 18:02:46 -0400 Subject: [PATCH] test: exercise SISO initialization through ODEProblem The standalone initialization problem represents an intermediate system, so it can lose defaults or observed variables from the original ODE system. Construct the ODE problem and assert the same initialized values through its public indexing API. Co-Authored-By: Chris Rackauckas --- test/utils.jl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/utils.jl b/test/utils.jl index 25953b47..549d242b 100644 --- a/test/utils.jl +++ b/test/utils.jl @@ -1,7 +1,7 @@ using ModelingToolkitStandardLibrary.Blocks using SciCompDSL using ModelingToolkit -using OrdinaryDiffEq +using SciMLBase: ODEProblem using ModelingToolkit: t_nounits as t, D_nounits as D using Symbolics @@ -34,11 +34,10 @@ end @named iosys = System(connect(c.output, so.input), t, systems = [so, c]) sys = mtkcompile(iosys) - initprob = ModelingToolkit.InitializationProblem(sys, 0.0) - initsol = solve(initprob) + prob = ODEProblem(sys, Dict{Any, Any}(), (0.0, 1.0)) - @test initsol[sys.so.xd] == 1.0 - @test initsol[sys.so.u] == 1.0 + @test prob[sys.so.xd] == 1.0 + @test prob[sys.so.u] == 1.0 end @test_deprecated RealInput(; name = :a, u_start = 1.0)