From 9182a7db83e66390e850866ea7933f1ca527189c Mon Sep 17 00:00:00 2001 From: Herman Sletmoen Date: Thu, 3 Oct 2024 16:48:16 +0200 Subject: [PATCH] Restore canonical equation form 0 ~ rhs - lhs --- src/systems/nonlinear/nonlinearsystem.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/systems/nonlinear/nonlinearsystem.jl b/src/systems/nonlinear/nonlinearsystem.jl index 3f082068e4..050eea135c 100644 --- a/src/systems/nonlinear/nonlinearsystem.jl +++ b/src/systems/nonlinear/nonlinearsystem.jl @@ -140,6 +140,9 @@ function NonlinearSystem(eqs, unknowns, ps; eqs = [eqs] end + # Copy equations to canonical form, but do not touch array expressions + eqs = [wrap(eq.lhs) isa Symbolics.Arr ? eq : 0 ~ eq.rhs - eq.lhs for eq in eqs] + jac = RefValue{Any}(EMPTY_JAC) defaults = todict(defaults) defaults = Dict{Any, Any}(value(k) => value(v)