Mathematica Plot Real Portion (Contour Plot)

In summary, the conversation discusses an issue with plotting the real component of a function in Mathematica. The code provided in the conversation does not explicitly solve for the function, making it difficult to plot the real component. The conversation also provides a simpler example to illustrate the issue and asks for help in finding a solution.
  • #1
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
  • #2
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?
 
  • #3
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.
 
  • #4
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!
 
  • #5
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?
 
  • #6
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

  • correctplot.pdf
    25 KB · Views: 335
  • incorrectplot.pdf
    15.9 KB · Views: 343

1. What is "Mathematica Plot Real Portion (Contour Plot)"?

"Mathematica Plot Real Portion (Contour Plot)" is a feature in the Mathematica software that allows for the visualization of the real portion of a complex-valued function.

2. How is a contour plot different from a regular plot?

A contour plot displays the relationship between two variables through the use of contour lines, while a regular plot shows the relationship between two variables through a line or scatterplot.

3. What types of functions can be plotted using "Mathematica Plot Real Portion (Contour Plot)"?

Any complex-valued function can be plotted using "Mathematica Plot Real Portion (Contour Plot)". This includes trigonometric functions, exponential functions, and polynomials.

4. Can multiple functions be plotted on the same contour plot?

Yes, multiple functions can be plotted on the same contour plot. This can be useful for comparing and contrasting different functions or for visualizing the intersection points of multiple equations.

5. How can I customize the appearance of a contour plot?

There are various options for customizing the appearance of a contour plot, such as changing the color scheme, adding labels and titles, adjusting the contour line spacing, and adding a legend. These options can be accessed through the "Plot Options" menu in Mathematica.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
247
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
212
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
887
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
533
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
737
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
5K
Back
Top