How to get fsolve to find a solution when entering in the solution as a guess?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hi
I am currently using fsolve to find the angles of 3 inverse kinematics equations. I am having an issue where, even if I put in the 3 angles that are the approximate solution to solve for the position as my initial guess, it cannot solve. Getting the following error:
No solution found.
fsolve stopped because the problem appears regular as measured by the gradient, but the vector of function values is not near zero as measured by the selected value of the function tolerance.
I have reduced TolFun but once it converges to a solution it's still not near the value I would expect. Are there any techniques or suggestions to help get fsolve to converge when you use the (approximate) solution as the initial guess?
Thanks Nick
0 Commenti
Risposte (1)
John D'Errico
il 17 Mar 2016
1. Why do you assume that a solution exists? Do you know that it does? Being near an approximate solution does not mean a solution exists near where you started. (In fact, just recently I've seen several cases where this was in fact the answer.)
2. Why do you assume that a solution can be found, GIVEN that starting point? Poor starting values are one of the biggest reason for failure of an optimizer.
3. Why should cranking down on TolFun make it converge better? Converge, dammit! I want you find a solution! I really want a solution! TRY HARDER!!!!! Sorry, but cranking down on TolFun will not help one bit if the optimizer has terminated for the reason given.
4. Are you positive that you have implemented the equations properly? Sorry, but people make mistakes in writing code, and this does happen, a lot.
5. Is your system not amenable to solution by fsolve? For example, discontinuities, non-differentiable objectives, etc., all will cause failure.
Vedere anche
Categorie
Scopri di più su Assembly in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!