Skip to content

Commit c83976c

Browse files
fix: don't use observed equations for initialization of DiscreteSystem
1 parent 0a19c0a commit c83976c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/systems/nonlinear/initializesystem.jl

+4-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,10 @@ function generate_initializesystem(sys::AbstractSystem;
219219
pars = [pars; map(unwrap, collect(keys(new_params)))]
220220
is_time_dependent(sys) && push!(pars, get_iv(sys))
221221

222-
if is_time_dependent(sys)
222+
# FIXME: observed equations for discrete systems are broken. They don't express
223+
# relations at the current time and instead express them in terms of past values.
224+
# This precludes them from being useful in initialization.
225+
if is_time_dependent(sys) && !(sys isa DiscreteSystem)
223226
# 8) use observed equations for guesses of observed variables if not provided
224227
for eq in trueobs
225228
haskey(defs, eq.lhs) && continue

0 commit comments

Comments
 (0)