Skip to content

Commit 7ec2a4f

Browse files
committed
Fix index_reduction tests
1 parent e2df0e8 commit 7ec2a4f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/index_reduction.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ using Test
55

66
# Define some variables
77
@parameters t L g
8-
@variables x(t) y(t) w(t) z(t) T(t) x_t(t) y_t(t)
8+
@variables x(t) y(t) w(t) z(t) T(t) xˍt(t) yˍt(t)
99
@derivatives D'~t
1010

1111
eqs2 = [D(D(x)) ~ T*x,
@@ -14,13 +14,13 @@ eqs2 = [D(D(x)) ~ T*x,
1414
pendulum2 = ODESystem(eqs2, t, [x, y, T], [L, g], name=:pendulum)
1515
lowered_sys = ModelingToolkit.ode_order_lowering(pendulum2)
1616

17-
lowered_eqs = [D(x_t) ~ T*x,
18-
D(y_t) ~ T*y - g,
17+
lowered_eqs = [D(xˍt) ~ T*x,
18+
D(yˍt) ~ T*y - g,
1919
0 ~ x^2 + y^2 - L^2,
20-
D(x) ~ x_t,
21-
D(y) ~ x_t]
22-
@test_skip ODESystem(lowered_eqs) == lowered_sys # not gonna work
23-
@test_broken isequal(lowered_sys.eqs, lowered_eqs)
20+
D(x) ~ xˍt,
21+
D(y) ~ yˍt]
22+
@test ODESystem(lowered_eqs, t, [xˍt, yˍt, x, y, T], [L, g]) == lowered_sys
23+
@test isequal(lowered_sys.eqs, lowered_eqs)
2424

2525
# Simple pendulum in cartesian coordinates
2626
eqs = [D(x) ~ w,
@@ -35,7 +35,7 @@ edges, vars, vars_asso = sys2bigraph(pendulum)
3535

3636
edges, assign, vars_asso, eqs_asso = ModelingToolkit.pantelides(pendulum)
3737

38-
@test edges == [
38+
@test sort.(edges) == sort.([
3939
[5, 3], # 1
4040
[6, 4], # 2
4141
[7, 9, 1], # 3
@@ -45,7 +45,7 @@ edges, assign, vars_asso, eqs_asso = ModelingToolkit.pantelides(pendulum)
4545
[5, 3, 10, 7], # 7
4646
[6, 4, 11, 8], # 8
4747
[2, 1, 6, 5, 11, 10], # 9
48-
]
48+
])
4949
# [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
5050
# [x, y, w, z, x', y', w', z', T, x'', y'']
5151
@test vars_asso == [5, 6, 7, 8, 10, 11, 0, 0, 0, 0, 0]

0 commit comments

Comments
 (0)