Difference between fmincon 'TolFun' and 'FunctionTolerance'

조회 수: 17 (최근 30일)
Laurent Keersmaekers
Laurent Keersmaekers 2017년 3월 16일
댓글: Laurent Keersmaekers 2017년 3월 16일
Hi all,
Recently I moved from Matlab R2015b to R2016b. One of the functions I use is fmincon. According to the help files for R2015b and R2016b, I conclude that the following options should be equivalent:
optimoptions(...
@fmincon,...
'Algorithm', 'interior-point',...
'Display', 'off',...
'TolFun', 1.0e-4,...
'StepTolerance', 1.0e-4,...
'ConstraintTolerance', 1.0e-2,...
'SpecifyObjectiveGradient', true,...
'SpecifyConstraintGradient', true,...
'HessianFcn', "MyHessian");
or:
optimoptions(...
@fmincon,...
'Algorithm', 'interior-point',...
'Display', 'off',...
'FunctionTolerance', 1.0e-4,...
'StepTolerance', 1.0e-4,...
'ConstraintTolerance', 1.0e-2,...
'SpecifyObjectiveGradient', true,...
'SpecifyConstraintGradient', true,...
'HessianFcn', "MyHessian");
However, when I simulate my program with 'FunctionTolerance' I obtain different results in comparison to 'TolFun'.
Can anyone explain why this is happening?
Kind regards, Laurent Keersmaekers

채택된 답변

Alan Weiss
Alan Weiss 2017년 3월 16일
I think that you forgot to specify OptimalityTolerance = 1e-4. The former TolFun was split into two new tolerances. As you see in the Current and Legacy Option Name Tables, the old TolFun option had two meanings: change in function value, and size of first-order optimality measure. These meanings are now codified in FunctionTolerance and OptimalityTolerance. OK?
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 1
Laurent Keersmaekers
Laurent Keersmaekers 2017년 3월 16일
Thank you very much for your advice, this has indeed solved the issue.
Kind regards,
Laurent Keersmaekers

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by