MATLAB: Fsolve more effective.

complexfsolve

Hye, I would like to make Fsolve more effective when it solves complex root of complex function, is their a way?

Best Answer

No. "fsolve only handles real variables. When x has complex variables, the variables must be split into real and imaginary parts."
Your function can, of course, internally construct (e.g.) w = x(7)+x(8)*1i and use that, but the value of the objective function "fun" must also be non-complex, such as a the magnitude of the distance between the computed location and the goal.
The only routine that appears to handle imaginary variables as such is fgoalattain().
Separating the complex variables in to real and imaginary parts for parameter representation could potentially allow you to instead represent w = exp(-1i*x(7)*x(8)) where x(7) is acting as r and x(8) is acting as theta; with the right solving routine that might allow you to express theta as a periodic boundary condition which might smooth things out. I do not, however, happen to recall any solvers allowing periodic boundaries to be expressed.