diff --git a/test/downstream/Project.toml b/test/downstream/Project.toml index 406fd3f4..b32afe76 100644 --- a/test/downstream/Project.toml +++ b/test/downstream/Project.toml @@ -7,7 +7,7 @@ Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" [compat] -ModelingToolkit = "8.33, 9" +ModelingToolkit = "10" MonteCarloMeasurements = "1.1" OrdinaryDiffEq = "6.31" StaticArrays = "1" diff --git a/test/downstream/symbol_indexing.jl b/test/downstream/symbol_indexing.jl index 5d11fab0..68b26ac0 100644 --- a/test/downstream/symbol_indexing.jl +++ b/test/downstream/symbol_indexing.jl @@ -7,10 +7,9 @@ include("../testutils.jl") @variables x(t) @parameters τ @variables RHS(t) -@mtkbuild fol_separate = ODESystem([RHS ~ (1 - x) / τ, - D(x) ~ RHS], t) +@mtkcompile fol_separate = System([RHS ~ (1 - x) / τ, D(x) ~ RHS], t) -prob = ODEProblem(fol_separate, [x => 0.0], (0.0, 10.0), [τ => 3.0]) +prob = ODEProblem(fol_separate, [x => 0.0, τ => 3.0], (0.0, 10.0)) sol = solve(prob, Tsit5()) 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 # Two components @variables y(t) @parameters α β γ δ -@mtkbuild lv = ODESystem([D(x) ~ α * x - β * x * y, +@mtkcompile lv = System([D(x) ~ α * x - β * x * y, D(y) ~ δ * x * y - γ * x * y], t) -prob = ODEProblem(lv, [x => 1.0, y => 1.0], (0.0, 10.0), - [α => 1.5, β => 1.0, γ => 3.0, δ => 1.0]) +prob = ODEProblem(lv, [x => 1.0, y => 1.0, α => 1.5, β => 1.0, γ => 3.0, δ => 1.0], (0.0, 10.0)) sol = solve(prob, Tsit5()) ts = 0:0.5:10 @@ -69,7 +67,7 @@ sts = @variables x(t)[1:3]=[1, 2, 3.0] y(t)=1.0 ps = @parameters p[1:3] = [1, 2, 3] eqs = [collect(D.(x) .~ x) D(y) ~ norm(collect(x)) * y - x[1]] -@mtkbuild sys = ODESystem(eqs, t, sts, ps) +@mtkcompile sys = ODESystem(eqs, t, sts, ps) prob = ODEProblem(sys, [], (0, 1.0)) sol = solve(prob, Tsit5()) @test sol[x .+ [y, 2y, 3y]] ≈ vcat.(getindex.((sol,), [x[1] + y, x[2] + 2y, x[3] + 3y])...)