Skip to content

Commit 7d9d1fd

Browse files
committed
Use fixpoint_sub
1 parent dbd2dc5 commit 7d9d1fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/systems/nonlinear/nonlinearsystem.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ function calculate_jacobian(sys::NonlinearSystem; sparse = false, simplify = fal
196196
# observed equations may depend on unknowns, so substitute them in first
197197
# TODO: must do the same fix in e.g. calculate_hessian?
198198
# TODO: rather keep observed derivatives unexpanded, like "Differential(obs)(expr)"?
199-
obs = map(eq -> eq.lhs => eq.rhs, observed(sys))
200-
rhs = map(eq -> substitute(eq.rhs, obs), equations(sys))
199+
obs = map(eq -> eq.lhs => eq.rhs, observed(sys)) |> todict
200+
rhs = map(eq -> fixpoint_sub(eq.rhs, obs), equations(sys))
201201
vals = [dv for dv in unknowns(sys)]
202202

203203
if sparse

0 commit comments

Comments
 (0)