Skip to content

Commit 486ae04

Browse files
fix: handle array dummy derivatives in generate_initializesystem
1 parent 5655134 commit 486ae04

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/systems/nonlinear/initializesystem.jl

+8-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function generate_initializesystem(sys::ODESystem;
3737
# set dummy derivatives to default_dd_guess unless specified
3838
push!(defs, x[1] => get(guesses, x[1], default_dd_guess))
3939
end
40-
for (y, x) in u0map
40+
function process_u0map_with_dummysubs(y, x)
4141
y = get(schedule.dummy_sub, y, y)
4242
y = fixpoint_sub(y, diffmap)
4343
if y vars_set
@@ -53,6 +53,13 @@ function generate_initializesystem(sys::ODESystem;
5353
error("Initialization expression $y is currently not supported. If its a higher order derivative expression, then only the dummy derivative expressions are supported.")
5454
end
5555
end
56+
for (y, x) in u0map
57+
if Symbolics.isarraysymbolic(y)
58+
process_u0map_with_dummysubs.(collect(y), collect(x))
59+
else
60+
process_u0map_with_dummysubs(y, x)
61+
end
62+
end
5663
end
5764

5865
# 2) process other variables

0 commit comments

Comments
 (0)