Closed sathvikbhagavan closed 2 months ago
Found this coming from NonlinearSystems where structural_simplify reduces the equations to 0, hence u0 becomes nothing and resid_prototype becomes nothing.
NonlinearSystems
structural_simplify
u0
resid_prototype
MWE:
@variables u1 @parameters k=1.0 r=1.0 u2=1.0 eq = [0 ~ -u2 + (k - u1)/r] @named n = NonlinearSystem(eq, [u1], [u2, k, r]) sys = structural_simplify(n) np = NonlinearLeastSquaresProblem(sys, [], [u2 => 1.0, k => 1.0, r => 1.0]) sol = solve(np) sol[u1]
Found this coming from
NonlinearSystems
wherestructural_simplify
reduces the equations to 0, henceu0
becomes nothing andresid_prototype
becomes nothing.MWE: