Poincaré Sections
Reducing continuous flow to a discrete map.
A Poincaré section (or return map) reduces a continuous -dimensional dynamical system into an -dimensional discrete map by intersecting the trajectory with a transversal hyperplane.
For a 3D system like the Chua circuit, the Poincaré section is a 2D plot. This is an excellent way to visualize the internal topological structure of a strange attractor.
Computing the Section
The poincare_section() function interpolates the exact crossing points where the trajectory pierces a defined plane in a specific direction.
from hidden_attractors.analysis import poincare_section
# Define a plane equation: a*x + b*y + c*z + d = 0
# For example, the plane x = 0 (which is 1*x + 0*y + 0*z + 0 = 0)
plane_normal = [1.0, 0.0, 0.0]
plane_point = [0.0, 0.0, 0.0]
# Compute the intersections
# 'direction=1' means we only record crossings where the trajectory
# passes through the plane in the direction of the normal vector.
crossings = poincare_section(
trajectory=x,
normal=plane_normal,
point=plane_point,
direction=1
)
print(f"Found {len(crossings)} piercings.")
Plotting
Once you have the crossings array, you can plot it in 2D. Because we intersected with , the relevant coordinates on the plane are and .
import matplotlib.pyplot as plt
# crossings[:, 1] is Y, crossings[:, 2] is Z
plt.scatter(crossings[:, 1], crossings[:, 2], s=1, color='black', alpha=0.5)
plt.title("Poincaré Section at x=0")
plt.xlabel("y")
plt.ylabel("z")
plt.show()
Interpretation
- A few discrete points: The system is a periodic limit cycle. (e.g., 1 point = period-1 cycle, 2 points = period-2 cycle).
- A closed curve: The system is quasi-periodic (motion on a torus).
- A fractal “dust” or folded sheets: The system is chaotic. The Poincaré section will reveal the stretching and folding mechanism of the strange attractor.