MATLAB Answers

0

how to get the value of interations needed by nlmpcmove

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

Sign in to comment.

1 Answer

Answer by Harsha Priya Daggubati on 14 Aug 2019
 Accepted Answer

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

Sign in to comment.