An example that FSOLVE doesn't work
4 views (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
Matt J
on 5 Jun 2014
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.
3 Comments
Matt J
on 6 Jun 2014
Edited: Matt J
on 6 Jun 2014
Different algorithms generate different sequences of points. If local min are present, which minimum the sequence will be drawn to can be a very algorithm-dependent thing.
Generally, there is a capture region around any local solution point in which you can count on an algorithm to be drawn to that point. However the capture radius depends on the algorithm, the point, and the shape of the graph of the objective function around that point. If the initial point x0 doesn't lie in the capture radius of any solution, it will just bounce around in a very x0-dependent and algorithm-dependent way until it lands in some capture region.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!