Mathematica Plot Real Portion (Contour Plot)

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 2K views
member 428835
Hi PF!

In Mathematica and given the code below, I am trying to the real part of ##\sigma##, ##Re(\sigma)##, in stead of simply ##\sigma##. Any help would be awesome! Here's what I have:
Code:
n = 3;
ContourPlot[(\[Sigma]^2 -
      2 (n - 1) (2 n + 1) \[Epsilon] \[Sigma] + (n - 1) n (n + 2)) ((
      Sqrt[\[Sigma]/\[Epsilon]]
        BesselJ[n + 1/2, Sqrt[\[Sigma]/\[Epsilon]]])/
      BesselJ[n + 3/2, Sqrt[\[Sigma]/\[Epsilon]]] - 2) +
   4 (n - 1)^2 (n + 1) \[Epsilon] \[Sigma] == 0, {\[Epsilon], 0,
  1.5}, {\[Sigma], 0, 7}]
 
Last edited by a moderator:
Physics news on Phys.org
If no one knows this, does anyone know how I can get a numerical solution for sigma as a function of epsilon values for integers n=2,3,4,5,6?
 
joshmccraney said:
In Mathematica and given the code below, I am trying to the real part of ##\sigma##, ##Re(\sigma)##, in stead of simply ##\sigma##.
I don't understand what you mean. σ is one of the plotting variable, so I don't see why ot wouldn't be real.
 
DrClaude said:
I don't understand what you mean. σ is one of the plotting variable, so I don't see why ot wouldn't be real.
For all ##\epsilon\in(0,1.5)## there are associated ##\sigma## values, some of which have non-zero imaginary components. Something like ##y=1+\sqrt{x+1}:x\in(-2,2)##. I would like to plot the real component of ##y## for listed values of ##x##, but obviously for the more difficult problem in post 1 (as opposed to this toy problem).

Thanks for taking an interest!
 
Sorry, but I'm still having problems understanding. Would you mind explaining it in mathematical terms first? What is the relation between σ and ε and what is the function you want to plot?
 
Sorry for being unclear. I'll reduce this problem to a much simpler one, which I think will make much more sense, and if you can answer it then you've answered my initial question. Consider the problem
$$ y^2 - x y + 1 = 0$$

I am trying to plot ##Re(y)## given a set of ##x## values in ##[0,1.5]##. One way to do this is use the quadratic formula and explicitly plot $$Re(y) = Re\left(\frac{x\pm\sqrt{x^2-4}}{2}\right)$$ This is shown in the attached pdf as "correctplot". Notice the linear region from the origin corresponds to solutions of ##y## whose imaginary components are non-zero.

The method above gives the correct plot, but I had to solve for ##y## explicitly. However, since I can't solve for the independent variable explicitly in more complicated equations (such as that in post 1), I am unsure how to implicitly plot the real component of ##y## for given ##x## values. The attached pdf "incorrectplot" plots ##y^2 - x y + 1 = 0## via ContourPlot. Notice the linear portion is not shown.

Any idea how to plot ##Re(y)## implicitly for any value of ##x##?
 

Attachments