Skip to content

Commit d6fdb73

Browse files
committed
Fix a minor bug
1 parent 2727da0 commit d6fdb73

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/systems/nonlinear/nonlinearsystem.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ function NonlinearSystem(eqs, states, ps;
7777
throw(ArgumentError("NonlinearSystem does not accept `continuous_events`, you provided $continuous_events"))
7878
name === nothing && throw(ArgumentError("The `name` keyword must be provided. Please consider using the `@named` macro"))
7979
# Move things over, but do not touch array expressions
80-
eqs = [0 ~ scalarize(x.rhs) - scalarize(x.lhs) for x in eqs]
80+
#
81+
# # we cannot scalarize in the loop because `eqs` itself might require
82+
# scalarization
83+
eqs = [0 ~ x.rhs - x.lhs for x in scalarize(eqs)]
8184

8285
if !(isempty(default_u0) && isempty(default_p))
8386
Base.depwarn("`default_u0` and `default_p` are deprecated. Use `defaults` instead.", :NonlinearSystem, force=true)

0 commit comments

Comments
 (0)