Skip to content

Commit 771c539

Browse files
test: test mix of array initials and scalar parameters with split = false
1 parent 46cd894 commit 771c539

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/initial_values.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,19 @@ end
252252
ps = [p => [4.0, 5.0]]
253253
@test_nowarn NonlinearProblem(nlsys, u0, ps)
254254
end
255+
256+
@testset "Array initials and scalar parameters with `split = false`" begin
257+
@variables x(t)[1:2]
258+
@parameters p
259+
@mtkbuild sys=ODESystem([D(x[1]) ~ x[1], D(x[2]) ~ x[2] + p], t) split=false
260+
ps = Set(parameters(sys; initial_parameters = true))
261+
@test length(ps) == 5
262+
for i in 1:2
263+
@test Initial(x[i]) in ps
264+
@test Initial(D(x[i])) in ps
265+
end
266+
@test p in ps
267+
prob = ODEProblem(sys, [x => ones(2)], (0.0, 1.0), [p => 1.0])
268+
@test prob.p isa Vector{Float64}
269+
@test length(prob.p) == 5
270+
end

0 commit comments

Comments
 (0)