Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
2  
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
add comment

1 Answer

up vote 3 down vote accepted

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}]

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.