Optimization of a function using the fmincon

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.

回答 (2 件)

Walter Roberson
Walter Roberson 2012 年 12 月 18 日

0 投票

The message is telling you that minimization has succeeded to within the tolerances and constraints. You might be in a local minimum though.

4 件のコメント

Giorgos Papakonstantinou
Giorgos Papakonstantinou 2012 年 12 月 18 日
I understand that I might be in local minimum. Is the minimum dependent on the guess that I make, in the upper and lower and boundaries that I set or on both? Is there a way to find out?
Also is there a way to avoid results like this -5.587e+15? Thank you
Matt Kindig
Matt Kindig 2012 年 12 月 18 日
For your first question, yes on both. Both the initial guess and the upper/lower bounds that you impose will have an effect on the minimum that Matlab determines. There is no direct way to determine if you are at a local minimum (obviously Matlab would need to know the other local optima to determine this, which fmincon does not find). Instead, it is common practice to run fmincon multiple times, with different initial guesses and/or bounds at each time, with the different initial guesses spread apart as to sample different parts of your domain. You would then use the xmin that results in the lowest pmin of all of these runs.
If you have the Global Optimization Toolbox (not the same as the standard Optimization Toolbox), you can use the 'MultiStart' function to do this automatically.
Is this result -5.587e+15 the output (pmin), an element of xmin, or something else? Are negative values of pmin appropriate for your problem?
Giorgos Papakonstantinou
Giorgos Papakonstantinou 2012 年 12 月 19 日
Thank you Matt. This is one output of pmin. pmin must always be positive. and the values of pmin range from 5 to 90. Only in the case that I set in the first loop for j=1:6 I get only once this weird result of pmin.
This weird result appears more of often when I set in the first loop
for j=10:10:60
In this scenario all my results are messed up having values of the order of -5e+15, which totally wrong.
Walter Roberson
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
Giorgos Papakonstantinou 2012 年 12 月 19 日

0 投票

Is there anything else to point out please?

1 件のコメント

Alan Weiss
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

サインインしてコメントする。

カテゴリ

質問済み:

2012 年 12 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by