Skip to content

Commit 38141fe

Browse files
committed
Add tests
1 parent 573e713 commit 38141fe

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/reduction.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,3 +255,17 @@ eqs = [a ~ D(w)
255255
ss = alias_elimination(sys)
256256
@test equations(ss) == [0 ~ D(D(phi)) - a, 0 ~ sin(t) - D(phi)]
257257
@test observed(ss) == [w ~ D(phi)]
258+
259+
@variables t x(t) y(t)
260+
D = Differential(t)
261+
@named sys = ODESystem([D(x) ~ 1 - x,
262+
D(y) + D(x) ~ 0])
263+
new_sys = structural_simplify(sys)
264+
@test equations(new_sys) == [D(x) ~ 1 - x]
265+
@test observed(new_sys) == [D(y) ~ -D(x)]
266+
267+
@named sys = ODESystem([D(x) ~ 1 - x,
268+
y + D(x) ~ 0])
269+
new_sys = structural_simplify(sys)
270+
@test equations(new_sys) == [D(x) ~ 1 - x]
271+
@test observed(new_sys) == [y ~ -D(x)]

0 commit comments

Comments
 (0)