-
Notifications
You must be signed in to change notification settings - Fork 66
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
Use Barycentric Lagrange Interpolation for controls in Simulation #1056
Merged
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
The state segment end values are no longer a variable in the birkhoff transcription. Birkhoff linear constraints are now improving sparsity on a lot of problems. Fixed an issue with abs/promoted path names for timeseries plotting.
…ile, simulation and solution cases do not match.
…but needs derivatives and polynomials to work also
… derivative matrices when n is not high enough.
… have no higher order derivatives
Added pre_announce to testflo main run.
…causing incorrect derivatives in the ODEIntegrationComp. The partials in the control interpolation and elsewhere seem correct, so I'm not sure whats happening there. In the meantime, I've reverted to Vandermonde interpolation for ExplicitShooting, except when doing pure simulation, in which case the more accurate Barycentric interpolant is used.
kaushikponnapalli
approved these changes
Mar 29, 2024
robfalck
changed the title
Use Barycentric Lagrange Interpolation for controls in ExplicitShooting
Use Barycentric Lagrange Interpolation for controls in Simulation
Mar 29, 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.
Summary
Previously dymos had used Vandermonde interpolation for controls in ExplicitShooting, because matrices could be calculated apriori. However, the exponents on the terms in the Vandermonde matrix go up to N (the number of nodes of interpolation). When the number of nodes is large (greater than 20-30), this exceeds the floating point limitations and accuracy of the interpolation suffers.
Barycentric interpolation fixes this issue, though it is somewhat more expensive.
To improve performance, numba's just-in-time compilation is used to compute some derivatives (the control rates, derivatives of the rates). Numba is optional for this implementation, and it will work seemlessly (albeit more slowly) without it.
For pure simulation, users are unlikely to notice any performance difference at all until segments grow to ~50 nodes or so.
Related Issues
Backwards incompatibilities
None
New Dependencies
Numba jit is used to make a 4-nested for loop more performant. Numba is an optional dependency and