Poincaré Section Explorer
High-resolution Poincaré sections for forced and autonomous nonlinear systems — adaptive Tsit5 integrator running in a dedicated Web Worker.
What is a Poincaré section?
A Poincaré section reduces a continuous-time flow to a discrete map by sampling the trajectory whenever it returns to a chosen lower-dimensional surface in phase space. It exposes the topology of attractors that look like a tangled mess in the time series: a limit cycle becomes a single dot, a period-\(k\) orbit becomes \(k\) dots, an invariant torus becomes a closed curve, and a strange attractor reveals a fractal Cantor-like cross-section. For Hamiltonian systems with two degrees of freedom, the section is also the cleanest visualisation of KAM theory: integrable systems give perfectly nested invariant curves, while chaotic ones break those tori into resonance islands and chaotic seas.
Three section modes
- Stroboscopic (forced systems): sample \((x,\dot x)\) at \(t_k = t_0 + k\,T_f\), where \(T_f = 2\pi/\omega\) is the forcing period. The Poincaré map is the time-\(T_f\) flow.
- Hyperplane crossing (autonomous systems): sample whenever \(g(\mathbf{y}) = y_i - c = 0\) is crossed in a chosen direction (\(\dot y_i > 0\) for upward, \(< 0\) for downward, or both). The crossing time is found by Brent root-finding on a quartic dense-output interpolant of the integrator step, giving sub-step accuracy without sub-step integration.
- Discrete iteration (already-discrete maps): every iterate is itself a section point — no integration or root-finding required. The Hénon, Ikeda, and Chirikov standard maps fall here.
Solver: Tsit5 (Tsitouras 5(4))
Adaptive 5th-order explicit Runge–Kutta with 4th-order embedded error estimator (Tsitouras, 2011). Seven stages with First-Same-As-Last (FSAL): the last derivative of an accepted step is reused as the first of the next, so the effective cost is six function evaluations per accepted step. Step size is controlled by a PI controller on the normalised error \(\|y_{\text{err}}\|/\bigl(\text{atol} + \text{rtol}\,\|y\|\bigr) \le 1\). Tight tolerances (\(\text{rtol} = 10^{-9}\), \(\text{atol} = 10^{-12}\)) keep section points sharp even after \(10^5\) crossings.
Why a Web Worker?
Computing \(10^5\)–\(10^6\) section points means integrating tens to hundreds of millions of derivative evaluations. Doing that on the UI thread would freeze the page for many seconds. The integrator runs in a Worker and streams batches of section points back to the main thread for incremental rendering, so you can pan, change axes, or stop the run at any time.
Example systems
Forced 2D oscillators (stroboscopic section)
- Duffing: \(\ddot{x}+\delta\dot x+\alpha x+\beta x^3=\gamma\cos(\omega t)\). With \(\delta=0.3,\alpha=-1,\beta=1,\omega=1.2\), increasing \(\gamma\) traces a period-doubling cascade culminating in a strange attractor near \(\gamma=0.5\). The Ueda chaotic case (\(\alpha=0,\gamma=7.5,\omega=1\)) shows the iconic asymmetric folded structure.
- Driven damped pendulum: \(\ddot\theta+\delta\dot\theta+\sin\theta=A\cos(\omega t)\). Stroboscopic section in \((\theta\bmod 2\pi,\dot\theta)\). Chaotic for \(A\approx 1.07,\omega=2/3,\delta=0.5\), with the strange attractor wrapping around the cylinder.
Autonomous flows (hyperplane section)
- Lorenz: \(\dot x=\sigma(y-x),\dot y=x(\rho-z)-y,\dot z=xy-\beta z\). Start from \((1,1,1)\) at \(\sigma=10,\rho=28,\beta=8/3\) and take the upward hyperplane section at \(z=\rho-1=27\) — the height of the unstable equilibria \(C_\pm\). The \((x,y)\) crossings reveal the two intertwined wings of the strange attractor in cross-section. (Lorenz's classic 1D cusp/tent return map is a different construction, built from successive maxima of \(z(t)\) rather than from a hyperplane section.)
- Hénon–Heiles: \(H=\dfrac{1}{2}(p_x^2+p_y^2)+\dfrac{1}{2}(x^2+y^2)+x^2y-\dfrac{1}{3}y^3\). A 2-DOF Hamiltonian originally proposed (1964) as a model of stellar motion in a galactic potential. Bounded motion exists only for \(E\le1/6\); the section at \(x=0,p_x>0\) shows nested tori at low energy (\(E=1/12\)), mixed phase space at \(E=1/8\), and global chaos at \(E=1/6\).
- Double pendulum (equal mass and length): a textbook example of conservative chaos. Section forced to \(\theta_1=0,\dot\theta_1>0\); plot \((\theta_2,\dot\theta_2)\). At high energy the section fills ergodically — KAM tori survive only for small swings.
- Swinging Atwood's machine: \(H=\dfrac{p_r^2}{2(\mu+1)}+\dfrac{p_\theta^2}{2r^2}+r(\mu-\cos\theta)\). Mass \(M\) hangs vertically while mass \(m\) swings as a pendulum of length \(r\); \(\mu=M/m\). Tufillaro (1984) proved the system is integrable at \(\mu=3\) — the Poincaré portrait is then perfectly nested invariant curves (Liouville–Arnold tori) with no visible chaos. For other \(\mu\) the phase space is mixed or chaotic.
Discrete maps (every iterate is a section point)
- Chirikov standard map: \(\theta_{n+1}=\theta_n+p_{n+1},\;p_{n+1}=p_n+K\sin\theta_n\) on the torus \([-\pi,\pi)^2\). Area-preserving for all \(K\). The golden-mean torus breaks at \(K\approx0.9716\) — Greene's residue criterion. \(K=1.5\) shows the canonical mixed phase space; \(K=5\) is fully ergodic.
- Hénon map: \(x_{n+1}=1-ax_n^2+y_n,\;y_{n+1}=bx_n\). Dissipative for \(|b|<1\) — the classical strange attractor at \((a,b)=(1.4,0.3)\) has fractal dimension \(\approx1.26\) and Lyapunov exponent \(\lambda\approx0.42\). Area-preserving at \(|b|=1\), giving nested KAM tori with island chains.
- Ikeda map: \(t_n=c_1-\dfrac{c_2}{1+x_n^2+y_n^2},\;(x_{n+1},y_{n+1})=(1+u(x_n\cos t_n-y_n\sin t_n),\,u(x_n\sin t_n+y_n\cos t_n))\). Originally derived for a laser pulse circulating in a ring cavity (Ikeda 1979). Produces the iconic folded-crescent strange attractor at \(u=0.9,c_1=0.4,c_2=6\); \(|\det J|=u^2\), so it is dissipative for \(u<1\) and area-preserving at \(u=1\).
System
Parameters
θ wrapped to [-π, π) on the section.
ICs are auto-generated on the energy shell at \(x=0,\,p_x>0\). Bounded motion requires \(E\le 1/6\). Section: \(x=0\), upward. Plot \((y, p_y)\).
Section forced to \(\theta_1=0,\;\dot\theta_1>0\); plot \((\theta_2,\dot\theta_2)\).
ICs auto-generated on the energy shell at \(\theta=0,\,p_\theta>0\). Bounded motion needs \(\mu>1\). Integrable at \(\mu=3\) (Tufillaro). Section: \(\theta=0\), upward. Plot \((r, p_r)\). \(g=m=1\).
\(K\!\approx\!0.9716\) (golden-mean breakup) is the critical value. Try \(K=0.5\) (mostly tori), \(K=1.5\) (chaotic sea + islands), \(K=5\) (fully ergodic).
Dissipative for \(|b|<1\) (one IC fills the strange attractor). Area-preserving for \(|b|=1\) — use many ICs to reveal KAM tori and island chains.
Optical-cavity map; classic strange attractor at \(u=0.9,\,c_1=0.4,\,c_2=6\). Area-preserving at \(u=1\). \(|\det J|=u^2\).
Section
Run settings
Cite this tool
Kapita, S. (2026). Poincaré Section Explorer. Math Tools. https://shelvean.github.io/math-tools/poincare.html
Kapita, Shelvean. "Poincaré Section Explorer." Math Tools, 2026, shelvean.github.io/math-tools/poincare.html.
@online{kapita2026poincare,
author = {Shelvean Kapita},
title = {{Poincaré Section Explorer}},
year = {2026},
organization = {Math Tools},
url = {https://shelvean.github.io/math-tools/poincare.html}
}