Skip to content

Commit 65682e5

Browse files
committed
fix: use is_diff_equation with flatten_equations
1 parent db21e19 commit 65682e5

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/systems/diffeqs/odesystem.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ function ODESystem(deqs::AbstractVector{<:Equation}, iv, dvs, ps;
305305
throw(ArgumentError("System names must be unique."))
306306
end
307307

308-
algeeqs = filter(eq -> eq.lhs isa Union{Symbolic, Number} && !is_diff_equation(eq), deqs)
308+
algeeqs = filter(eq -> eq.lhs isa Union{Symbolic, Number} && !is_diff_equation(eq), flatten_equations(deqs))
309309
cont_callbacks = SymbolicContinuousCallbacks(continuous_events; algeeqs, iv)
310310
disc_callbacks = SymbolicDiscreteCallbacks(discrete_events; algeeqs, iv)
311311

src/systems/diffeqs/sdesystem.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ function SDESystem(deqs::AbstractVector{<:Equation}, neqs::AbstractArray, iv, dv
264264
Wfact = RefValue(EMPTY_JAC)
265265
Wfact_t = RefValue(EMPTY_JAC)
266266

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

src/systems/discrete_system/implicit_discrete_system.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,11 @@ function shift_u0map_forward(sys::ImplicitDiscreteSystem, u0map, defs)
292292
v = u0map[k]
293293
if !((op = operation(k)) isa Shift)
294294
isnothing(getunshifted(k)) &&
295-
@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."
295+
@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."
296296

297297
updated[k] = v
298298
elseif op.steps > 0
299-
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)))).")
299+
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)))).")
300300
else
301301
updated[k] = v
302302
end

0 commit comments

Comments
 (0)