I'm trying to plot an implicit function satisfying a complex transcendental equation. The code is the following:

ContourPlot[(e (-1 + e^2) l (-3 + 2 e^2 - l^2) Cosh[2 Sqrt[1 - e^2]] + 
  (-1 + e^2) (-1 + l^2) (e l Cos[2] - I (1 + l^2) Sin[2]) + Sqrt[1 - e^2]
  (I - I l^4 - 2 e (-2 + e^2) l Sqrt[-e^2 + l^2]) Sinh[2 Sqrt[1 - e^2]]) == 0, 
  {l, 1, 2}, {e, -2, 2}]

I need a real solution of e as a function of l and also e<=Min{1,l}. I don't know why it's empty in the plot. I don't think it's because the solution is out of the range since I tried l=1, and there are several solutions, one of which is e = 0. Thus I think there must be something wrong with the plot.


1 Answer 1


Your expression is not real, but complex. Think about how you want to turn your expression real. The documentation states

At positions where f does not evaluate to a real number, holes are left so that the background to the contour plot shows through.

So what you probably want is to test Abs[f[..]]==0 which gives you the lines where the whole left side vanishes. Unfortunately, they are not in your plot region. Therefore, take a look at this and hover with the mouse over the region borders to see the iso-value.

f[l_, e_] := (e (-1 + e^2) l (-3 + 2 e^2 - l^2) Cosh[
     2 Sqrt[1 - e^2]] + (-1 + e^2) (-1 + l^2) (e l Cos[2] - 
      I (1 + l^2) Sin[2]) + 
   Sqrt[1 - e^2] (I - I l^4 - 2 e (-2 + e^2) l Sqrt[-e^2 + l^2]) Sinh[
     2 Sqrt[1 - e^2]]);

ContourPlot[Abs[f[l, e]], {l, 1, 2}, {e, -2, 2}]

Mathematica graphics

  • $\begingroup$ Thanks for answering. I don't quite understand why only the real part of function is zero. The equation is complex does not mean the solution of e has to be complex, right? $\endgroup$
    – Knightq
    Oct 18, 2013 at 4:18
  • $\begingroup$ I see what you mean, but this does not equivalent to the original equation anymore. I try Im[f]==0, the solution is different. Seems like my equation is problematic.. $\endgroup$
    – Knightq
    Oct 18, 2013 at 4:24
  • 1
    $\begingroup$ I just wanted to point out where the issue lies. You don't have to (and probably shouldn't) use Re. What you want is probably Abs[f[l,e]] but this is for you to decide. $\endgroup$
    – halirutan
    Oct 18, 2013 at 4:26
  • $\begingroup$ Thanks a lot, I see where I got wrong. And it seems to me that ContourPlot ignores isolated solution, doesn't it? $\endgroup$
    – Knightq
    Oct 18, 2013 at 6:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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