Skip to content

Commit ff2ed42

Browse files
fix: fix DAEProblem initialization with new problem syntax
1 parent d78b814 commit ff2ed42

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/systems/nonlinear/initializesystem.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ function generate_initializesystem_timevarying(sys::AbstractSystem;
6565
function process_u0map_with_dummysubs(y, x)
6666
y = get(schedule.dummy_sub, y, y)
6767
y = fixpoint_sub(y, diffmap)
68+
# FIXME: DAEs provide initial conditions that require reducing the system
69+
# to index zero. If `isdifferential(y)`, an initial condition was given for an
70+
# algebraic variable, so ignore it. Otherwise, the initialization system
71+
# gets a `D(y) ~ ...` equation and errors. This is the same behavior as v9.
72+
if isdifferential(y)
73+
return
74+
end
6875
# If we have `D(x) ~ x` and provide [D(x) => x, x => 1.0] to `u0map`, then
6976
# without this condition `defs` would get `x => x` instead of retaining
7077
# `x => 1.0`.

0 commit comments

Comments
 (0)