Does fsolve depend on the stability of the system?
Show older comments
Hello all,
I am trying to solve a system of non linear equations using fsolve; lets say
F(x;lambda) = 0, where lambda is a vector of parameters, and x the vector I want to solve for.
I have 2 values of the parameter lambda, that I want to solve the system for. For the one value of lambda I get a solution, which seems alright.
For the other value of lambda I get a solution again (matlab exits with a flag of 1. However I know this is not an actual solution For example I know that some of the dimensions of x have to be equal to each other, and this is not the case in the solution I get from fsolve.
I have tried both trust-region and the levenberg-marquardt algorithm, and I am not getting any better results. (explicitly enforcing those x's to be the same, still seems to give solutions that are not consistent with what I would be expecting from the properties of the system)
My question is: do the algorithms used by fsolve depend on any kind of stability of the system? Could it be that changing the parameter lambda in the second case I mention above, I make the system unstable, and could that make fsolve unable to solve it correctly?
Thank you, George
Accepted Answer
More Answers (1)
Alan Weiss
on 19 Mar 2013
If fsolve exited with an exitflag of 1, then the reported solution is a solution. You can verify it by putting it back into your function. If your function is F and your solution is xsol, you will see
F(xsol)
is a vector with very small values.
What it sounds like you want is a different solution than the one fsolve already found. Generally, this means starting fsolve from a variety of initial points. See this section for ideas on how to take different initial points.
You can also try to use lsqnonlin instead of fsolve, but for this cse I doubt there would be any advantage in doing so, unless you use MultiStart to search for minima of lsqnonneg.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
1 Comment
Categories
Find more on Solver Outputs and Iterative Display in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!