Objective and constraint function evolution count in fmincon

조회 수: 10 (최근 30일)
Md Abu Talhamainuddin Ansary
Md Abu Talhamainuddin Ansary 2017년 9월 14일
댓글: Matt J 2017년 9월 18일
How to find number of objective and constraint function , gradient, hessian count in fmincon using interior point method?

답변 (1개)

Matt J
Matt J 2017년 9월 14일
The number of function evaluations and number of iterations is returned in fmincon's 4th output argument. The number of Hessian and gradient evaluations should equal the number of iterations.
  댓글 수: 4
Md Abu Talhamainuddin Ansary
Md Abu Talhamainuddin Ansary 2017년 9월 18일
Thank you sir for your kind help.
Sir I have one problem min 4(x(1)^2+x(2)^2) subject to x(1)^2+x(2)^2-225<=0 0<=x(1)<=5 0<=x(2)<=3.
For this problem how to write nonlcon with constraints evalutions count?
Matt J
Matt J 2017년 9월 18일
function varargout=nonlcon(x)
persistent count
if isempty(count), count=0; end
count=count+1;
if nargin==1
varargout={count}; return
else
ceq=[];
c=norm(x)^2-225;
varargout={c,ceq};
end
end

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by