Add F(x) termination criterion to DampedNewtonSolver, fix Jacobian for volume constraints #680
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.
This pull request introduces several improvements and refactors to the nonlinear solver infrastructure and compositional polytope tools, focusing on enhanced convergence control, more robust solution reporting, and improved handling of endmember ordering in compositional simplification. The most significant changes are the introduction of per-component convergence tolerances for nonlinear solvers, a new
Solutionclass for standardized solver results, and logic to preserve endmember order when simplifying composites.Nonlinear Solver Improvements
F_tolparameter for per-component convergence tolerances in both theDampedNewtonSolverclass and thedamped_newton_solvefunction, allowing for more precise control over solver termination based on the function residuals. Also implemented a default tolerance generator indefault_F_tolerances. [1] [2] [3] [4] [5] [6] [7]F(x)usingF_tolbefore declaring success, increasing reliability for equilibrium calculations.Solution Reporting Refactor
Solutionclass (and supportingIteratesclass) to encapsulate solver results, replacing the previous use ofSimpleNamespaceandnamedtuple. This provides a more structured and extensible way to store results and iteration history. [1] [2] [3] [4] [5]Solutionobject, including iteration storage and output formatting. [1] [2] [3]Polytope and Compositional Tools
reorder_to_echelonfunction and logic insimplify_composite_with_compositionto reorder basis matrices to echelon form, helping preserve the order of endmembers in simplified composites. This change is validated by a new test. [1] [2] [3]Miscellaneous
check_fig_7_fO2.equilibratefor clarity and correctness.These changes collectively improve the reliability, transparency, and usability of the nonlinear solver and compositional simplification workflow.