Skip to content

Commit fdfb665

Browse files
committed
simple single system reduction test
1 parent d2c88a0 commit fdfb665

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/reduction.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using ModelingToolkit, OrdinaryDiffEq, Test
22

3-
@parameters t σ ρ β
3+
@parameters t σ ρ β F(t)
44
@variables x(t) y(t) z(t) a(t)
55
@derivatives D'~t
66

@@ -12,14 +12,16 @@ eqs = [D(x) ~ σ*(y-x),
1212
lorenz1 = ODESystem(eqs,t,[x,y,z,a],[σ,ρ,β],name=:lorenz1)
1313

1414
lorenz1_aliased = alias_elimination(lorenz1)
15-
length(equations(lorenz1_reduced)) = 3
16-
length(states(lorenz1_reduced)) = 3
15+
@test length(equations(lorenz1_aliased)) == 3
16+
@test length(states(lorenz1_aliased)) == 3
1717

1818
eqs = [D(x) ~ σ*(y-x),
1919
D(y) ~ x*-z)-y,
2020
D(z) ~ x*y - β*z]
21-
test_lorenz1_aliased = ODESystem(eqs,t,[x,y,z],[σ,ρ,β],observed=[a ~ x],name=:lorenz1)
2221

22+
@test lorenz1_aliased == ODESystem(eqs,t,[x,y,z],[σ,ρ,β],observed=[a ~ x],name=:lorenz1)
23+
24+
#=
2325
# Multi-System Reduction
2426
2527
eqs1 = [D(x) ~ σ*(y-x) + F,
@@ -83,3 +85,4 @@ observed(reduced_flattened_system) == [
8385
lorenz2.F ~ lorenz1.u
8486
a ~ -lorenz1.x + lorenz2.y
8587
]
88+
=#

0 commit comments

Comments
 (0)