From 637a09ce8dd7c99daa8cd38a203fbee66084bdfa Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 14 Feb 2025 15:59:00 +0530 Subject: [PATCH 1/2] test: fix `open_loop` test --- test/Blocks/test_analysis_points.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/Blocks/test_analysis_points.jl b/test/Blocks/test_analysis_points.jl index 00f040e82..f18309c86 100644 --- a/test/Blocks/test_analysis_points.jl +++ b/test/Blocks/test_analysis_points.jl @@ -72,8 +72,7 @@ L = P*C =# # Open loop -open_sys = Blocks.open_loop(sys, :plant_input) -@unpack u, y = open_sys +open_sys, (u, y) = Blocks.open_loop(sys, :plant_input) # Linearizing the open-loop system should yield the same system as get_looptransfer matrices, _ = linearize(open_sys, [u], [y]) From a3a32e8e0e76b3f40c81d9ddf9e50b9f627ad2f9 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 14 Feb 2025 15:59:14 +0530 Subject: [PATCH 2/2] test: fix initialization of several Electrical/analog tests --- test/Electrical/analog.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Electrical/analog.jl b/test/Electrical/analog.jl index 23119ffaa..0e7f23dd5 100644 --- a/test/Electrical/analog.jl +++ b/test/Electrical/analog.jl @@ -72,9 +72,9 @@ end connect(R2.n, voltage.n, ground.g)] @named model = ODESystem(connections, t, - systems = [R0, R1, R2, source, short, voltage, ground]) + systems = [R0, R1, R2, source, short, voltage, ground]; guesses = [R2.v => 0.0]) sys = structural_simplify(model) - prob = ODEProblem(sys, Pair[R2.i => 0.0], (0, 2.0)) + prob = ODEProblem(sys, [], (0, 2.0)) sol = solve(prob, Rodas4()) # has no state; does not work with Tsit5 @test SciMLBase.successful_retcode(sol) @test sol[short.v] == sol[R0.v] == zeros(length(sol.t)) @@ -521,7 +521,7 @@ end # Build and solve the system @mtkbuild sys = RC() - prob = ODEProblem(sys, [0.0, 0.0], (0.0, 10.0)) # No state variables initially + prob = ODEProblem(sys, [], (0.0, 10.0); guesses = [sys.resistor.i => 0.0]) # No state variables initially sol = solve(prob) # Perform Tests