added: custom linear inequality constraints for LinMPC and NonLinMPC#310
Open
franckgaga wants to merge 32 commits intomainfrom
Open
added: custom linear inequality constraints for LinMPC and NonLinMPC#310franckgaga wants to merge 32 commits intomainfrom
LinMPC and NonLinMPC#310franckgaga wants to merge 32 commits intomainfrom
Conversation
This is the letter that has the lowest amount of confusion. It is used in the MHE/KF but only with a hat.
It is not supported for now, I will add the support in a following PR.
The error message is clearer if the tests do not pass.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #310 +/- ##
========================================
Coverage 98.33% 98.33%
========================================
Files 29 29
Lines 5155 5295 +140
========================================
+ Hits 5069 5207 +138
- Misses 86 88 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 introduces custom nonlinear inequality constraints for
LinMPCandNonLinMPCobjects. The constructor of both objects now accepts 4 new keyword arguments:Wy=nothing: custom linear constraint matrix for output.Wu=nothing: custom linear constraint matrix for manipulated input.Wd=nothing: custom linear constraint matrix for meas. disturbance.Wr=nothing: custom linear constraint matrix for output setpoint.and the
setconstraint!method now accept these keyword arguments:wmin=fill(-Inf,nw)/wmax=fill(+Inf,nw): custom linear constraint boundc_wmin=fill(1.0,nw)/c_wmax=fill(1.0,nw):wmin/wmaxsoftness weightWmaxorC_wmin: for time-varying constraintsThe custom nonlinear inequality constraints are defined as a linear combination of the output prediction$\mathbf{\hat{y}}$ , manipulated input $\mathbf{u}$ , measured disturbance prediction $\mathbf{\hat{d}}$ and setpoint prediction $\mathbf{\hat{r}_y}$ , as described in the extended help section of
setconstraint!:I chose to incorporate the output prediction$\mathbf{\hat{y}}$ instead of state prediction $\mathbf{\hat{x}}$ in them mainly because its associated prediction matrices are already constructed and available inside $\mathbf{C}$ and $\mathbf{D_d}$ matrices, and adjusting the
LinMPCandNonLinMPCobjects. This is non-limiting in practice since you can always output the states that are needed by modifying the state-spacei_ymargument of the state estimator if these states are not measured.Note that C code generation is not supported for now but I will add the support in the following PR.