You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/systems/nonlinear/initializesystem.jl
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,10 @@ function generate_initializesystem(sys::ODESystem;
44
44
y =get(schedule.dummy_sub, x[1], x[1])
45
45
y = ModelingToolkit.fixpoint_sub(y, full_diffmap)
46
46
47
-
if y isa Symbolics.Arr
47
+
if y ∈ set_full_states
48
+
# defer initialization until defaults are merged below
49
+
push!(filtered_u0, y => x[2])
50
+
elseif y isa Symbolics.Arr
48
51
_y =collect(y)
49
52
50
53
#TODO: Don't scalarize arrays
@@ -55,8 +58,6 @@ function generate_initializesystem(sys::ODESystem;
55
58
# y is a derivative expression expanded
56
59
# add to the initialization equations
57
60
push!(eqs_ics, y ~ x[2])
58
-
elseif y ∈ set_full_states
59
-
push!(filtered_u0, y => x[2])
60
61
else
61
62
error("Initialization expression $y is currently not supported. If its a higher order derivative expression, then only the dummy derivative expressions are supported.")
0 commit comments