added: NonLinModelDAE and OrthogonalCollocation support in MovingHorizonEstimator - #453
Merged
Merged
Conversation
We can reuse the computation of the last iteration w/o multi-threading and with piecewise linear input `u`, but we need a special constraint to enforce that `a0` is equal to `a1` of the last iteration.
To be consistent with `X̂0` vector in the decision variables.
franckgaga
marked this pull request as ready for review
September 22, 2026 22:03
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #453 +/- ##
=======================================
Coverage 97.22% 97.23%
=======================================
Files 28 28
Lines 6812 6860 +48
=======================================
+ Hits 6623 6670 +47
- Misses 189 190 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Benchmark Results (Julia v1)Time benchmarks
Memory benchmarks
|
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.
This PR add the support of
NonLinModelDAEinMovingHorizonEstimatorusingOrthogonalTranscription🥳🍾🥳🍾transcriptionkeyword argument in the MHE constructor is nowmodel.transcriptionfor DAEs. This is non-breaking since it is stillSingleShootingfor linear and nonlinear ODEs.getinfo(estim::MovingHorizonEstimator).MovingHorzionEstimatorwith aNonLinModelDAEand aOrthogonalCollocationtranscription is added to the precompilation workflow.f_thread=trueand a race condition on Julia v1.13.0 (was not able to reproduce on LTS). Honestly, I'm not sure why my solution work (different variable names after the loop than the variable names inside the loop body, likely something to weird Julia scoping rules). I ran it like 100 hundred times and no more race condition. A race condition was hit like one time out of five before this bugfix.Related to #332.
New potential linear equality constraints (instead of nonlinear)
I also noticed also special case that could be optimized. For piecewise linear manipulated input ($\tau=1$ of the previous interval are strictly equal. This is in fact a linear equality constraint. So the number of nonlinear equality constraint could be reduced. It is currently handled as a nonlinear inequality constraint.
h==1) and:gaussradau, the algebraic variable at the sampling instantsâ0and the algebraic variable at