For a periodically driven planar example, the Poincaré section can be obtained by sampling at regular time intervals. Sampling can be done using WhenEvent, with an action having Sow with an enclosing Reap around the call to NDSolve.
Solve the Duffing equation and save samples at every period of the driving force, .
In[1]:=
X
The strange attractor for these parameter values can be visualized using ListPlot.
In[2]:=
X
Out[2]=
For higher-dimensional systems, the Poincaré section in effect samples on a slice across the phase space. This typically requires an event that depends on the solution. An example of this is the Arnold-Beltrami-Childress (ABC) flow that is used to model chaos in laminar flows of the three-dimensional Euler equations.
In[3]:=
X
The Poincaré section will be computed by taking samples as the solution crosses the plane. To get a full picture of the space, it will be necessary to use several different initial conditions.