Difference between fmincon 'TolFun' and 'FunctionTolerance'
7 views (last 30 days)
Show older comments
Laurent Keersmaekers
on 16 Mar 2017
Commented: Laurent Keersmaekers
on 16 Mar 2017
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
0 Comments
Accepted Answer
Alan Weiss
on 16 Mar 2017
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
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!