Skip to content

Commit a731add

Browse files
committed
Test symbolic indexing of ODE with multivariate variable
1 parent 3539901 commit a731add

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/odesystem.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,3 +1573,13 @@ end
15731573
prob = ODEProblem(sys, [x => 1.0], (0.0, 1.0))
15741574
@test prob.problem_type == "A"
15751575
end
1576+
1577+
# https://github.com/SciML/ModelingToolkit.jl/issues/3737
1578+
@testset "ODE with multivariate variables" begin
1579+
@parameters k
1580+
@variables x(t, k) y(t, k) # equivalent to x(t) and y(t)
1581+
@mtkbuild sys = System([D(x) ~ 0, y ~ x + 1], t)
1582+
prob = ODEProblem(sys, [x => 0.0], (0.0, 1.0))
1583+
@test prob[x] == 0.0 # unknown
1584+
@test prob[y] == 1.0 # observed
1585+
end

0 commit comments

Comments
 (0)