Skip to content

Commit 03d351e

Browse files
committed
revert tests back to old state
1 parent 8c43b52 commit 03d351e

File tree

9 files changed

+19
-19
lines changed

9 files changed

+19
-19
lines changed

test/latexify.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ eqs = [D(x) ~ σ * (y - x) * D(x - y) / D(z),
3030
# Latexify.@generate_test latexify(eqs)
3131
@test_reference "latexify/10.tex" latexify(eqs)
3232

33-
@variables u(t)[1:3]
33+
@variables u[1:3](t)
3434
@parameters p[1:3]
3535
eqs = [D(u[1]) ~ p[3] * (u[2] - u[1]),
3636
0 ~ p[2] * p[3] * u[1] * (p[1] - u[1]) / 10 - u[2],

test/latexify/20.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
\begin{align}
2-
\mathrm{\frac{d}{d t}}\left( u(t)_1 \right) =& \left( - u(t)_1 + u(t)_2 \right) p_3 \\
3-
0 =& - u(t)_2 + \frac{1}{10} \left( - u(t)_1 + p_1 \right) p_2 p_3 u(t)_1 \\
4-
\mathrm{\frac{d}{d t}}\left( u(t)_3 \right) =& u(t)_2^{\frac{2}{3}} u(t)_1 - p_3 u(t)_3
2+
\frac{du_1(t)}{dt} =& \left( - \mathrm{u_1}\left( t \right) + \mathrm{u_2}\left( t \right) \right) p_3 \\
3+
0 =& - \mathrm{u_2}\left( t \right) + \frac{1}{10} \left( - \mathrm{u_1}\left( t \right) + p_1 \right) \mathrm{u_1}\left( t \right) p_2 p_3 \\
4+
\frac{du_3(t)}{dt} =& \left( \mathrm{u_2}\left( t \right) \right)^{\frac{2}{3}} \mathrm{u_1}\left( t \right) - \mathrm{u_3}\left( t \right) p_3
55
\end{align}

test/latexify/30.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
\begin{align}
2-
\mathrm{\frac{d}{d t}}\left( u(t)_1 \right) =& \left( - u(t)_1 + u(t)_2 \right) p_3 \\
3-
\mathrm{\frac{d}{d t}}\left( u(t)_2 \right) =& - u(t)_2 + \frac{1}{10} \left( - u(t)_1 + p_1 \right) p_2 p_3 u(t)_1 \\
4-
\mathrm{\frac{d}{d t}}\left( u(t)_3 \right) =& u(t)_2^{\frac{2}{3}} u(t)_1 - p_3 u(t)_3
2+
\frac{du_1(t)}{dt} =& \left( - \mathrm{u_1}\left( t \right) + \mathrm{u_2}\left( t \right) \right) p_3 \\
3+
\frac{du_2(t)}{dt} =& - \mathrm{u_2}\left( t \right) + \frac{1}{10} \left( - \mathrm{u_1}\left( t \right) + p_1 \right) \mathrm{u_1}\left( t \right) p_2 p_3 \\
4+
\frac{du_3(t)}{dt} =& \left( \mathrm{u_2}\left( t \right) \right)^{\frac{2}{3}} \mathrm{u_1}\left( t \right) - \mathrm{u_3}\left( t \right) p_3
55
\end{align}

test/linearize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ desired_order = [f.x, p.x]
7373
lsys = ModelingToolkit.reorder_states(lsys, states(ssys), desired_order)
7474

7575
@test lsys.A == [-2 0; 1 -2]
76-
@test lsys.B == reshape([1, 0], 2, 1)
76+
@test lsys.B == reshape([1; 0;;], 2, 1) # reshape required when testing on Julia v1.6
7777
@test lsys.C == [0 1]
7878
@test lsys.D[] == 0
7979

test/mass_matrix.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using OrdinaryDiffEq, ModelingToolkit, Test, LinearAlgebra
22
@parameters t
3-
@variables y(t)[1:3]
3+
@variables y[1:3](t)
44
@parameters k[1:3]
55
D = Differential(t)
66

test/odesystem.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ end
376376

377377
# issue 1109
378378
let
379-
@variables t x(t)[1:3, 1:3]
379+
@variables t x[1:3, 1:3](t)
380380
D = Differential(t)
381381
@named sys = ODESystem(D.(x) .~ x)
382382
@test_nowarn structural_simplify(sys)
@@ -386,7 +386,7 @@ end
386386
using Symbolics: unwrap, wrap
387387
using LinearAlgebra
388388
@variables t
389-
sts = @variables x(t)[1:3]=[1, 2, 3.0] y(t)=1.0
389+
sts = @variables x[1:3](t)=[1, 2, 3.0] y(t)=1.0
390390
ps = @parameters p[1:3] = [1, 2, 3]
391391
D = Differential(t)
392392
eqs = [collect(D.(x) .~ x)
@@ -487,7 +487,7 @@ function foo(a::Num, ms::AbstractVector)
487487
wrap(term(foo, a, term(SVector, ms...)))
488488
end
489489
foo(a, ms::AbstractVector) = a + sum(ms)
490-
@variables t x(t) ms(t)[1:3]
490+
@variables t x(t) ms[1:3](t)
491491
D = Differential(t)
492492
ms = collect(ms)
493493
eqs = [D(x) ~ foo(x, ms); D.(ms) .~ 1]
@@ -589,7 +589,7 @@ end
589589
let
590590
@parameters t
591591
D = Differential(t)
592-
@variables x(t)[1:2] = zeros(2)
592+
@variables x[1:2](t) = zeros(2)
593593
@variables y(t) = 0
594594
@parameters k = 1
595595
eqs = [D(x[1]) ~ x[2]
@@ -680,7 +680,7 @@ let
680680
eqs_to_lhs(eqs) = eq_to_lhs.(eqs)
681681

682682
@parameters σ=10 ρ=28 β=8 / 3 sigma rho beta
683-
@variables t t2 x(t)=1 y(t)=0 z(t)=0 x2(t2)=1 y2(t2)=0 z2(t2)=0 u(t2)[1:3]
683+
@variables t t2 x(t)=1 y(t)=0 z(t)=0 x2(t2)=1 y2(t2)=0 z2(t2)=0 u[1:3](t2)
684684

685685
D = Differential(t)
686686
D2 = Differential(t2)
@@ -749,7 +749,7 @@ end
749749
let
750750
@parameters t
751751

752-
u = collect(first(@variables u(t)[1:4]))
752+
u = collect(first(@variables u[1:4](t)))
753753
Dt = Differential(t)
754754

755755
eqs = [Differential(t)(u[2]) - 1.1u[1] ~ 0

test/stream_connectors.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ eqns = [connect(source.port, n2m2.port_a)
192192

193193
# array var
194194
@connector function VecPin(; name)
195-
sts = @variables v(t)[1:2]=[1.0, 0.0] i(t)[1:2]=1.0 [connect = Flow]
195+
sts = @variables v[1:2](t)=[1.0, 0.0] i[1:2](t)=1.0 [connect = Flow]
196196
ODESystem(Equation[], t, [sts...;], []; name = name)
197197
end
198198

test/units.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ eqs = [D(E) ~ P - E / τ
4848
@test !MT.validate(0 ~ P + E * τ)
4949

5050
# Array variables
51-
@variables t [unit = u"s"] x(t)[1:3] [unit = u"m"]
51+
@variables t [unit = u"s"] x[1:3](t) [unit = u"m"]
5252
@parameters v[1:3]=[1, 2, 3] [unit = u"m/s"]
5353
D = Differential(t)
5454
eqs = D.(x) .~ v

test/variable_parsing.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ D1 = Differential(t)
4545
t[1:2]
4646
s[1:4, 1:2]
4747
end
48-
@parameters σ(..)[1:2]
48+
@parameters σ[1:2](..)
4949

5050
@test all(ModelingToolkit.isparameter, collect(t))
5151
@test all(ModelingToolkit.isparameter, collect(s))
52-
@test all(ModelingToolkit.isparameter, Any[σ(t)[1], σ(t)[2]])
52+
@test all(ModelingToolkit.isparameter, Any[σ[1], σ[2]])
5353

5454
# fntype(n, T) = FnType{NTuple{n, Any}, T}
5555
# t1 = Num[Variable{Real}(:t, 1), Variable{Real}(:t, 2)]

0 commit comments

Comments
 (0)