Mathematica - Countour plot problem

  • Topic: Mathematica 
  • Thread starter asynja
  • Start date
  • Tags Tags
    Mathematica Plot
1 reply · 2K views · last reply
asynja
Messages
15
Reaction score
0
Hello! I'm trying to plot some eigenfunctions (for a semicircle) in Mathematica. Functions are of the following form:
$$g_{ms}=J_{2m+1}(y_{ms}x) sin ((2m+1)\varphi)$$
For example, for m=0 and s=1 it should look like what I drew in the attached file "Snapshot". Well, I don't have much experience with Mathematica and the "code" I wrote so far doesn't give me the right result.
Here's my try:
Matlab:
m = 0;
s = 1;
dat = Table[{x = RandomReal[{-1, 1}], y = RandomReal[{0, 1}],
    BesselJ[(2*m + 1), BesselJZero[m, s]*x]*
     Sin[(2*m + 1)*ArcTan[x, y]]}, {1000}];
ListContourPlot[dat]
The plot I get is in the attached file "Wrongplot". What am I doing wrong?
 
Attachments
  • Hand-drawn sketch of nested closed contour curves forming a dome shape over the upper half of the x-y axes, with the x-axis marked -1 and 1 at its ends and the y-axis marked 1 at its top.
    Snapshot.jpg
    8.5 KB · Views: 529
  • Filled contour plot over x from -1 to 1 and y from 0 to 1, with bands shaded blue on the left and orange-to-cream on the right, separated by a near-vertical boundary at x = 0.
    WrongPlot.png
    6 KB · Views: 639
Last edited by a moderator:
It seems like you might be using the wrong coordinates. Could this be the polar form?
Where you have x in ##g_{ms} = J_{2m+1}(y_{ms} x) \sin ((2m+1)\varphi)##, you might try using r = ##\sqrt(x^2+y^2)##.