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);

采纳的回答

Matt J
Matt J 2020-10-31
编辑:Matt J 2020-10-31
In the constrained case, the first order optimality metric, described here,
involves the gradients of both the objective and the constraints.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Problem-Based Optimization Setup 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by