Solve nonlinear complex equations
Show older comments
Hello,
I am trying to numerically solve a nonlinear complex equation and I would like to find all the complex roots. The equation is of the type:
cot(z)*z = 1-z^2*(1+i*z)
Does a specific function exist to find all the complex roots or do I need to separate z in the real and imaginary parts?
Thanks in advance for your help!
Accepted Answer
More Answers (1)
Azzi Abdelmalek
on 10 Feb 2013
Use fzero function
doc fzero
f=@(z)cot(z)*z -(1-z^2*(1+i*z))
z0=i;
sol=fzero(f,z0); % the solution is near z0
2 Comments
It's interesting that this worked for z0=i, but it appears to be just a fluke. FZERO can't really handle complex-valued functions. Note,
>> sol=fzero(f,1+i)
Error using fzero (line 309)
Function value at starting guess must be finite and real.
Ed
on 10 Feb 2013
Categories
Find more on Solver Outputs and Iterative Display in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!