Skip to content

Update AlgebraicSolver tolerances + default ESOH solver method #4982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 17, 2025

Conversation

MarcBerliner
Copy link
Member

Description

Previously, the AlgebraicSolver would only declare success if the absolute tolerance of the residuals were below the tol threshold. However, the scipy solvers would frequently terminate if other thresholds were hit, such as xtol or gtol, and AlgebraicSolver may erroneously throw an error even after a successful solve

This PR:

  • tightens xtol and gtol from 1e-8 to 1e-12 to reflect the fact that we desire all(abs(f(x)) < tol)
  • updates the success criterion to terminate either if the solver successfully exits or all(abs(f(x)) < tol) is satisfied
  • also changes the default solver in ElectrodeSOHHalfCell to trust-region instead of a minimizer

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #)

Important checks:

Please confirm the following before marking the PR as ready for review:

  • No style issues: nox -s pre-commit
  • All tests pass: nox -s tests
  • The documentation builds: nox -s doctests
  • Code is commented for hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@MarcBerliner MarcBerliner marked this pull request as ready for review April 17, 2025 19:38
@MarcBerliner MarcBerliner requested a review from a team as a code owner April 17, 2025 19:38
Copy link
Contributor

@kratman kratman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine as long as the tests are passing

Copy link

codecov bot commented Apr 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.62%. Comparing base (4363962) to head (5f028da).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4982      +/-   ##
===========================================
- Coverage    98.64%   98.62%   -0.03%     
===========================================
  Files          304      304              
  Lines        23750    23755       +5     
===========================================
- Hits         23429    23428       -1     
- Misses         321      327       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kratman kratman merged commit 4a4d969 into develop Apr 17, 2025
25 of 26 checks passed
@kratman kratman deleted the mdb/algebraic-solver-tols branch April 17, 2025 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants