fsolve terminate far before finding answer when using TolFun option
2 views (last 30 days)
Show older comments
hosein bashi on 6 Mar 2021
Commented: hosein bashi on 8 Mar 2021
fsolve terminate far before finding answer when using TolFun option. I wrote a simple code to show my problem:
6.5^2=42.5 and is far from (Tolfun=1)
Can anyone help me to know how should I solve this issue. Thanks a lot
Matt J on 6 Mar 2021
Edited: Matt J on 7 Mar 2021
Can anyone help me to know how should I solve this issue
You should make TolFun a lot smaller.
Note that x_solution and TolFun are not related in magnitude, so there is no expectation that 6.5^2 should be close to TolFun. TolFun relates to the value of the objective function. Also, note from this table,
that TolFun is not an absolute tolerance in fsolve, so with TolFun=1 it only means that the change in the cost function as a fraction of the current cost function value has fallen below 1.
More Answers (0)
Find more on Systems of Nonlinear Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!