Termination Conditions fmincon: Optimality
7 次查看(过去 30 天)
显示 更早的评论
I am wondering exactly how MATLAB calculates first order optimality, especially in constrained optimization cases when it returns one of the bounds (no local minimum exists). What is the termination conditions for this case?
As a test case, I set up the code below. Obviously the first function has no local minimum. The second one does (-2.5).
With interior-point, 1st order optimality is 2e-8. With SQP it is 0. I don't understand, if 1st order optimality is max(\grad f(x)), why the 1st order optimality is not 1 (since the slope is 1 everywhere). I am also returning "grad", and it is not the same as 1st order optimality, even for the case where a local minimum does exist (although both are close to 0 obviously). Couldn't figure out what factor it was using to make a "relative" optimality, as is mentioned in the documentation.
Ultimately I want to be able to "check" which termination criterion was applied, and mimic them myself in an outer loop.
y = @(x) x+2;
y2 = @(x) x^2+5*x-4;
options.Algorithm = 'interior-point';
[optx, y, exitflag,output,lambda,grad,hessian] = fmincon(y,0,[],[],[],[],-5,5, [],options);
[opt2x,z2,exitflag2,output2,lambda2,grad2,hessian2] = fmincon(y2,0,[],[],[],[],-5,5, [],options);
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Problem-Based Optimization Setup 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!