5
$\begingroup$

I have a ContourPlot3D that is a bit noisy on one side of the plot. I have tried MaxRecursion but actually it is of no use, PlotPoints help to some degree but even with a higher PlotPoints it is still there. You can see some dots and unwanted lines on the upper right portion of the plot. Any suggestions on how to resolve this? As a side question, is there a way to fix the viewing angle of the plot so that I don't have to align the plot every time?

ep = 10^-2;
m0 = 500;
g = 3;
F[u_, z_] := 1 - (m0 Exp[-g u]) z^4
intIndefinite[u_, z_] := Evaluate@Integrate[1/F[u, z], z]
int[u_, zz_] := Evaluate[intIndefinite[u, zz] - intIndefinite[u, ep]]
tPlane[x_, z_] := Evaluate[x - int[x, z]]
plot = ContourPlot3D[t == tPlane[x, z], {x, 0, 2}, {t, 0, 2}, {z, ep, 0.9}, LabelStyle -> Directive[Black, 14], Mesh -> 5, ContourStyle -> Directive[Cyan, Opacity[0.7]], Lighting -> Automatic, AxesLabel -> {"x", "t ", "z "}, AxesEdge -> {{-1, -1}, {-1, -1}, Automatic}, PlotRange -> {Automatic, Automatic, {ep, 0.9}}, PlotPoints -> 30]

Image

$\endgroup$
6
  • $\begingroup$ Why you used ep = 10^-2;? Cannot it be equal 0? $\endgroup$ Nov 18, 2023 at 11:30
  • $\begingroup$ @azerbajdzan The integral blows up at $z=0$, so $ep$ is just a cutoff to prevent that. $\endgroup$
    – mathemania
    Nov 18, 2023 at 11:35
  • $\begingroup$ No, it is not. z=0 is no problem, integral diverges at the curve you can see in the plot in my answer. $\endgroup$ Nov 18, 2023 at 11:38
  • $\begingroup$ @azerbajdzan Does that really affect the behavior near the edges where the noise occurs? $\endgroup$
    – mathemania
    Nov 18, 2023 at 12:24
  • $\begingroup$ It does not, but it simplifies the function expression. $\endgroup$ Nov 18, 2023 at 12:27

2 Answers 2

3
$\begingroup$

These artefacts appear near the curve when ArcTanh and ArcCoth functions become non-real which is a discontinuity. It is around x=1 when both ArcTanh[x] and ArcCoth[x] become infinity. So I think it would not be easy to get rid of the artifacts near this discontinuity.

The function I plotted is yours tPlane[x, z] I just used real part Re on it.

Plot3D[Re[
  x + 1/(2 Sqrt[2] 5^(3/4)) E^(
    3 x/4) (ArcCot[10 Sqrt[2] 5^(1/4) E^(3 x/4)] + 
      ArcCoth[10 Sqrt[2] 5^(1/4) E^(3 x/4)] - 
      ArcTan[Sqrt[2] 5^(3/4) E^(-3 x/4) z] - 
      ArcTanh[Sqrt[2] 5^(3/4) E^(-3 x/4) z])], {x, -6, 6}, {z, -6, 6},
  AxesLabel -> {x, z, t}, PlotPoints -> 100, BoxRatios -> {1, 1, 1}]

enter image description here

Update:

With ep=0 we have:

Plot3D[If[E^(3 x) > 500 z^4, 
  x - (E^(3 x/
     4) (ArcTan[Sqrt[2] 5^(3/4) E^(-3 x/4) z] + 
      ArcTanh[Sqrt[2] 5^(3/4) E^(-3 x/4) z]))/(
   2 Sqrt[2] 5^(3/4)), -10], {x, -10, 10}, {z, -10, 10}, 
 PlotPoints -> 200, BoxRatios -> {1, 1, 1}, 
 PlotRange -> {{-5, 10}, {-10, 10}, {-9, 20}}, 
 AxesLabel -> {"x", "z", "t"}, WorkingPrecision -> 100, 
 Method -> {"RotationControl" -> "ArcBall"}, 
 Exclusions -> {z == -(E^(3 x/4)/(Sqrt[2] 5^(3/4))), 
   z == E^(3 x/4)/(Sqrt[2] 5^(3/4))}, 
 ExclusionsStyle -> {None, Directive[Thick, Blue]}]

enter image description here

I do not have a quick answer how to get rid of the gray area, but with editing the full-form of the plot it is possible.

$\endgroup$
1
  • $\begingroup$ It seems like there are several surfaces for the solution, is it possible to just pick the surface corresponding to my plot? I remember there is a thread talking about a similar situation but I can't remember where, maybe that will eliminate the problem. $\endgroup$
    – mathemania
    Nov 18, 2023 at 7:46
1
$\begingroup$

The distortions almost vanish if you plot from {t, 0.5, 2}. I know, this cuts off a small stripe at the right side of the plot, but I didn't find another way.

I also added a Viewpoint - option to avoid manual alignment.

ContourPlot3D[
 t == tPlane[x, z], {x, 0, 2}, {t, 0.5, 2}, {z, ep, 0.9},
 LabelStyle -> Directive[Black, 14],
 Mesh -> 5,
 ContourStyle -> Directive[Cyan, Opacity[0.7]],
 Lighting -> Automatic, 
 AxesLabel -> {"x", "t ", "z "},
 AxesEdge -> {{-1, -1}, {-1, -1}, Automatic},
 PlotRange -> {Automatic, Automatic, {ep, 0.9}},
 PlotPoints -> 10,
 ViewPoint -> {-5, -2.4, 2.}]

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ That may seem an easy fix, but I need the range for $t$ in my code. The viewpoint option works though. $\endgroup$
    – mathemania
    Nov 17, 2023 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.