how to get the value of interations needed by nlmpcmove
2 views (last 30 days)
Show older comments
Andre Hirsch
on 8 Aug 2019
Answered: Harsha Priya Daggubati
on 14 Aug 2019
hello everyone,
I am currently using the nlmpcmove() function to calculate the optimal solutions for my nonlinear problem. Since the calculations take quite some time, I wanted to try and limit the maximum iterations allowed for the solver to caluclate the solution. This works quite well.
But now to my problem:
I want to know how many iterations the solver needed for the optimal or suboptimal solution. The output [~,~,info], doesn't seem to give me enough information to do so!?
Does anyone know a simple solution? Thank you in advance :)
cheers
0 Comments
Accepted Answer
Harsha Priya Daggubati
on 14 Aug 2019
Hi,
A manual approach to find the number of iterations if to plot your Cost Function against Number of iterations using a for loop and examine the plot. If incase you plot does not converge choose a threshold and compare with the two subsequent cost function values.
You can also try using fmincon which provides similar functionality.
0 Comments
More Answers (0)
See Also
Categories
Find more on Model Predictive Control Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!