Skip to content

Commit 2184598

Browse files
fix: handle all parameter values from defaults in split = false systems
1 parent 6081a50 commit 2184598

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/systems/problem_utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ function better_varmap_to_vars(varmap::AbstractDict, vars::Vector;
279279
end
280280
vals = map(x -> varmap[x], vars)
281281

282-
if container_type <: Union{AbstractDict, Tuple, Nothing}
282+
if container_type <: Union{AbstractDict, Tuple, Nothing, SciMLBase.NullParameters}
283283
container_type = Array
284284
end
285285

test/initial_values.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,11 @@ prob = ODEProblem(sys, [], (1.0, 2.0), [])
128128
prob = ODEProblem(sys, [x => [y, 4.0], y => 2.0], (0.0, 1.0))
129129
@test eltype(prob.u0) <: Float64
130130
end
131+
132+
@testset "split=false systems with all parameter defaults" begin
133+
@variables x(t) = 1.0
134+
@parameters p=1.0 q=2.0 r=3.0
135+
@mtkbuild sys=ODESystem(D(x) ~ p * x + q * t + r, t) split=false
136+
prob = @test_nowarn ODEProblem(sys, [], (0.0, 1.0))
137+
@test prob.p isa Vector{Float64}
138+
end

0 commit comments

Comments
 (0)