From e9a06c56d85d96a76c4c0a0cbde90a86706a743b Mon Sep 17 00:00:00 2001 From: Herman Sletmoen Date: Thu, 3 Oct 2024 15:33:32 +0200 Subject: [PATCH] Scalarize initial conditions of vectors --- src/systems/nonlinear/initializesystem.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/systems/nonlinear/initializesystem.jl b/src/systems/nonlinear/initializesystem.jl index e3d28719c8..3cca51b1e9 100644 --- a/src/systems/nonlinear/initializesystem.jl +++ b/src/systems/nonlinear/initializesystem.jl @@ -45,7 +45,7 @@ function generate_initializesystem(sys::ODESystem; push!(defs, y => x) elseif y isa Symbolics.Arr # TODO: don't scalarize arrays - push!(defs, (collect(y) .=> x)...) + merge!(defs, Dict(scalarize(y .=> x))) elseif y isa Symbolics.BasicSymbolic # y is a derivative expression expanded; add it to the initialization equations push!(eqs_ics, y ~ x)