Tutorial · Poincaré sections & return maps
Poincaré sections & return maps¶
A scalar return plot can sometimes reveal an approximately one-dimensional map — a curve relating successive observed values, \(v_{n+1} \approx F(v_n)\). This tutorial is a two-step construction: first record only where the flow pierces a surface (dropping one dimension and turning the flow into a discrete map), then the return map that reads the surviving dynamics off a recurring scalar. We do it on the Rössler flow, then reproduce Lorenz's 1963 result — the \(z\)-maxima cusp — a compact view of its complicated flow.
Initial conditions and seeds are specified. The printed values illustrate a particular finite run; chaotic trajectories and crossing estimates can vary with integration settings and software versions.
1. A surface of section¶
Pick a hyperplane \(\Sigma\) in state space and record the ordered points where the trajectory crosses it, always in the same direction. That sequence is the surface of section; the rule carrying one crossing to the next is the Poincaré (first-return) map. A periodic orbit becomes a finite set of points, a torus a closed loop, a strange attractor a structured cloud one dimension lower than the flow.
poincare_section does this for a live system. We
section the Rössler flow on the plane \(y = 0\), keeping only upward
crossings:
import numpy as np
import tsdynamics as ts
ros = ts.systems.Rossler() # a=0.2, b=0.2, c=5.7 — the classic chaotic band
section = ts.analysis.poincare_section(
ros,
plane=("y", 0.0, "up"), # section y = 0, crossed with ẏ > 0
crossings=500,
skip_crossings=50,
dt=0.02,
ic=[1.0, 1.0, 1.0],
)
print(section)
# PoincareSection(crossings=500, dim=3)
section.y[:3, [0, 2]] # (x, z) at the first three crossings
# A (3, 2) array of crossing coordinates.
The plane=("y", 0.0, "up") spelling names the axis by its variables entry
and gives the direction as a word; ("y", 0.0) alone, an index (1, 0.0), or a
general (normal, offset) all work too (see the
Poincaré reference). The return value is a
PoincareSection — a Trajectory subclass carrying the full-dimensional
crossing states plus a .to_dict() / .plot surface. Because it is a
trajectory, section["x"] and ts.plot(section) work on it unchanged.
Under the hood this marches the whole attractor and refines every crossing with cubic Hermite interpolation in a single Rust engine call for supported explicit ODE kernels. This avoids a Python callback at every integration step. Other families and methods use the documented fallback.
2. The section as a discrete map¶
The same section is also a derived system you can hand to analyses supporting its stepping protocol.
.poincare() wraps the flow and presents crossing
\(n \mapsto\) crossing \(n+1\) as a DiscreteMap-shaped object:
pmap = ros.poincare("y", 0.0, direction="up")
# ...the verb builds exactly ts.derived.PoincareMap(ros, ("y", 0.0, "up")),
# and both spellings take the same plane vocabulary.
sec = pmap.run(500, transient=50, ic=[1.0, 1.0, 1.0])
len(sec.y) # 500 crossings (after discarding the first 50)
On pmap.run, transient counts crossings, not time. On
ts.analysis.poincare_section and return_map, the corresponding keyword is
skip_crossings. Check the entry point before transferring settings.
Because a PoincareMap is a map, you can use compatible discrete analyses
through it. An orbit_diagram over a control
parameter of the wrapped flow, for instance, is a genuine bifurcation diagram
of the flow — the period-doubling cascade you would otherwise have to read off
by eye:
od = ts.analysis.orbit_diagram(pmap, "c", np.linspace(3.0, 6.0, 200),
components=0, transient=100, points_per_value=80, ic=[1.0, 1.0, 1.0])
od.bifurcation_points()[:3] # where the cascade branches
3. The first-return map¶
Sectioning gives full crossing states; the return map goes one step
further and plots a single observable at successive crossings against itself —
\(v_{n+1}\) vs \(v_n\) — a candidate scalar return relation. return_map
with kind="poincare" does this on the same section:
rm = ts.analysis.return_map(ros, "x", kind="poincare",
plane=("y", 0.0), direction=+1,
n=500, dt=0.02, skip_crossings=50,
ic=[1.0, 1.0, 1.0])
len(rm) # 499 — one pair per consecutive crossing
rm.current[:3] # x_n at three successive crossings
rm.successor[:3] # x_{n+1}, shifted by one crossing
rm.current / rm.successor are the scatter arrays \((x_n, x_{n+1})\); iterate
rm for the pairs, or call rm.flat(). The result renders itself —
ts.plot(rm) builds a return_map scatter with the fixed-point diagonal
\(v_{n+1} = v_n\) drawn in, and rm.cobweb() gives the cobweb-plot variant.
Plotted (Fig 2, left) the Rössler return map is a single-valued curve with one smooth hump. This supports an approximately one-dimensional description for this observable and parameter regime; the plotted scalar projection need not be an exact, globally single-valued return law.
4. The Lorenz z-maxima cusp¶
Lorenz's original 1963 construction did not even need a section: he recorded the
successive local maxima of \(z\) and plotted each against the next. Do the same
with kind="max" (the default), on the Lorenz attractor, again settling first:
lor = ts.systems.Lorenz()
ic = lor.run(final_time=40.0, dt=0.01, ic=[1.0, 1.0, 1.0]).y[-1]
# ic ≈ [4.369, 1.717, 26.335] — a point on the attractor
zc = ts.analysis.return_map(lor, "z", kind="max", n=2000,
final_time=400.0, dt=0.01, ic=ic)
len(zc) # 532 — that many z-maxima in 400 time units
zc.values.min(), zc.values.max() # (30.976, 46.366) — the range of maxima
zc.current[:3] # array([36.488, 38.309, 43.115]) (z_n^max)
zc.successor[:3] # array([38.309, 43.115, 34.766]) (z_{n+1}^max)
Plotted (Fig 2, right), the 532 pairs fall on a sharp tent — the famous
cusp map. The cusp makes successive maxima easy to compare and suggests a useful reduced
map. A finite scatter plot does not establish a globally expanding map, the
number of fixed points, or a proof of chaos. return_map refines resolved
maxima by parabolic interpolation; reduce dt and compare the result to check
peak timing and avoid missing extrema.
Reading the result¶
- A tight, single-valued curve (both panels of Fig 2) suggests that a one-dimensional approximation may be useful. Check how the apparent curve changes with the observable, sampling and numerical accuracy before using one-dimensional map theory.
- A filled, multi-valued cloud does not resolve a scalar return law. Unobserved state variables, noise, transient data and projection overlap can all produce thickness; inspect these possibilities before drawing a dimensional conclusion.
- Extrema vs Poincaré.
kind="max"/"min"need no plane — they read peaks of one coordinate (Lorenz's construction).kind="poincare"reads the observable at section crossings and needs aplane. Use extrema when a coordinate has clean, well-separated maxima; use a section when it does not, or when you want the crossings for other analyses too.
Pitfalls¶
| Situation | What to do |
|---|---|
| First crossings look transient | Settle first (integrate, take y[-1] as ic) or pass skip_crossings= / transient= (crossings, not time). |
| Return map is a fuzzy band, not a curve | The attractor is not near-1-D on this observable — try a different component, or inspect noise, transients and projection overlap before drawing a dimensional conclusion. |
dt too coarse, peaks missed |
Reduce dt to check crossing or peak convergence. Interpolation refines resolved events but cannot recover missed crossings or maxima. |
| Section on a stiff / DDE flow | The engine fast path needs a numeric RHS and an explicit method; stiff defaults, DDEs and backend="reference" fall back to the (correct, slower) Python loop automatically. |
See also¶
- Poincaré sections — the full section /
PoincareMapAPI, plane spellings, and the event engine behind it - Orbit & bifurcation diagrams —
return_map,OrbitDiagram, and cascades over aPoincareMap - Lyapunov spectra — the quantitative counterpart to the steep cusp slope
- Fixed & periodic points — locating the return map's fixed points and periodic orbits