Skip to content

Commit aa3f485

Browse files
committed
Fix small inconsistencies
1 parent d648bc1 commit aa3f485

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/systems/nonlinear/initializesystem.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,12 @@ function generate_initializesystem(sys::ODESystem;
4848
# defer initialization until defaults are merged below
4949
push!(filtered_u0, y => x[2])
5050
elseif y isa Symbolics.Arr
51+
# scalarize array # TODO: don't scalarize arrays
5152
_y = collect(y)
52-
53-
# TODO: Don't scalarize arrays
54-
for i in 1:length(_y)
53+
for i in eachindex(_y)
5554
push!(filtered_u0, _y[i] => x[2][i])
5655
end
57-
elseif y isa ModelingToolkit.BasicSymbolic
56+
elseif y isa Symbolics.BasicSymbolic
5857
# y is a derivative expression expanded
5958
# add to the initialization equations
6059
push!(eqs_ics, y ~ x[2])

0 commit comments

Comments
 (0)