I am trying to plot the Poincare section. Is there any other method where I get results faster? I use Table to find points at an integer multiple of \phi, making NDSolve evaluate the solution for every integer m. Can I find the points at all integer m without evaluating NDSolve every time?
time = 10000; points = Flatten[Table[
Last[Reap[NDSolve[
{34*Derivative[1][\[Theta]][t]*Cos[\[Psi][t]] +
34*Sin[\[Theta][t]]*Sin[\[Psi][t]]*
Derivative[1][\[Phi]][t] +
4*Sin[2*\[Theta][t]]*Cos[\[Psi][t]]*
Sin[2*\[Phi][t]] + Sin[\[Theta][t]]*
Sin[\[Psi][t]]*(8*Cos[2*\[Phi][t]] +
17) == 0, 2*Sin[\[Psi][t]]*
(13*Derivative[1][\[Theta]][t] +
3*Sin[2*\[Theta][t]]*Sin[2*\[Phi][t]]) ==
Sin[\[Theta][t]]*Cos[\[Psi][t]]*
(26*Derivative[1][\[Phi]][t] +
12*Cos[2*\[Phi][t]] + 13),
Cos[\[Theta][t]]*(10*Derivative[1][\[Phi]][
t] + 4*Cos[2*\[Psi][t]]*
Cos[2*\[Phi][t]] + 5) +
10*Derivative[1][\[Psi]][t] ==
(Cos[2*\[Theta][t]] + 3)*Sin[2*\[Psi][t]]*
Sin[2*\[Phi][t]], \[Phi][0] == 0,
\[Theta][0] == 15/10, \[Psi][0] == 15/10,
WhenEvent[Mod[\[Phi][t], m*Pi] == 0,
Sow[{ArcSin[Sin[\[Psi][t]]], \[Theta][t]}]]},
{\[Theta][t], \[Phi][t], \[Psi][t]}, {t, 0, time},
MaxStepSize -> 1/50]]], {m, 1000}], 2]; plot = ListPlot[points]


MaxStepSize -> 1/50? – Michael E2 May 31 '23 at 19:15MaxStepSize -> 1? – Michael E2 May 31 '23 at 19:22NDSolve[]except theWhenEvent. So you could just do one call and find whenMod[\[Phi][t], m*Pi] == 0afterwards. Alternatively, you can figure out all the data form > 1just fromm == 1by sampling every m-th reaped data point. – Michael E2 May 31 '23 at 20:15