1
$\begingroup$

This question already has an answer here:

I have line on the 2d plane, given by say f(t). I want to plot it in the torus by plotting Mod[f(t),2\[Pi]]. However, there are some sharp horizontal and vertical lines that I do not want. Is there a way to do this?

I get the line by solving a complicated ODE, thus I give below a trial code that reproduces the effect that I do not want.

s = NDSolve[{Derivative[1][x][t] == -3 (x[t] - y[t]), Derivative[1][y][t] == -x[t] z[t] + 26.5 x[t] - y[t], Derivative[1][z][t] == x[t] y[t] - z[t], x[0] == z[0] == 0, y[0] == 1}, {x, y, z}, {t, 0, 1}, MaxSteps -> \[Infinity]]; 
ParametricPlot[Evaluate[Mod[{x[t], y[t]}, 3] /. s], {t, 0, 1}]

In the worst case I can take a discrete sample and do a list plot, but is there any elegant solution?

Answered

I finally have an answer. The following simple change removes the unwanted lines.

s = NDSolve[{Derivative[1][x][t] == -3 (x[t] - y[t]), Derivative[1][y][t] == -x[t] z[t] + 26.5 x[t] - y[t], Derivative[1][z][t] == x[t] y[t] - z[t], x[0] == z[0] == 0, y[0] == 1}, {x, y, z}, {t, 0, 1}, MaxSteps -> \[Infinity]]; 
f[t_]={x[t], y[t]}/.s;
ParametricPlot[Mod[f[t], 3], {t, 0, 1}]
$\endgroup$

marked as duplicate by corey979, MarcoB, halirutan Jun 18 '18 at 3:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Thanks. However, I want something else. I hope, it is now clear what I need. $\endgroup$ – Himalaya Senapati Jun 18 '18 at 8:30

Browse other questions tagged or ask your own question.