Skip to content

Commit 092f9c2

Browse files
test: update tests to MTKv10
1 parent 781e9bd commit 092f9c2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

test/downstream/symbol_indexing.jl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ include("../testutils.jl")
77
@variables x(t)
88
@parameters τ
99
@variables RHS(t)
10-
@mtkbuild fol_separate = ODESystem([RHS ~ (1 - x) / τ,
11-
D(x) ~ RHS], t)
10+
@mtkcompile fol_separate = System([RHS ~ (1 - x) / τ, D(x) ~ RHS], t)
1211

13-
prob = ODEProblem(fol_separate, [x => 0.0], (0.0, 10.0), [τ => 3.0])
12+
prob = ODEProblem(fol_separate, [x => 0.0, τ => 3.0], (0.0, 10.0))
1413
sol = solve(prob, Tsit5())
1514

1615
sol_new = DiffEqArray(sol.u[1:10],
@@ -50,11 +49,10 @@ test_tables_interface(sol_new, [:timestamp, Symbol("x(t)")], hcat(sol_new[t], so
5049
# Two components
5150
@variables y(t)
5251
@parameters α β γ δ
53-
@mtkbuild lv = ODESystem([D(x) ~ α * x - β * x * y,
52+
@mtkcompile lv = System([D(x) ~ α * x - β * x * y,
5453
D(y) ~ δ * x * y - γ * x * y], t)
5554

56-
prob = ODEProblem(lv, [x => 1.0, y => 1.0], (0.0, 10.0),
57-
=> 1.5, β => 1.0, γ => 3.0, δ => 1.0])
55+
prob = ODEProblem(lv, [x => 1.0, y => 1.0, α => 1.5, β => 1.0, γ => 3.0, δ => 1.0], (0.0, 10.0))
5856
sol = solve(prob, Tsit5())
5957

6058
ts = 0:0.5:10
@@ -69,7 +67,7 @@ sts = @variables x(t)[1:3]=[1, 2, 3.0] y(t)=1.0
6967
ps = @parameters p[1:3] = [1, 2, 3]
7068
eqs = [collect(D.(x) .~ x)
7169
D(y) ~ norm(collect(x)) * y - x[1]]
72-
@mtkbuild sys = ODESystem(eqs, t, sts, ps)
70+
@mtkcompile sys = ODESystem(eqs, t, sts, ps)
7371
prob = ODEProblem(sys, [], (0, 1.0))
7472
sol = solve(prob, Tsit5())
7573
@test sol[x .+ [y, 2y, 3y]] vcat.(getindex.((sol,), [x[1] + y, x[2] + 2y, x[3] + 3y])...)

0 commit comments

Comments
 (0)