Difference between fmincon 'TolFun' and 'FunctionTolerance'

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

 Accepted Answer

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 Comment

Thank you very much for your advice, this has indeed solved the issue.
Kind regards,
Laurent Keersmaekers

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!