フィルターのクリア

Active constraints in fgoalattain result, but I didn't provide constraints.

1 回表示 (過去 30 日間)
Kevin Doherty
Kevin Doherty 2015 年 9 月 23 日
コメント済み: Kevin Doherty 2015 年 9 月 25 日
I am using the optimisation toolbox in R2008b. I have noticed that when I run fgoalattain with no constraints, some constraints appear to be violated throughout iterations of the algorithm and the algorithm returns a solution with active nonlinear inequalities. My understanding is that this should not happen, since I have not provided any constraints, but perhaps there is a good reason for it.
Here is an example:
function x = test
options = optimset('Display','iter',...
'GoalsExactAchieve',2);
weight = [1,1];
goal = [2,2];
x0 = [1,2];
x = fgoalattain(@FitF,x0,goal,weight,[],[],[],[],[],[],[],options);
function ObjF = FitF(x)
ObjF = [exp(2*x(2))-exp(x(1));
exp(x(1))-2*exp(x(2))];
In the above code, I am optimising a relatively simple set of equations and am providing no linear or nonlinear constraints. This returns the following output:
>> x = test
Attainment Max Line search Directional
Iter F-count factor constraint steplength derivative Procedure
0 4 0 49.8799
1 8 2.114 8.168 1 0.704
2 12 2.451 1.567 1 0.615 Hessian modified twice
3 16 1.906e-008 0.8339 1 -0.984
4 20 0 0.0666 1 -1.3e-007
5 24 1.388e-017 0.0005193 1 1.04e-015
6 28 0 3.063e-008 1 -1.38e-013 Hessian modified
Optimization terminated: magnitude of search direction less than 2*options.TolX
and maximum constraint violation is less than options.TolCon.
Active inequalities (to within options.TolCon = 1e-006):
lower upper ineqlin ineqnonlin
1
2
3
4
x =
2.1368 1.1744
>>
As you can see, fgoalattain works just fine. But why is Max constraint non-zero and why does my solution have active nonlinear inequalities when I have not provided any nonlinear constraints?

採用された回答

Alan Weiss
Alan Weiss 2015 年 9 月 25 日
I think that what is happening is that fgoalattain internally reformulates your problem as described in the documentation, and converts the problem to a standard minimization problem with nonlinear constraints:
min γ
x,γ
such that
F(x) w·γ ≤ F*.
I believe that the exit message is referring to something like these nonlinear constraints, which are not quite as simple as I just described, but you can read more details in the documentation link I gave.
Alan Weiss
MATLAB mathematical toolbox documentation
  1 件のコメント
Kevin Doherty
Kevin Doherty 2015 年 9 月 25 日
Ah, this makes sense to me now.
Also worth noting is that there are four active inequalities because I set "GoalsExactAchieve" to 2. This is due (I think) to the fact that once a goal is achieved, this counts as an active inequality, and as long as it is not overachieved (within TolCon), this counts as another active inequality. For example, if I set "GoalsExactAchieve" to 0 then there are two active inequalities.
Thanks Alan

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by