Providing gradient using fmincon in an Model Predictive Control context
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello
I've set up a nonlinear MPC problem in Matlab. I'm using Fmincon as the solver which is extremely slow. Looking at the time and run profiler I see that we spend most amount of calculation time in calculating finite differences. So I'm now trying to provide the gradient for fmincon.
Now, the nonlinear constraints are on the states while the optimisation variable is the input u. So the gradient of the constraint function should be zero? (well, zeros to cover the whole horizon). But using the 'CheckGradients' true option throws an error saying that my provided gradient value is not that of the calculated by fmincon. So my question is, how can the gradient be anything other than zero?
0 commentaires
Réponses (1)
Matt J
le 25 Avr 2017
Modifié(e) : Matt J
le 25 Avr 2017
Now, the nonlinear constraints are on the states while the optimisation variable is the input u. So the gradient of the constraint function should be zero?
No, the states are functions of u and so the constraints will also depend on u. MPC is not my field, but I suspect that if you have constraints as a function of the states, then using the chain rule together with the state equations, you can calculate their gradients with respect to u.
0 commentaires
Voir également
Catégories
En savoir plus sur Model Predictive Control Toolbox dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!