Finding complex roots for a nonlinear equation

8 views (last 30 days)
I'm struggling with trying to find zeros (within a given range) for a fairly complicated equation that requires a complex argument:
f=@(lambda) ((1/2)*(2*pi./lambda)*n1*(real(besselj(m-1,(2*pi./lambda)*n1*r)-besselj(m+1,(2*pi./lambda)*n1*r)))/real(besselj(m,(2*pi./lambda)*n1*r))) ... -((1/2)*(2*pi./lambda)*n2*(real(besselh(m-1,1,(2*pi./lambda)*n2*r)-besselh(m+1,1,(2*pi./lambda)*n2*r)))/real(besselh(m,1,(2*pi./lambda)*n2*r)));
I've seen posts suggesting using various methods for dealing with complex numbers, ranging from searching for roots for the real and imaginary parts separately to using fminsearch or fsolve.
Questions: 1) Can anyone recommend the best approach to solving a problem such as this? I 2) Is it even possible to use one of Matlab's built-in functions? Or would I need to write my own algorithm?
Thank you in advance!
  1 Comment
Star Strider
Star Strider on 27 Feb 2014
If you have the Symbolic Math Toolbox, you might consider its solve function. It has the advantage of being reasonably robust, with no inhibitions about returning complex solutions, and the disadvantage of being slow.
Otherwise, search the File Exchange. Someone might have already written a routine to do what you want.

Sign in to comment.

Answers (0)

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!