Skip to content

Commit 3329dfe

Browse files
committed
update tests
1 parent 575562d commit 3329dfe

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

test/reduction.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ reduced_system = alias_elimination(connected; conservative=false)
9797
]) |> isempty
9898

9999
reduced_eqs = [
100+
0 ~ a + lorenz1.x - (lorenz2.y)
100101
D(lorenz1.x) ~ lorenz2.x + lorenz2.y + lorenz1.σ*((lorenz1.y) - (lorenz1.x)) - (lorenz2.z)
101102
D(lorenz1.y) ~ lorenz1.x*(lorenz1.ρ - (lorenz1.z)) - ((lorenz1.x) + (lorenz1.y) - (lorenz1.z))
102103
D(lorenz1.z) ~ lorenz1.x*lorenz1.y - (lorenz1.β*(lorenz1.z))
103104
D(lorenz2.x) ~ lorenz1.x + lorenz1.y + lorenz2.σ*((lorenz2.y) - (lorenz2.x)) - (lorenz1.z)
104105
D(lorenz2.y) ~ lorenz2.x*(lorenz2.ρ - (lorenz2.z)) - ((lorenz2.x) + (lorenz2.y) - (lorenz2.z))
105106
D(lorenz2.z) ~ lorenz2.x*lorenz2.y - (lorenz2.β*(lorenz2.z))
106-
0 ~ a + lorenz1.x - (lorenz2.y)
107107
]
108108

109109
test_equal.(equations(reduced_system), reduced_eqs)

test/variable_utils.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
using ModelingToolkit, Test
2+
using ModelingToolkit: value
23
using SymbolicUtils: <
34
@parameters α β δ
45
expr = (((1 / β - 1) + δ) / α) ^ (1 /- 1))
56
ref = sort([β, δ, α], lt = <ₑ)
67
sol = sort(Num.(ModelingToolkit.get_variables(expr)), lt = <ₑ)
7-
@test all(simplify, sol[i] == ref[i] for i in 1:3)
8+
@test all(x->x isa Num, sol[i] == ref[i] for i in 1:3)
9+
@test all(simplifyvalue, sol[i] == ref[i] for i in 1:3)
810

911
@parameters γ
1012
s = α => γ

0 commit comments

Comments
 (0)