Add SICNM: semi-implicit Continuous Newton method (NonlinearSolve.jl#330)#142
Draft
ChrisRackauckas-Claude wants to merge 1 commit into
Draft
Add SICNM: semi-implicit Continuous Newton method (NonlinearSolve.jl#330)#142ChrisRackauckas-Claude wants to merge 1 commit into
ChrisRackauckas-Claude wants to merge 1 commit into
Conversation
Implements the semi-implicit Continuous Newton method of Yu et al., arXiv:2312.02809 (SciML/NonlinearSolve.jl#330). SICNM solves 0 = g(y) by integrating the DAE ẏ = z, 0 = J(y) z + g(y), z(0) = -J(y₀) \ g(y₀) to steady state with a stiffly accurate mass-matrix ODE solver (the companion OrdinaryDiffEq.jl PR adds Rodas3d, the method constructed for this purpose). The residual g(y) and the Jacobian-vector product J(y)z are obtained together from a single ForwardDiff dual evaluation, and the ODE solver's own AD of the extended RHS produces the extended Jacobian [0 I; H⊗z+J J] without any manual Hessian handling. Termination is on the nonlinear residual (AbsNormTerminationMode by default, matching the paper's ‖g‖∞ < ε criterion) rather than on du as in DynamicSS. ForwardDiff moves from a test extra to a hard dependency. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NNigabD3sZaUKvDZ1NVQgv
Member
Author
|
Companion PR (Rodas3d solver): SciML/OrdinaryDiffEq.jl#3931 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR is part of an agent-assisted workflow. Please ignore until it has been reviewed by @ChrisRackauckas.
Add SICNM: semi-implicit Continuous Newton method
Part 2 of 2 for SciML/NonlinearSolve.jl#330, implementing the method of Yu et al., Semi-implicit Continuous Newton Method for Power Flow Analysis, arXiv:2312.02809. Companion PR: SciML/OrdinaryDiffEq.jl (adds the
Rodas3dRosenbrock method the paper constructs for this purpose). As discussed on the issue, the DAE solver lives in OrdinaryDiffEq and the wrapper lives here to avoid a circular dependency.What it does
SICNM(odealg)solves aSteadyStateProblemorNonlinearProblem0 = g(y)by integrating the continuous Newton flow written as a DAE:Along the exact flow
g(y(t)) = g(y₀)e^{−t}, so integrating to steady state solves the system; Newton's method is exactly explicit Euler on this flow, so integrating it with an L-stable, stiffly accurate, step-adaptive Rosenbrock method is dramatically more robust (this is the "implicitly stable but explicitly solvable" tradeoff the paper targets — no inner nonlinear iterations, one LU per step).Implementation notes:
J(y)zand the residualg(y)for the DAE right-hand side are computed simultaneously from a single ForwardDiff dual evaluation ofgaty + εz— no full Jacobian is materialized in the RHS, and no manual Hessian is needed: the ODE solver's own AD of the extended RHS automatically produces the extended Jacobian[0 I; H(y)⊗z + J(y) J(y)]from the paper (nested duals, works with the defaultAutoForwardDiffof the Rosenbrock solvers). One dense Jacobian is used only for the consistent initialization ofz(0).g(y)(defaultAbsNormTerminationMode(infnorm), matching the paper's‖g‖∞ < ε), not ondulikeDynamicSS, and the standard NonlinearSolveBase termination modes are supported.iipandoopproblems, Float32,save_idxs, custom callbacks, andodesolve_kwargsare supported, mirroringDynamicSS.The recommended ODE solver is
Rodas3d()from the companion OrdinaryDiffEq PR (constructed by the paper specifically to damp all modes of this DAE as fast as possible), but any stiffly accurate mass-matrix Rosenbrock method works (Rodas4(),Rodas5P(), ...). The tests here useRodas4/Rodas5Pso they run against currently-released OrdinaryDiffEq; a follow-up can switch/extend toRodas3donce released.Verification highlights (run locally)
atan(y)=0fromy₀=3, Powell's badly scaled problem from(0,1), and a near-singular Chandrasekhar H-equation (c = 0.9999, N=32) from a far initial guess — all to‖g‖∞ ≤ 1e-8.SICNM(Rodas3d())was verified end-to-end on all of the above.test/sicnm.jl(iip/oop, both problem types, termination modes incl. safe/safe-best, deliberate short-tspan failure reporting, Float32,save_idxs).One behavior note: a continuous Newton flow cannot cross det(J(y)) = 0 manifolds — if the initial guess is separated from every root by such a manifold, the integrator's step size collapses and the solve reports failure (this is a property of the method, shared by every CNM variant, not an implementation limitation; the paper's convergence guarantee is for initial values inside the region of attraction).
🤖 Generated with Claude Code