MATLAB Answers

Why is lambda as an output of fmincon empty?

5 ビュー (過去 30 日間)
Viswanath Hariharan
Viswanath Hariharan 2018 年 6 月 25 日
回答済み: Steve Grikschat 2018 年 6 月 27 日
I am using fmincon to perform convex, non linear programming, constrained optimization. I don't have any non linear equality constraints. I have linear equality and inequality constraints and non linear inequality constraints. I just have a few questions.
1. What does it mean for fmincon solver to give out an empty lambda?
2. How to check for quality of solution obtained by fmincon?
3. How to obtain duality gap in fmincon?
  2 件のコメント
Viswanath Hariharan
Viswanath Hariharan 2018 年 6 月 27 日
options = optimoptions(@fmincon,'OutputFcn',@inexact_outfun,'Algorithm','interior-point','MaxIterations',1e6,'MaxFunctionEvaluations',1e6,'StepTolerance',1e-10 );
[x,fval,exitflag,output,lambda,grad,hessian] = fmincon(fun,tempx0,A,b,Aeq,beq,lb,ub,@(x)nonlconstraints(x,j),options);
>> output_val{4}
ans =
struct with fields:
iterations: 4
funcCount: 307
constrviolation: 0.1956
stepsize: 0.0055
algorithm: 'interior-point'
firstorderopt: 0
cgiterations: 0
message: 'fmincon stopped by the output or plot function.'

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

採用された回答

Steve Grikschat
Steve Grikschat 2018 年 6 月 27 日
Hi Viswanath,
The lambda output is empty since the algorithm was stopped prematurely by the OutputFcn.
When that happens, the lambda (the Lagrangian duals) may be in an inconsistent state, so they are not returned. If you let the optimization complete normally, you should get a structure of duals in the lambda output (assuming the problem is not infeasible or unbounded).

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by