Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/systems/problem_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 25 additions & 0 deletions test/odesystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading