Hi Dear all,
I have a question that in my programming, I have already setted the lower bound of every variable is zero. Why there is still some variables lower than zero?
Thank you

 Accepted Answer

Matt J
Matt J on 9 May 2014
Edited: Matt J on 9 May 2014

0 votes

Only certain algorithms enforce bounds strictly (sqp, interior-point with 'AlwaysHonorConstraints' option active). Otherwise, they can be violated up to the TolCon tolerance parameter. Also, fmincon may have failed to find a solution. You need to check the exitflag output to see if it reported success.

4 Comments

sorry, could u tell me what does it mean, fial to find a solution? thank u
Matt J
Matt J on 11 May 2014
Edited: Matt J on 11 May 2014
fmincon uses iterative algorithms to find a solution. It generates a sequence x1,x2,x3... which is supposed to converge to the optimum x*. But there are various ways that the convergence can fail. For example, there is a an option parameter MaxIter which sets a limit on the number of iterations it can do. If MaxIter is reached, the algorithm will simply stop, regardless of how close it is to a solution and how well the constraints are satisfied.
Hi,your answer is really really useful for me, Thank u so much. However, I have another question, what does it mean F-count which is shown in the command window. I know the meaning of it is the cumulative number of times Rosenbrock's function was evaluated. But, what kind of information I can get from it . Or how can i know soem information after knowing this value? Thank u
You should post that as a different question (and close this one).

Sign in to comment.

More Answers (0)

Asked:

on 9 May 2014

Commented:

on 11 May 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!