Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Surface plotting problem in Mathematica

  1. Apr 24, 2010 #1

    AzO

    User Avatar

    Hi!

    I would like to plot a so called breathersurface in Mathematica, but it gives a really bad picture, which I do not really want to use in my thesis:
    http://www.cs.elte.hu/~azo/Breathersurface.JPG" [Broken]
    As you can see, it has holes in it, while it should not have. I used here PlotPoints->{50,50}, but after this I tried PlotPoints->{400,400}... My computer almost died during the calculations, but after 4 hours of processing :) it gave me a similar picture, with holes..
    Than I have got the idea to tell Mathematica to use << Version5`Graphics`. I have got a perfect picture:
    http://www.cs.elte.hu/~azo/BreathersurfaceOld.JPG" [Broken]
    So I do not understand why is this so. I really would like to use Version7 Graphics, because until now every figure was made with that, and it is nicer :).

    AzO
     
    Last edited by a moderator: May 4, 2017
  2. jcsd
  3. Apr 24, 2010 #2
    Hello,
    Can you provide us with your notebook ? So that we can try and play with it ? Is it a ContourPlot3d[] ? :smile:
     
  4. Apr 24, 2010 #3

    AzO

    User Avatar

    Of course!

    http://www.cs.elte.hu/~azo/BreathersurfacePhysicsforum.nb" [Broken]

    No, it is a ParamterciPlot3D[].
     
    Last edited by a moderator: May 4, 2017
  5. Apr 24, 2010 #4
    Sorry, I had to go somewhere :smile:
    I think there's a problem with spurious imaginary part in the final result. Taking a Chop[] or a Re[] of r12 improve the situation a bit but there's still holes. Using MaxRecursion improve a little bit more the situation…
    Basically, if your final result has a remaining imaginary part it will not be plotted. Although this is not the only reason since taking the Re[] of r12 do not solve completely the issue.
    I tried to find info on the possible value of the Method option passed to ParametricPlot3D to no avail…
    It's frustrating that the Version5`Graphics` handles it like a charm…
     
  6. Apr 24, 2010 #5
    Hi. I think you're running into branch-cut problems with the complex arctan function. Below I define teta1 in it's logarithmic form:

    teta1[x_, t_, b_] := I*Log[(I + Exp[khi[x, t, b]])/(I - Exp[khi[x, t, b]])];

    split up the plot on either side of zero then combine:

    pp1 = ParametricPlot3D[
    Evaluate[Re[r12[x, t, (3 - 4*I)/5, (3 + 4*I)/5]]],
    {t, 0.001, 5*Pi}, {x, -10, 10}, ImageSize -> {600, 600},
    PlotRange -> {{-4, 4}, {-4, 4}, {-5, 5}}]
    pp2 = ParametricPlot3D[
    Evaluate[Re[r12[x, t, (3 - 4*I)/5, (3 + 4*I)/5]]],
    {t, -0.001, -5*Pi}, {x, -10, 10}, ImageSize -> {600, 600},
    PlotRange -> {{-4, 4}, {-4, 4}, {-5, 5}}]
    Show[{pp1, pp2}]

    probably needs some more work to get it just right. Interesting phenomenon. Thanks.:)
     
  7. Apr 25, 2010 #6

    AzO

    User Avatar

    Jackmell!! You are really good!
    I should have thought to the branch cut problem myself. Now that you've said it, it looked obvious. Your solution works perfectly!
    Thank you very much! :)))
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook