File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -76,14 +76,22 @@ k = ShiftIndex(d)
7676 [yd (k + 1 ) ~ Sample (dt)(y); r (k + 1 ) ~ 1.0 ;
7777 ud (k + 1 ) ~ kp * (r (k + 1 ) - yd (k + 1 ))])
7878
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),))
7987d = Clock (dt)
8088# 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 ()
8795
8896@test varmap[yd] == d
8997@test varmap[ud] == d
You can’t perform that action at this time.
0 commit comments