MATLAB: An example that FSOLVE doesn’t work

fsolve

I have a two-dimensional non-linear equations, and its non-zero solution is x = [45, 0.1].
given a start point at x0 = [100, 10], let FSOLVE solve the equations but fail, the reason is :
"fsolve stopped because it exceeded the function evaluation limit (the default value)"
However, I write codes applying Newton-Raphson Algorithm, and the running result shows the solution is found within 7 iterations.
So I'm confused why FSOLVE can't work in this case ?
M-files are attached to this post.

Best Answer

You're simply not choosing an x0 close enough to the solution, and are getting stuck at a local min somewhere. When I choose x0 = [50 5], fsolve gives me the correct result no problem.