# How can I plot the real and imaginary parts of a complex function given by an implicit equation?

My equation is

I e2 s2 w (m1^2 m2 q1 s1^2 s2 + m1 m2^2 q2 s1^2 s2 + m1^2 q1 s1^2 s2 ζ -
m2^2 q2 s1^2 s2 ζ - 2 m1 q1 s1^2 s2 ζ^2 - m2 q1 s1^2 s2 ζ^2 + m1 q2 s1^2 s2 ζ^2 +
q1 s1^2 s2 ζ^3 - q2 s1^2 s2 ζ^3) +
1/w s1 γ ζ^3 (2 I m2^2 q2 s1 s2^2 ζ + 2 I m2 q1 s1 s2^2 ζ^2 -
2 I m2 q2 s1 s2^2 ζ^2 - 2 I q1 s1 s2^2 ζ^3) -
I (m1^2 m2 q1 s1 s2^2 + m1 m2^2 q2 s1 s2^2 - m1^2 q1 s1 s2^2 ζ + m2^2 q2 s1 s2^2 ζ +
m2 q1 s1 s2^2 ζ^2 - m1 q2 s1 s2^2 ζ^2 - 2 m2 q2 s1 s2^2 ζ^2 - q1 s1 s2^2 ζ^3 +
q2 s1 s2^2 ζ^3) (-e1 s1 w + (s1 γ ζ^3)/w) == 0


and

m1 = Sqrt[ζ^2 - I*w/s1]; m2 = Sqrt[ζ^2 - I*w/s2];


The independent variable is w. All the other variables are constant except ζ (complex number).

q1 = 1; q2 = 0.5; e1 = 1; e2 = 0.8; s1 = 1; s2 = 0.6; γ =1000;


I used FindRoot and solved this problem. FindRoot gives the solution only for one case of w, but I want to plot the graph of w and ζ.

How do I plot Re[ζ] vs.w and Im[ζ] vs. w?

-
You could define eqs[w_] = and sol[w_?NumericQ] := FindRoot[eqs[w] == 0, {\[Zeta], 1 + I 1/2}][[1, 2]]. – b.gatessucks Sep 15 '13 at 8:21

First, I would suggest simplifying your equation. For this I've converted all constants to exact numbers

q1 = 1; q2 = 1/2; e1 = 1; e2 = 8/10; s1 = 1; s2 = 6/10; γ = 1000;
m1 = Sqrt[ζ^2 - I*w/s1]; m2 = Sqrt[ζ^2 - I*w/s2];


Then applying Simplify to your equation gives

eq[w_] := -2 I w ζ^2 (3 ζ + 12 Sqrt[-I w + ζ^2] - 5 Sqrt[-15 I w + 9 ζ^2])
+ w^2 (-ζ + 45 Sqrt[-I w + ζ^2] + 18 Sqrt[-15 I w + 9 ζ^2]) ==
5000 ζ^3 (-11 ζ + 5 Sqrt[-I w + ζ^2] + 2 Sqrt[-15 I w + 9 ζ^2])


This is solved by b.gatessucks method

sol[w_?NumericQ] := FindRoot[eq[w], {ζ, 1 + I 1/2}][[1, 2]]


Then Plot command produces a nice graph

Plot[{Re[sol[w]], Im[sol[w]]}, {w, -1/2, 1/2},
AxesLabel -> {w, None}, PlotLegends -> "Expressions",
PlotStyle -> {Blue, Red}]


-