Mathematica Plot Real Portion (Contour Plot)

Click For Summary

Discussion Overview

The discussion revolves around plotting the real part of a variable, specifically ##\sigma##, in Mathematica using contour plots. Participants explore the challenges of visualizing complex solutions and seek methods to extract the real component from implicit equations.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested, Mathematical reasoning

Main Points Raised

  • One participant presents a Mathematica code snippet for a contour plot involving ##\sigma## and expresses a desire to plot ##Re(\sigma)## instead of ##\sigma##.
  • Another participant questions the need to extract the real part, suggesting that ##\sigma## should be real as a plotting variable.
  • A later reply clarifies that while some ##\sigma## values may be real, others could have non-zero imaginary components, complicating the plot.
  • One participant seeks a numerical solution for ##\sigma## as a function of ##\epsilon## for various integer values of ##n##.
  • Another participant simplifies the problem to plotting ##Re(y)## from a quadratic equation and discusses the need to solve for ##y## explicitly to obtain the real part.
  • The same participant expresses uncertainty about how to implicitly plot the real component of ##y## for given ##x## values in more complex equations.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the nature of ##\sigma## or the best method to plot its real part. Multiple competing views on the necessity and method of extracting the real component remain unresolved.

Contextual Notes

Participants express limitations in their understanding of the relationship between ##\sigma## and ##\epsilon##, as well as the challenges posed by complex solutions in implicit equations.

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

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 6 ·
Replies
6
Views
7K