Skip to content

Commit ec4fd42

Browse files
test: test mix of array initials and scalar parameters with split = false
1 parent 8147aab commit ec4fd42

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
@@ -265,3 +265,19 @@ end
265265
@test eltype(oprob.u0) == Float32
266266
@test eltype(eltype(sol.u)) == Float32
267267
end
268+
269+
@testset "Array initials and scalar parameters with `split = false`" begin
270+
@variables x(t)[1:2]
271+
@parameters p
272+
@mtkbuild sys=ODESystem([D(x[1]) ~ x[1], D(x[2]) ~ x[2] + p], t) split=false
273+
ps = Set(parameters(sys; initial_parameters = true))
274+
@test length(ps) == 5
275+
for i in 1:2
276+
@test Initial(x[i]) in ps
277+
@test Initial(D(x[i])) in ps
278+
end
279+
@test p in ps
280+
prob = ODEProblem(sys, [x => ones(2)], (0.0, 1.0), [p => 1.0])
281+
@test prob.p isa Vector{Float64}
282+
@test length(prob.p) == 5
283+
end

0 commit comments

Comments
 (0)