Skip to content

Commit 220017d

Browse files
committed
fix: use is_diff_equation with flatten_equations
1 parent 54b1d1b commit 220017d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/systems/diffeqs/odesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ function ODESystem(deqs::AbstractVector{<:Equation}, iv, dvs, ps;
311311
throw(ArgumentError("System names must be unique."))
312312
end
313313

314-
algeeqs = filter(eq -> eq.lhs isa Union{Symbolic, Number} && !is_diff_equation(eq), deqs)
314+
algeeqs = filter(eq -> eq.lhs isa Union{Symbolic, Number} && !is_diff_equation(eq), flatten_equations(deqs))
315315
cont_callbacks = SymbolicContinuousCallbacks(continuous_events; algeeqs, iv)
316316
disc_callbacks = SymbolicDiscreteCallbacks(discrete_events; algeeqs, iv)
317317

src/systems/diffeqs/sdesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ function SDESystem(deqs::AbstractVector{<:Equation}, neqs::AbstractArray, iv, dv
268268
Wfact = RefValue(EMPTY_JAC)
269269
Wfact_t = RefValue(EMPTY_JAC)
270270

271-
algeeqs = filter(eq -> eq.lhs isa Union{Symbolic, Number} && !is_diff_equation(eq), deqs)
271+
algeeqs = filter(eq -> eq.lhs isa Union{Symbolic, Number} && !is_diff_equation(eq), flatten_equations(deqs))
272272
cont_callbacks = SymbolicContinuousCallbacks(continuous_events; algeeqs, iv)
273273
disc_callbacks = SymbolicDiscreteCallbacks(discrete_events; algeeqs, iv)
274274
if is_dde === nothing

src/systems/discrete_system/implicit_discrete_system.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,11 +298,11 @@ function shift_u0map_forward(sys::ImplicitDiscreteSystem, u0map, defs)
298298
v = u0map[k]
299299
if !((op = operation(k)) isa Shift)
300300
isnothing(getunshifted(k)) &&
301-
@warn "Initial condition given in term of current state of the unknown. If `build_initializeprob = false, this may be overriden by the implicit discrete solver."
301+
@warn "Initial condition given in term of current state of the unknown. If `build_initializeprob = false`, this may be overriden by the implicit discrete solver."
302302

303303
updated[k] = v
304304
elseif op.steps > 0
305-
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)))).")
305+
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)))).")
306306
else
307307
updated[k] = v
308308
end

0 commit comments

Comments
 (0)