Skip to content

Commit aec403f

Browse files
fix: handle => nothing entries in u0map in generate_initializesystem
1 parent ba4cde3 commit aec403f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/systems/nonlinear/initializesystem.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ function generate_initializesystem(sys::AbstractSystem;
3131
idxs_diff = isdiffeq.(eqs)
3232

3333
# PREPROCESSING
34+
# If `=> nothing` in `u0map`, remove the key from `defs`
35+
for (k, v) in u0map
36+
v === nothing || continue
37+
delete!(defs, k)
38+
end
39+
filter_missing_values!(u0map)
3440
# for initial conditions of the form `var => constant`, we instead turn them into
3541
# `var ~ var0` where `var0` is a new parameter, and make `update_initializeprob!`
3642
# update `initializeprob.ps[var0] = prob[var]`.

0 commit comments

Comments
 (0)