Skip to content

Commit 82cac6f

Browse files
committed
Fix components tests
1 parent c96488d commit 82cac6f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

test/components.jl

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ using ModelingToolkit.BipartiteGraphs
44
using ModelingToolkit.StructuralTransformations
55

66
function check_contract(sys)
7-
graph = ModelingToolkit.get_tearing_state(sys).structure.graph
8-
sys = tearing_substitution(sys)
9-
state = TearingState(sys)
7+
state = ModelingToolkit.get_tearing_state(sys)
8+
graph = state.structure.graph
109
fullvars = state.fullvars
10+
sys = tearing_substitution(sys)
1111

1212
eqs = equations(sys)
13-
var2idx = Dict(enumerate(fullvars))
1413
for (i, eq) in enumerate(eqs)
1514
actual = union(ModelingToolkit.vars(eq.lhs), ModelingToolkit.vars(eq.rhs))
1615
actual = filter(!ModelingToolkit.isparameter, collect(actual))
@@ -143,9 +142,7 @@ sol = solve(prob, Tsit5())
143142
include("../examples/serial_inductor.jl")
144143
sys = structural_simplify(ll_model)
145144
check_contract(sys)
146-
u0 = [inductor1.i => 0.0
147-
inductor2.i => 0.0
148-
inductor2.v => 0.0]
145+
u0 = states(sys) .=> 0
149146
@test_throws Any ODEProblem(sys, u0, (0, 10.0))
150147
@test_throws Any ODAEProblem(sys, u0, (0, 10.0))
151148
prob = DAEProblem(sys, Differential(t).(states(sys)) .=> 0, u0, (0, 0.5))

0 commit comments

Comments
 (0)