File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,13 @@ function structural_simplify(
2626 else
2727 newsys = newsys′
2828 end
29+ if newsys isa DiscreteSystem &&
30+ any (eq -> symbolic_type (eq. lhs) == NotSymbolic (), equations (newsys))
31+ error ("""
32+ Encountered algebraic equations when simplifying discrete system. This is \
33+ not yet supported.
34+ """ )
35+ end
2936 if newsys isa ODESystem || has_parent (newsys)
3037 @set! newsys. parent = complete (sys; split)
3138 end
Original file line number Diff line number Diff line change @@ -265,3 +265,9 @@ function System(; name, buffer)
265265end
266266
267267@test_nowarn @mtkbuild sys = System (; buffer = ones (10 ))
268+
269+ # Ensure discrete systems with algebraic equations throw
270+ @variables x (t) y (t)
271+ k = ShiftIndex (t)
272+ @named sys = DiscreteSystem ([x ~ x^ 2 + y^ 2 , y ~ x (k - 1 ) + y (k - 1 )], t)
273+ @test_throws [" algebraic equations" , " not yet supported" ] structural_simplify (sys)
You can’t perform that action at this time.
0 commit comments