-
Notifications
You must be signed in to change notification settings - Fork 0
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
Added: support for custom nonlinear constraints gc
in NonLinMPC
#118
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #118 +/- ##
==========================================
- Coverage 98.93% 98.28% -0.66%
==========================================
Files 24 24
Lines 3575 3664 +89
==========================================
+ Hits 3537 3601 +64
- Misses 38 63 +25 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
just a little note, I've never really come across the term "economic constraints" before, is this from some particular book on nonlinear MPC? I use nonlinear MPC with nonlinear constraints very often, but it almost never have an economic interpretation. Would it perhaps be more generic to call them "nonlinear constraints"? I'm thinking that someone who want's to add safety constraints such as collision avoidance will not find what they are looking for, not knowing to look for "economic constraints". |
That's a good point. I named them economic constraints merely for consistency with my current notation. The nonlinear constraint function will not receive It is also incidently consistent with the custom objective term
It would not be precise enough since there is also the plant output and the terminal bounds that are also nonlinear (if the plant model is nonlinear). It's not a replacement of the nonlinear constraints but an addition to the current nonlinear constraints. Maybe just naming them "custom nonlinear constraints" would be sufficient. I would also change my notation to: with the new notation While we are at it, do you think that it's a bad idea to name the custom objective term the economic term? (but renaming it and changing the notation would be a breaking change since they are keyword arguments.) edit : I changed a little bit my new notation to harmonize the mathematical notation to the code (the asterisk is not allowed in Julia's variable names) |
Not necessarily bad, but I'd imagine that many aren't familiar with the term.
One way of changing stuff like this in a non-breaking way is to introduce the new keyword, keep the old, and then do something like function fun(; new = default, old = nothing)
new = something(old, new)
end the function |
gE
in NonLinMPC
gc
in NonLinMPC
@baggepinnen there is no test at all for now so it's very experimental. I'll implement this soon. 🙂 But for now, do you have any comments about the documentation ? (see |
One problem I see is how it's easy to forget to assign the Just calling |
No description provided.