Increase accuracy of fsolve

조회 수: 9 (최근 30일)
Ying Shi Teh
Ying Shi Teh 2018년 1월 24일
댓글: Walter Roberson 2018년 1월 24일
I am trying to increase the accuracy of the solution obtained from fsolve by changing the options of fsolve as follows:
options = optimset('Display','iter');
options.MaxIter = 5000 ;
options.MaxFunEvals = 5000000 ;
options.FunctionTolerance = 1e-16;
options.OptimalityTolerance = 1e-16;
options.StepTolerance = 1e-16;
solution = fsolve(@ComputeFunction,solution,options);
However, nothing seems to change even after including the three lines on changing the tolerance. The total number of iterations performed remains the same. Information on the last two iterations is included below for your reference.
Norm of First-order
Iteration Func-count f(x) step optimality
2132 855333 3.66897e-09 0.000570497 0.544
2133 855734 3.66897e-09 8.73214e-15 0.145
Any idea on how I can actually raise the accuracy especially by lowering the value of f(x) even more? Thanks!
  댓글 수: 1
Walter Roberson
Walter Roberson 2018년 1월 24일
My reading of that is that the last step was by just slightly more than 1E-16 and that the next step would have been less than 1E-16
The documentation recommends against using a tolerance that low https://www.mathworks.com/help/optim/ug/tolerances-and-stopping-criteria.html says using a step tolerance less than eps can lead to inaccuracies; eps is about 2E-16, twice as large as what you are asking for.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by