diff --git a/src/systems/problem_utils.jl b/src/systems/problem_utils.jl index 58173dd46c..5ff00b4845 100644 --- a/src/systems/problem_utils.jl +++ b/src/systems/problem_utils.jl @@ -988,7 +988,7 @@ function (siu::SetInitialUnknowns)(p::MTKParameters, u0) return p end -function (siu::SetInitialUnknowns)(p::Vector, u0) +function (siu::SetInitialUnknowns)(p::AbstractVector, u0) if ArrayInterface.ismutable(p) siu.setter!(p, u0) else diff --git a/test/odesystem.jl b/test/odesystem.jl index 9219fca5fb..3220555e62 100644 --- a/test/odesystem.jl +++ b/test/odesystem.jl @@ -1730,3 +1730,28 @@ end @test obsfn_expr_oop isa Expr @test obsfn_expr_iip isa Expr end + +@testset "Solve with `split=false` static arrays" begin + @parameters σ ρ β + @variables x(t) y(t) z(t) + + eqs = [D(D(x)) ~ σ * (y - x), + D(y) ~ x * (ρ - z) - y, + D(z) ~ x * y - β * z] + + @mtkbuild sys=ODESystem(eqs, t) split=false + + u0 = SA[D(x) => 2.0f0, + x => 1.0f0, + y => 0.0f0, + z => 0.0f0] + + p = SA[σ => 28.0f0, + ρ => 10.0f0, + β => 8.0f0 / 3.0f0] + + tspan = (0.0f0, 100.0f0) + prob = ODEProblem{false}(sys, u0, tspan, p) + sol = solve(prob, Tsit5()) + @test SciMLBase.successful_retcode(sol) +end