Active constraints in fgoalattain result, but I didn't provide constraints.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Kevin Doherty
am 23 Sep. 2015
Kommentiert: Kevin Doherty
am 25 Sep. 2015
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?
0 Kommentare
Akzeptierte Antwort
Alan Weiss
am 25 Sep. 2015
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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!