@@ -5,7 +5,7 @@ using Test
5
5
6
6
# Define some variables
7
7
@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)
9
9
@derivatives D' ~ t
10
10
11
11
eqs2 = [D (D (x)) ~ T* x,
@@ -14,13 +14,13 @@ eqs2 = [D(D(x)) ~ T*x,
14
14
pendulum2 = ODESystem (eqs2, t, [x, y, T], [L, g], name= :pendulum )
15
15
lowered_sys = ModelingToolkit. ode_order_lowering (pendulum2)
16
16
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,
19
19
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)
24
24
25
25
# Simple pendulum in cartesian coordinates
26
26
eqs = [D (x) ~ w,
@@ -35,7 +35,7 @@ edges, vars, vars_asso = sys2bigraph(pendulum)
35
35
36
36
edges, assign, vars_asso, eqs_asso = ModelingToolkit. pantelides (pendulum)
37
37
38
- @test edges == [
38
+ @test sort .( edges) == sort .( [
39
39
[5 , 3 ], # 1
40
40
[6 , 4 ], # 2
41
41
[7 , 9 , 1 ], # 3
@@ -45,7 +45,7 @@ edges, assign, vars_asso, eqs_asso = ModelingToolkit.pantelides(pendulum)
45
45
[5 , 3 , 10 , 7 ], # 7
46
46
[6 , 4 , 11 , 8 ], # 8
47
47
[2 , 1 , 6 , 5 , 11 , 10 ], # 9
48
- ]
48
+ ])
49
49
# [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
50
50
# [x, y, w, z, x', y', w', z', T, x'', y'']
51
51
@test vars_asso == [5 , 6 , 7 , 8 , 10 , 11 , 0 , 0 , 0 , 0 , 0 ]
0 commit comments