added: support box constraint in LinMPC and NonLinMPC#379
Open
franckgaga wants to merge 8 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #379 +/- ##
==========================================
+ Coverage 98.58% 98.60% +0.01%
==========================================
Files 27 27
Lines 5512 5591 +79
==========================================
+ Hits 5434 5513 +79
Misses 78 78 ☔ View full report in Codecov by Harness. 🚀 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.
Following discussion at #378, it is a good idea in terms of performances to treat constraints on the decision variable as box constraints, instead of linear inequality constraints, at least for NLP and interior point methods.
In this PR, these constraints:
SingleShootingare treated as box constraints. It applies to both$\mathbf{c_{(\bullet)}}$ it is no longer a box constraint and the associated is treated as a linear inequality constraint, like before.
LinMPCandNonLinMPC. Note that if there is a nonzero value in the associated softness parametersThe default QP solver for
LinMPCisOSQP.jl, and it does not support box constraint natively. It is still possible to define box constraints with the bridge mechanism ofJuMP.jl. The new defaultoptimargument forLinMPCisoptim=JuMP.Model(OSQP.MathOptInterfaceOSQP.Optimizer, add_bridges=true). It should not affect the performances since JuMP will automatically convert them as linear equality constraints, as it was the case before this PR. It's possible that the performances withDAQP.jlwill be improved however, since it supports box constraints natively.Warning
Constructing
LinMPCwithoptim=JuMP.Model(OSQP.MathOptInterfaceOSQP.Optimizer, add_bridges=false)will now throw an error. Please useadd_bridges=true(it should not affect performances).Let's see the benchmarks.