Optimization of a function using the fmincon
조회 수: 4 (최근 30일)
이전 댓글 표시
I am trying to find the minimum of a function by using the fmincon. My function is a bit complicated.I get the following message:
No active inequalities.
Local minimum possible. Constraints satisfied.
fmincon stopped because the size of the current search direction is less than twice the default value of the step size tolerance and constraints are satisfied to within the default value of the constraint tolerance.
First I do not understand if this is a message that warns me that the optimization has not been successful. Secondly if I try to change some settings I get zero errors in the plots (e.g. if change the for loop 1:6 then I get -5.587e+15) which I want to avoid.
Thank you very much.
댓글 수: 0
답변 (2개)
Walter Roberson
2012년 12월 18일
The message is telling you that minimization has succeeded to within the tolerances and constraints. You might be in a local minimum though.
댓글 수: 4
Walter Roberson
2012년 12월 19일
Set your options to Display information after each iteration, and try to track down the conditions under which the bad value is output. Once you have narrowed it down, put a conditional breakpoint in the code testing for those input values, and run again. When it stops in the debugger, step through to figure out why the large value occurs.
Giorgos Papakonstantinou
2012년 12월 19일
댓글 수: 1
Alan Weiss
2013년 1월 17일
You can set a nonlinear inequality constraint so that pmin is between 5 and 90. But, if this condition is supposed to be satisfied without you setting any constraints, then you should examine your objective function to see what coding error exists.
Alan Weiss
MATLAB mathematical toolbox documentation
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!