9
$\begingroup$

Suppose we have the following system of ODEs,

torusSystem[A_, B_, Omega_][T_] := Module[{sol, Phi, Tau}, sol = NDSolve[{D[Phi[t], t] == A - B*Cos[Tau[t]] - Cos[Phi[t]], D[Tau[t], t] == Omega, Phi[0] == 0.0, Tau[0] == 0}, {Phi, Tau}, {t, 0, T}]; {Phi, Tau} /. sol[[1]]] 

There is no problem to solve this system for given A, B and Omega parameters. Let A=1.1, B=1.0, Omega=0.01. I want to ParametricPlot of curve {Phi[t],Tau[t]}, so

T = 1000; test = torusSystem[0.1, 1.0, 0.01][T]; f[t_] := {test[[1]][z] /. {z -> t}, test[[2]][z] /. {z -> t}}; ParametricPlot[f[t], {t, 0, T}, PlotRange -> All, AspectRatio -> 1] 

I obtain something like that:

enter image description here

However, the desired picture is Figure 1 in this paper i.e. enter image description here

Here the circle at the center of picture is not important.

I understand that the problem is in periodicity of variables Phi and Tau. I have tried to implement WhenEvent:

WhenEvent[Phi[t]>2*Pi, Phi[t]->Phi[t]-2*Pi] 

and the similar condition for Tau, but I still cannot reproduce the desired picture. Can anybody help with it?

For me it seems that the question is about how to simulate dynamics on torus and plot its "UV map"

$\endgroup$
2
  • $\begingroup$ Interesting problem.Please post the original paper about the desired picture. $\endgroup$ Commented Jun 26 at 23:12
  • $\begingroup$ @cvgmt , see the paper: web.archive.org/web/20180324151720id_/http://www.ams.org:80/… (figure 1). At the moment I think that this figure is just a sketch, not a numerically verified picture $\endgroup$ Commented Jun 26 at 23:25

2 Answers 2

17
$\begingroup$

I don't think your system produces the desired image, but I think you want to use Mod[f[t], period, phaseOffset]:

enter image description here

It may be of interest to visualize the trajectory on a torus:

With[{torus = {Cos[Tau[t]] (1 + .3 Cos[Phi[t]]), Sin[Tau[t]] (1 + .3 Cos[Phi[t]]), .3 Sin[Phi[t]]}}, Show[ ParametricPlot3D[torus , {Phi[t], 0, 2 Pi}, {Tau[t], 0, 2 Pi}, PlotStyle -> Opacity[0.3], Mesh -> None], Block[{Phi, Tau}, {Phi, Tau} = test; ParametricPlot3D[torus, {t, 0, T} , PlotPoints -> 200 , ColorFunction -> (Append[ColorData["TemperatureMap"][#4], 0.7] &) ] /. Line -> Tube ], Graphics3D[{ (* mark endpoints of computed trajectory *) Darker@Green, Sphere[torus /. t -> 0 /. Thread[{Phi, Tau} -> test], 0.03] , Black, Sphere[torus /. t -> T /. Thread[{Phi, Tau} -> test], 0.03]}] ]] 

The trajectory seems to converge to a stable orbit. The overlapping curves lead to funny colors (z-fighting).


Update

The following gives a phase portrait for the OP's parameters, although instead of a circle, one gets closer to a diamond shape:

StreamPlot[{.01, 0.1 - Cos[Phi[t]] - Cos[Tau[t]]} , {Tau[t], -Pi, Pi}, {Phi[t], -Pi, Pi} , StreamPoints -> {{ {{0, 0}, Red}, {Reverse@Through[test[20]], Red}, {Mod[Reverse@Through[test[300]], 2 Pi, -Pi], Red}, {Mod[Reverse@Through[test[305]], 2 Pi, -Pi], Red}, {-Reverse@Through[test[20]], Red}, {-Mod[Reverse@Through[test[300]], 2 Pi, -Pi], Red}, {-Mod[Reverse@Through[test[305]], 2 Pi, -Pi], Red}, Automatic}}, StreamColorFunction -> None, PlotRange -> Pi] 

phase portrait

$\endgroup$
5
  • $\begingroup$ Code for this phase portrait found at pastebin.com/raw/LFgzBRzL $\endgroup$ Commented Jun 26 at 23:34
  • 1
    $\begingroup$ @Moo I didn't include the OP's initializations in my answer. The error message should not include test if test has been initialized with test = torusSystem[0.1, 1.0, 0.01][T]; also, torusSystem[] must be defined, or the error message will complain about it. (In the comment, the OP's code is altered slightly, so I had to include it.) $\endgroup$ Commented Jun 27 at 13:25
  • 1
    $\begingroup$ @MichaelE2 Very nice 3D plot with tours (+1). $\endgroup$ Commented Jun 29 at 3:50
  • $\begingroup$ @MichaelE2 Thank you so much! From analytical point of view, it happens that the diamond shape is correct. It seems that figure from the original papers is not so correct $\endgroup$ Commented Jul 2 at 7:38
  • 1
    $\begingroup$ @Moo I have fixed typos $\endgroup$ Commented Jul 2 at 8:00
12
$\begingroup$

We have already discussed this issue once. To reproduce Figure 1 you need to read the paper carefully. First, we will reproduce the stairs as follows

torusSystem[A_, B_, Omega_][T_] := Module[{sol, Phi, Tau}, sol = NDSolveValue[{D[Phi[t], t] == A - B Cos[Tau[t]] - Cos[Phi[t]], D[Tau[t], t] == Omega, Phi[0] == 0, Tau[0] == 0}, {Phi[t], Tau[t]}, {t, 0, T}]; sol]; test = torusSystem[1.1, 1., #][500] & /@ Table[1/n, {n, 20, 40, 1}]; ParametricPlot[test, {t, 0, 500}, PlotRange -> All, AspectRatio -> 1, Frame -> True] 

Figure 1

This figure shows in which specific parameter area you need to search. We use StreamPlot to reproduce Figure 1.

StreamPlot[{.05, 1.1 - Cos[x] - Cos[y]}, {x, 3, 10}, {y, 10, 15}, StreamColorFunction -> "Rainbow", StreamPoints -> Fine] 

Figure 2

$\endgroup$
7
  • 1
    $\begingroup$ (+1)Great, that is we are looking for! $\endgroup$ Commented Jun 29 at 1:50
  • 2
    $\begingroup$ @cvgmt Thank you. Perhaps you remember that we have already discussed this problem? $\endgroup$ Commented Jun 29 at 3:47
  • 1
    $\begingroup$ @AlexTrounev It might be helpful to provide a link to the previous discussion if possible. This could then be seen as an extension of that discussion, and the reference useful for future users. $\endgroup$ Commented Jun 30 at 0:37
  • $\begingroup$ @AlexTrounev for me it seems that I could indees asked the very similar question long time ago. It was definitely about the phase dynamics $\endgroup$ Commented Jul 2 at 7:40
  • 1
    $\begingroup$ @AlexTrounev do not undestand you point about "parameter area". Indeed, there are specific domains in $(B,A)$-plane where the desired "jumping" (or canard solution) can appear. However, when you simulate stairs, you have explicitly set $A=1.1$ and $B=1.0$ inside NDSolve but then you vary $A$ $\endgroup$ Commented Jul 2 at 8:26

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.