Skip to content

Commit 5ec75ca

Browse files
fix: update error checking for ImplicitDiscreteProblem initial conditions
Co-authored-by: vyudu <[email protected]>
1 parent 29584fa commit 5ec75ca

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/systems/discrete_system/implicit_discrete_system.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,9 @@ function shift_u0map_forward(sys::ImplicitDiscreteSystem, u0map, defs)
298298
for k in collect(keys(u0map))
299299
v = u0map[k]
300300
if !((op = operation(k)) isa Shift)
301-
isnothing(getunshifted(k)) &&
302-
error("Initial conditions must be for the past state of the unknowns. Instead of providing the condition for $k, provide the condition for $(Shift(iv, -1)(k)).")
303-
304301
updated[k] = v
305302
elseif op.steps > 0
306-
error("Initial conditions must be for the past state of the unknowns. Instead of providing the condition for $k, provide the condition for $(Shift(iv, -1)(only(arguments(k)))).")
303+
error("Initial conditions must be for the current or past state of the unknowns. Instead of providing the condition for $k, provide the condition for $(Shift(iv, -1)(only(arguments(k)))).")
307304
else
308305
updated[k] = v
309306
end

0 commit comments

Comments
 (0)