« View all new features in Mathematica 9  previous  |  next 
New in Mathematica 9Advanced Hybrid and Differential Algebraic Equations

Poincaré Sections 

Compute Poincaré sections using NDSolve with WhenEvent.

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]:=
Click for copyable input
X

The strange attractor for these parameter values can be visualized using ListPlot.

In[2]:=
Click for copyable input
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]:=
Click for copyable input
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.

In[4]:=
Click for copyable input
X

Apply the function to several initial conditions.

In[5]:=
Click for copyable input
X
Out[5]=