Skip to content

Commit 062b93f

Browse files
test: fix initialization of RC circuit
1 parent 46f0930 commit 062b93f

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

test/components.jl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,7 @@ sys = structural_simplify(rc_model)
4747
@test length(equations(sys)) == 1
4848
check_contract(sys)
4949
@test !isempty(ModelingToolkit.defaults(sys))
50-
u0 = [capacitor.v => 0.0
51-
capacitor.p.i => 0.0
52-
resistor.v => 0.0]
53-
prob = ODEProblem(sys, u0, (0, 10.0))
54-
sol = solve(prob, Rodas4())
55-
check_rc_sol(sol)
50+
u0 = [capacitor.v => 0.0]
5651
prob = ODEProblem(sys, u0, (0, 10.0))
5752
sol = solve(prob, Rodas4())
5853
check_rc_sol(sol)
@@ -133,9 +128,7 @@ eqs = [connect(source.p, rc_comp.p)
133128
expand_connections(sys_inner_outer, debug = true)
134129
sys_inner_outer = structural_simplify(sys_inner_outer)
135130
@test !isempty(ModelingToolkit.defaults(sys_inner_outer))
136-
u0 = [rc_comp.capacitor.v => 0.0
137-
rc_comp.capacitor.p.i => 0.0
138-
rc_comp.resistor.v => 0.0]
131+
u0 = [rc_comp.capacitor.v => 0.0]
139132
prob = ODEProblem(sys_inner_outer, u0, (0, 10.0), sparse = true)
140133
sol_inner_outer = solve(prob, Rodas4())
141134
@test sol[capacitor.v] sol_inner_outer[rc_comp.capacitor.v]

0 commit comments

Comments
 (0)