added: treat continuity constraints as linear in OrthogonnalCollocation#397
Merged
Conversation
Benchmark Results (Julia v1)Time benchmarks
Memory benchmarks
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #397 +/- ##
=======================================
Coverage 98.71% 98.71%
=======================================
Files 27 27
Lines 5666 5691 +25
=======================================
+ Hits 5593 5618 +25
Misses 73 73 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
They are detailed in the extended help, like for all the other transcription methods.
This is a bit more explicit. The matrix equation in `init_defectmat` is harder to follow.
OrthogonnalCollocationOrthogonnalCollocation
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.
I just realized that the continuity constraints of the
OrthogonalCollocationtranscription are in fact linear equality constraints 😮😮😮 ! I'm not sure if I'm the first one to notice this, presumably not, but nobody mention this in all the textbooks, papers and online documentation that I read.This PR introduces the change to treat them as linear. The main gain from this change is reducing the size of the Jacobian and Hessian of the Langrangian for the AD of the nonlinear equality constraints. The performances gains at NLP solving itself is presumably negligible, except if the solver treat linear constraints separately.
Note that for
:gaussradau, the continuity constraint is useless and redundant. It is however simpler to keep this redundant constraint, since it keeps an identical logic for all quadrature schemes. Now that the continuity constraint is treated as linear and no longer included in the AD, entirely removing it would significantly complexify the internal logic, and presumably without much difference on the performances.In the end, the linear equality constraint include the continuity constraint and the defect of the stochastic states (for the linear unmeasured disturbance model i.e. the integrators). One exception: the state vector is not augmented with
InternalModel, so there are only the continuity constraints for this case.