Skip to content

Commit 74c38c5

Browse files
test: test array unknowns occurring unscalarized in initializeprobpmap
1 parent ce655ae commit 74c38c5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/initializationsystem.jl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,3 +1650,24 @@ end
16501650
@test !SciMLBase.isinplace(prob)
16511651
@test !SciMLBase.isinplace(prob.f.initialization_data.initializeprob)
16521652
end
1653+
1654+
@testset "Array unknowns occurring unscalarized in initializeprobpmap" begin
1655+
@variables begin
1656+
u(t)[1:2] = 0.9ones(2)
1657+
x(t)[1:2], [guess = 0.01ones(2)]
1658+
o(t)[1:2]
1659+
end
1660+
@parameters p[1:4] = [2.0, 1.875, 2.0, 1.875]
1661+
1662+
eqs = [D(u[1]) ~ p[1] * u[1] - p[2] * u[1] * u[2] + x[1] + 0.1
1663+
D(u[2]) ~ p[4] * u[1] * u[2] - p[3] * u[2] - x[2]
1664+
o[1] ~ sum(p) * sum(u)
1665+
o[2] ~ sum(p) * sum(x)
1666+
x[1] ~ 0.01exp(-1)
1667+
x[2] ~ 0.01cos(t)]
1668+
1669+
@mtkbuild sys = ODESystem(eqs, t)
1670+
prob = ODEProblem(sys, [], (0.0, 1.0))
1671+
sol = solve(prob, Tsit5())
1672+
@test SciMLBase.successful_retcode(sol)
1673+
end

0 commit comments

Comments
 (0)