2

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 am using Matlab's fsolve.

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 having a hard time to solve it correctly?

Thank you, George

George
  • 21
  • 1
  • 2
  • 3
    Nonlinear problems only converge to a local minimum. To converge to a global minimum you have to provide a good initial guess. – JustinBlaber Mar 19 '13 at 00:26
  • Have you tried adding your assumptions to the model? For example, add a constraint that makes the x dimensions equal. – nneonneo Mar 19 '13 at 00:37
  • @nneonneo yes I have, and it does not seem to help. My question is more of if there are conditions under which the trust-region algorithms used by fsolve are known to fail – George Mar 19 '13 at 14:41

1 Answers1

1

fsolve isn't "failing" - as commented by jucestain, it's giving you a local minimum, which is not necessarily a global minimum. This is what it's designed to do.

To improve your chances of obtaining a global minimum you need to either:

  • Know that your initial guess is good

  • Run the optimisation several times with a grid of initial guesses, and pick the best result

  • Add constraints to prevent the solver straying into areas you know to have local minima

  • Modify your cost function to remove local minima

If you ever come across a non-linear solver that can guarantee a global minimum, do let us know!

pancake
  • 3,232
  • 3
  • 22
  • 35