-
Notifications
You must be signed in to change notification settings - Fork 21
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
Bugfix for polynomial root-finding #1322
Merged
mattdailis
merged 6 commits into
develop
from
bugfix--polynomial-rootfinding-convergence
Mar 1, 2024
Merged
Bugfix for polynomial root-finding #1322
mattdailis
merged 6 commits into
develop
from
bugfix--polynomial-rootfinding-convergence
Mar 1, 2024
Conversation
This file contains 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
DavidLegg
changed the title
Bugfix polynomial rootfinding convergence
Bugfix for polynomial root-finding
Feb 6, 2024
bradNASA
approved these changes
Feb 14, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this. SRL is having to use contrib jars from this branch until merged; the model is broken without it. The performance improvement for SRL seems dramatic, maybe twice as fast.
mattdailis
force-pushed
the
bugfix--polynomial-rootfinding-convergence
branch
from
February 28, 2024 19:30
1944f51
to
fe23aab
Compare
There's an edge case that was missed by dynamicsChange conditions: when a cell is set to a dynamics with the same data, but a later expiry. This was discovered while debugging clamped integrals whose integrands changed from one limited-out value to another. The solver would emit the same effective rate for the integral (0), but with an expiry that changed from zero time to some positive time. By only reacting to the first change, the zero expiry time was propagated forward, but the corrected non-zero time wasn't.
When solving for an interval over which to take an approximation, we take the expiry of the dynamics to be approximated into account. In the case when no solution is found, we should still take expiry into account. This is especially important when that expiry is much shorter than the typical approximation interval. In this case, we can often choose the full expiry as the approximation interval without reaching our maximum error tolerance, resulting in a NoBracketingException from the solver. In this case, we should choose the expiry, not the maximum approximation interval, to be consistent with the time range we searched.
Improve performance of polynomial root-finding by solving linear polynomials directly, instead of handing off to the Laguerre solver. For nonlinear polynomials, improve the stability of root-finding for polynomials with very large or very small coefficients by first conditioning the problem, normalizing the constant coefficient to 1.
Removes the use of eraseExpiry in LinearBoundaryConsistencySolver. This was a patch put in place to support feedback loops involving the solver, but it erases too much information. Leaving the expiry in place and erasing it only when actually building a feedback loop lets downstream components like approximations take that expiry into account. Also reconfigures the use of eraseExpiry in clampedIntegrate to pass expiry information through.
mattdailis
force-pushed
the
bugfix--polynomial-rootfinding-convergence
branch
from
March 1, 2024 01:14
fe23aab
to
fac6582
Compare
mattdailis
approved these changes
Mar 1, 2024
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.
Description
Fixes a few bugs related to rootfinding and expiry-propagation for Polynomial resources. The most important of these fixes are:
Before:
After
Verification
The changes in polynomial root-finding come with additional unit tests to detect some of these edge cases. Additionally, Brad has tested these changes with the SRL model, with positive results.
Documentation
N/A
Future work
N/A