Poincaré Maps
Poincaré Maps
A Poincaré map (or return map) reduces the study of a continuous dynamical system to a discrete one by recording where a trajectory crosses a chosen surface of section. For a 1D discrete map like the logistic map, the Poincaré map is simply the orbit itself — plotting (xₙ, xₙ₊₁) reveals the structure of the attractor.
After discarding a transient (warm-up iterations to reach the attractor), the remaining orbit reveals the system's asymptotic behaviour. A period-1 fixed point produces a single value; a period-4 orbit cycles through exactly 4 distinct values; a chaotic orbit never repeats.
Return maps are central to bifurcation diagrams: sweeping over the parameter r and plotting the attractor values produces the famous logistic map bifurcation diagram.
Implement the following functions:
logistic_orbit(r, x0, n_transient, n_keep)— discardn_transienttransients, then collectn_keeporbit values (each rounded to 8 decimal places)orbit_period(orbit, tol=1e-6)— detect the number of distinct values in the orbit (the period)return_map_pairs(xs)— return a list of consecutive pairs [(x0,x1), (x1,x2), …]