I used NDSolve and ParametricPlot3D to plot geodesics on a misshapen "torus", like so: enter image description here

I wanted to treat it as a surface of revolution, and then simply use Mod[x[t],2Pi] to have each geodesic loop back onto this single portion of the surface. However, as you can see, there are some strange artifacts on graph when I use Mod. If I treat the surface like normal, then there are no artifacts, so I know it's not part of the calculation.

How should I go about getting these to disappear? Ideally, I'd like to plot geodesics for large times, and watch the path. However every time the path leaves one end, it produces one of these artifacts, which clutters up the picture considerably.

  • $\begingroup$ Could you give an example of the code you use to produce this image? My guess is that the path you make when you use Modwill just simply join the start and end points with a straight line, hence giving rise to the artefacts. Most likely you will need to plot each segment separately. $\endgroup$ – Dunlop Oct 31 '16 at 6:34
  • $\begingroup$ Looks like a job for Exclusions -> Sin[2t] == 0. $\endgroup$ – user484 Oct 31 '16 at 6:38
  • $\begingroup$ Here is the code for the path (sorry, I accidentally posted the line of code for the surface before): ParametricPlot3D[ Evaluate[{Mod[xx[x[t], \[Theta][t]], 2 \[Pi]], yy[x[t], \[Theta][t]], zz[x[t], \[Theta][t]]} /. soln], {t, 0, 100}] I just added Exclusions -> {Sin[2 t] == 0} to the ParametricPlot3d, but it didn't do anything. $\endgroup$ – Patch Oct 31 '16 at 6:44
  • $\begingroup$ xx[x[t], \[Theta][t]], etc are the x, y, and z component functions. Each depends on the x and theta parameters, which were solved for by NDSolve. $\endgroup$ – Patch Oct 31 '16 at 6:45
  • $\begingroup$ @Patch I would try to see if you get the same behaviour with systems where you know the geodesics and you have analytical equations such as: Show[RevolutionPlot3D[{2 + Sin[t], t}, {t, 0, 2 \[Pi]}, PlotStyle -> White], ParametricPlot3D[{2 + Sin[t], 0, Mod[t, 2 \[Pi]]}, {t, 0, 4 \[Pi]}, PlotStyle -> Red]] For this example I don't get the straight lines? Is this similar enough to what you did based on your numerical solution? $\endgroup$ – Dunlop Oct 31 '16 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.