Analysis · Poincaré sections
Poincaré sections¶
A continuous flow is hard to see: a 3-D attractor is a tangle, a higher-D one is
invisible. Poincaré's device is to stop watching the whole trajectory and record
only the moments it pierces a chosen surface. That reduces the flow by one
dimension and yields a discrete return map when the section is transversal
and returns are well defined. Periodic orbits give finite point sets and a
strange attractor can reveal finer structure. ts.analysis.find(view) lists the
analyses that support a discrete protocol view of a flow.
The idea¶
Pick a hyperplane \(\Sigma\) in state space and watch the trajectory cross it, always in the same direction. The ordered sequence of crossing points \(\mathbf{u}_0, \mathbf{u}_1, \dots\) is the surface of section, and the rule \(\mathbf{u}_n \mapsto \mathbf{u}_{n+1}\) that carries one crossing to the next is the Poincaré (first-return) map. A period-\(T\) orbit that crosses \(\Sigma\) once per period shows up as a single fixed point of that map; a quasi-periodic torus as a closed loop; a chaotic attractor as a structured cloud of one lower dimension than the flow. The section throws away the flow between crossings but exposes the dynamics of returns to that section; a poor or non-transversal section can miss relevant dynamics. A DDE section records instantaneous states and crossing times, not the complete history needed to specify its state.
From a system: root-refined crossings¶
Hand poincare_section a flow and the plane, and it returns the crossings:
import tsdynamics as ts
section = ts.analysis.poincare_section(
ts.systems.Rossler(),
plane=("y", 0.0, "up"), # section y = 0, crossed upward
crossings=500,
)
section.t # crossing times, shape (500,)
section.y # full-dimensional crossing states, (500, 3)
print(section) # a one-line report of what the section is
The system path marches the flow with a detection step dt, brackets each sign
change of the plane function, and refines the crossing with cubic Hermite
interpolation — endpoint derivatives come from the system's numeric right-hand
side. For a smooth, transverse crossing, cubic Hermite interpolation has local
error \(O(\Delta t^4)\) in the state. Integration error and near-tangency can
limit crossing accuracy; check convergence as dt decreases and ensure no
crossings are skipped.
The return value is a PoincareSection — a Trajectory subclass carrying
section plot intent (so a renderer draws the in-plane scatter, not a misleading
flow line) plus a .to_dict() / .plot result surface. It is still a
trajectory, so section["x"], section[10:50] and ts.plot(section) all work.
Supported ODEs collect and refine crossings in one Rust event-engine call.
DDEs, stiff defaults and backend="reference" use the Python collection path.
These paths implement the same crossing construction; performance depends on
the system, integration settings and number of crossings.
From trajectory data: no system needed¶
If you only hold arrays — archived output, an experimental record — pass the
Trajectory instead:
traj = ts.systems.Lorenz().run(final_time=300.0, dt=0.01)
section = ts.analysis.poincare_section(traj, plane=("z", 25.0)) # plane z = 25
The data path finds sign changes between consecutive samples and locates each crossing by linear interpolation. It needs nothing but the arrays, but its accuracy is bounded by the trajectory's sampling interval (\(O(\Delta t^2)\)). When you still hold the system, prefer the system path — it refines to a far tighter tolerance than the grid you happened to save.
Specifying the plane¶
The plane= argument accepts three spellings; the friendly one names a
coordinate and a direction word.
| Spec | Meaning |
|---|---|
("y", 0.0) — name + offset |
Axis-aligned section \(y = 0\), with direction= deciding orientation |
("y", 0.0, "up") — name + offset + direction |
The same, with the crossing direction inline (overrides direction=) |
(1, 0.0) — index + offset |
Axis-aligned section on component 1 (indices work when no variables are declared) |
([1, 0, 0], 0.0) — normal + offset |
The general section \(\mathbf{n}\cdot\mathbf{y} = \text{offset}\) for an arbitrary normal vector |
A component name is resolved against the system's variables; a wrong name
or a name on a system without variables raises InvalidParameterError with a
hint. The direction words are "up" (increasing through the plane, the
default), "down", and "both":
ts.analysis.poincare_section(traj, plane=("y", 0.0, "up")) # only upward crossings
ts.analysis.poincare_section(traj, plane=("y", 0.0), direction="down")
ts.analysis.poincare_section(traj, plane=("y", 0.0, "both")) # both orientations
One-sided sections are usually what you want — a two-sided section superimposes the two halves of the attractor and blurs the return structure.
skip_crossings, not transient
To discard leading crossings while the flow settles onto the attractor, use
skip_crossings= — a count of crossings, deliberately distinct from the
time- or step-based transient of other analyses. The section transient is
measured in section hits, so the vocabulary keeps them apart.
sys.poincare(...) — the section as a discrete map¶
For repeated stepping or parameter sweeps, construct a derived system with
sys.poincare(...). It presents section crossings through the discrete stepping
protocol. Analyses that need an analytic map Jacobian have additional restrictions;
use ts.analysis.find(pmap) to discover supported analyses.
pmap = ts.systems.Rossler().poincare("y", 0.0, direction="up", dt=0.01)
u1 = pmap.step() # advance the flow to the next crossing
sec = pmap.run(500) # collect 500 crossings → PoincareSection
pmap.crossing_count # bookkeeping
Give poincare a period instead of a plane and you get a strobe — the state
sampled once per forcing cycle of a driven oscillator:
A plane is an affine surface; a period samples the phase circle. Exactly one of them is given; passing both raises and names the choice.
The most important consumer is orbit_diagram:
a parameter sweep over a section is a bifurcation diagram of the flow. The
section is also exposed to the general events API via pmap.as_events(), so the
same crossings can be collected through system.run(events=...). A
ConvergenceError is raised if no crossing occurs within max_time — the plane
may miss the attractor, or the direction is reversed.
First-return maps¶
A return map takes the reduction one step further: from the crossing sequence it
keeps a single scalar observable and plots each value against its successor
\((v_n, v_{n+1})\), to look for an approximately one-dimensional return relation.
return_map(kind="poincare") builds it directly from a section:
rm = ts.analysis.return_map(ts.systems.Rossler(), "y", kind="poincare",
plane=("x", 0.0, "up"), n=400)
The related extremum construction — successive local maxima of a coordinate, the Lorenz \(z\)-maxima cusp — is covered on the orbit-diagrams page. A tight, single-valued curve supports an approximate scalar description. A cloud can reflect unresolved state variables, measurement noise or insufficient sampling; the plot alone does not distinguish these causes.
See also¶
- Orbit & bifurcation diagrams — sweeping a
PoincareMapinto a flow bifurcation diagram, and the extremumreturn_map - Fixed points & periodic orbits — a periodic orbit is a fixed point of the Poincaré map
- Integration & methods — the events engine and fixed-step marching the section rides on
References¶
- Poincaré, H. (1899). Les méthodes nouvelles de la mécanique céleste. Gauthier-Villars.
- Hénon, M. (1982). On the numerical computation of Poincaré maps. Physica D 5, 412–414.
- Lorenz, E. N. (1963). Deterministic nonperiodic flow. J. Atmos. Sci. 20, 130–141.