MATLAB: What should I do if Fsolve can not find a solution in the middle of the solution

differential equationsfsolveoptimizationOptimization Toolboxsolve

Hi All
despite having defined a very tight tolerance and high MaxnoEvals and iteration , I get Fsolve Stalled. I don't know how to follow to use fminunc to find the local minimum possible
options = optimset('Display','iter','MaxFunEvals',1e8,'MaxIter',1e20,'TolFun',1e-15,'DerivativeCheck','on','Diagnostics','on');
Norm of First-order Trust-region
Iteration Func-count f(x) step optimality radius
0 10 8.03914e+08 1.29e+07 1
1 20 7.75287e+08 1 1.26e+07 1
2 30 7.06551e+08 2.5 1.18e+07 2.5
3 40 5.51576e+08 6.25 9.92e+06 6.25
4 50 2.58383e+08 15.625 6.03e+06 15.6
5 60 7.16959e+06 39.0625 6.8e+05 39.1
6 70 22001.2 9.27933 3.08e+04 97.7
7 80 0.428073 0.565927 118 97.7
8 90 3.18478e-10 0.00322117 0.00386 97.7
9 100 2.03486e-22 9.70831e-08 5.31e-09 97.7
10 110 1.62955e-22 4.45752e-14 5.46e-09 97.7
Equation solved, fsolve stalled.
fsolve stopped because the relative size of the current step is less than the
default value of the step size tolerance squared and the vector of function values
is near zero as measured by the selected value of the function tolerance.
<stopping criteria details>
the error :
Diagnostic Information
Number of variables: 9
Functions
Objective: root2d
Gradient: finite-differencing
Algorithm selected
trust-region-dogleg
____________________________________________________________
End diagnostic information
Error using trustnleqn (line 28)
Objective function is returning undefined values at initial point. FSOLVE cannot continue.
Error in fsolve (line 388)
trustnleqn(funfcn,x,verbosity,gradflag,options,defaultopt,f,JAC,...
Error in Fsolver (line 91)
[x,fval,exitflag,output] = fsolve(fun,x0,options);

Best Answer

Look what it says: Equation solved!
Isn't that great?