Skip to content

test: fix several tests #356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions test/Blocks/test_analysis_points.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
6 changes: 3 additions & 3 deletions test/Electrical/analog.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand Down
Loading