Skip to content

Commit 9c05d69

Browse files
Merge pull request #356 from AayushSabharwal/as/fix-tests
test: fix several tests
2 parents 102100d + a3a32e8 commit 9c05d69

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

test/Blocks/test_analysis_points.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ L = P*C
7272
=#
7373

7474
# Open loop
75-
open_sys = Blocks.open_loop(sys, :plant_input)
76-
@unpack u, y = open_sys
75+
open_sys, (u, y) = Blocks.open_loop(sys, :plant_input)
7776

7877
# Linearizing the open-loop system should yield the same system as get_looptransfer
7978
matrices, _ = linearize(open_sys, [u], [y])

test/Electrical/analog.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ end
7272
connect(R2.n, voltage.n, ground.g)]
7373

7474
@named model = ODESystem(connections, t,
75-
systems = [R0, R1, R2, source, short, voltage, ground])
75+
systems = [R0, R1, R2, source, short, voltage, ground]; guesses = [R2.v => 0.0])
7676
sys = structural_simplify(model)
77-
prob = ODEProblem(sys, Pair[R2.i => 0.0], (0, 2.0))
77+
prob = ODEProblem(sys, [], (0, 2.0))
7878
sol = solve(prob, Rodas4()) # has no state; does not work with Tsit5
7979
@test SciMLBase.successful_retcode(sol)
8080
@test sol[short.v] == sol[R0.v] == zeros(length(sol.t))
@@ -521,7 +521,7 @@ end
521521

522522
# Build and solve the system
523523
@mtkbuild sys = RC()
524-
prob = ODEProblem(sys, [0.0, 0.0], (0.0, 10.0)) # No state variables initially
524+
prob = ODEProblem(sys, [], (0.0, 10.0); guesses = [sys.resistor.i => 0.0]) # No state variables initially
525525
sol = solve(prob)
526526

527527
# Perform Tests

0 commit comments

Comments
 (0)