MATLAB: Does fsolve depend on the stability of the system

fsolveMATLABOptimization Toolboxstabilitysystem of nonlinear equationstrust-region algorithms

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

Best Answer

Well, the first formulation in your Comment to Alan definitely looks like it could be unstable if the g_i(x)--->0 as x becomes large. That would also mean that f_i(x)--->0 with large x and thus would be insensitive to changes in x in that region.
You could try running fsolve with your second formulation, but that formulation is non-differentiable and undefined for g_i(x)<0, so you may need to move to a constrained solver.
Related Question