File tree 1 file changed +14
-6
lines changed
1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -76,14 +76,22 @@ k = ShiftIndex(d)
76
76
[yd (k + 1 ) ~ Sample (dt)(y); r (k + 1 ) ~ 1.0 ;
77
77
ud (k + 1 ) ~ kp * (r (k + 1 ) - yd (k + 1 ))])
78
78
79
+ canonical_eqs = map (eqs) do eq
80
+ if iscall (eq. lhs) && operation (eq. lhs) isa Differential
81
+ return eq
82
+ else
83
+ return 0 ~ eq. rhs - eq. lhs
84
+ end
85
+ end
86
+ eqs_idxs = findfirst .(isequal .(canonical_eqs), (equations (ci. ts),))
79
87
d = Clock (dt)
80
88
# Note that TearingState reorders the equations
81
- @test eqmap[1 ] == ContinuousClock ()
82
- @test eqmap[2 ] == d
83
- @test eqmap[3 ] == d
84
- @test eqmap[4 ] == d
85
- @test eqmap[5 ] == ContinuousClock ()
86
- @test eqmap[6 ] == ContinuousClock ()
89
+ @test eqmap[eqs_idxs[ 1 ]] == d
90
+ @test eqmap[eqs_idxs[ 2 ] ] == d
91
+ @test eqmap[eqs_idxs[ 3 ] ] == d
92
+ @test eqmap[eqs_idxs[ 4 ]] == ContinuousClock ()
93
+ @test eqmap[eqs_idxs[ 5 ] ] == ContinuousClock ()
94
+ @test eqmap[eqs_idxs[ 6 ] ] == ContinuousClock ()
87
95
88
96
@test varmap[yd] == d
89
97
@test varmap[ud] == d
You can’t perform that action at this time.
0 commit comments