File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ function check_contract(sys)
19
19
end
20
20
21
21
function check_rc_sol (sol)
22
+ rpi = sol[rc_model. resistor. p. i]
23
+ @test any (! isequal (rpi[1 ]), rpi) # test that we don't have a constant system
22
24
@test sol[rc_model. resistor. p. i] == sol[resistor. p. i] == sol[capacitor. p. i]
23
25
@test sol[rc_model. resistor. n. i] == sol[resistor. n. i] == - sol[capacitor. p. i]
24
26
@test sol[rc_model. capacitor. n. i] == sol[capacitor. n. i] == - sol[capacitor. p. i]
31
33
include (" ../examples/rc_model.jl" )
32
34
33
35
@test ModelingToolkit. n_extra_equations (capacitor) == 2
34
- @test length (equations (structural_simplify (rc_model, allow_parameter = false ))) > 1
36
+ @test length (equations (structural_simplify (rc_model, allow_parameter = false ))) == 2
35
37
sys = structural_simplify (rc_model)
38
+ @test length (equations (sys)) == 1
36
39
check_contract (sys)
37
40
@test ! isempty (ModelingToolkit. defaults (sys))
38
41
u0 = [capacitor. v => 0.0
@@ -141,6 +144,7 @@ sol = solve(prob, Tsit5())
141
144
142
145
include (" ../examples/serial_inductor.jl" )
143
146
sys = structural_simplify (ll_model)
147
+ @test length (equations (sys)) == 2
144
148
check_contract (sys)
145
149
u0 = states (sys) .=> 0
146
150
@test_nowarn ODEProblem (sys, u0, (0 , 10.0 ))
You can’t perform that action at this time.
0 commit comments