Fsolve more effective.
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hye, I would like to make Fsolve more effective when it solves complex root of complex function, is their a way?
0 commentaires
Réponse acceptée
Walter Roberson
le 4 Août 2011
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.
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!