Bifurcation Diagrams
Render post-processed bifurcation diagrams by plotting coordinate local maxima under parameter sweeps.
Bifurcation diagrams are critical for identifying parameter regions that display chaotic behaviors, periodic doubling, or periodic windows. The library implements automated post-processing routines to extract local maxima/minima from numerical simulations and generate publication-quality figures.
Extracting Bifurcation Points
To build a bifurcation diagram, you integrate the system over a range of parameter values (e.g., varying , , or ), discard transient burn-in data, and locate the local extrema of an observable coordinate (e.g., ).
import numpy as np
from hidden_attractors.analysis import bifurcation_points_from_trajectories
# 1. Prepare simulated trajectory scans across parameter values
scans = [(mu, run_trajectory(mu)) for mu in np.linspace(0.2, 2.5, 50)]
# 2. Extract local maxima after transient burn-in
points = bifurcation_points_from_trajectories(
scans,
observable="x",
t_start=40.0,
mode="maxima"
)
Plotting the Diagram
Render the compiled bifurcation points:
from hidden_attractors.plotting import plot_bifurcation_diagram
plot_bifurcation_diagram(
points,
output_path="outputs/sweeps/bifurcation_diagram.png",
parameter_label="System Parameter \u03bc",
observable_label="Local Maxima of x(t)",
title="Chua Post-Processed Bifurcation Diagram",
color="#e11d48",
alpha=0.6,
s=1.5
)
Multidimensional Sweeps
For complex systems, you can also compute dense sweeps where bifurcation points are plotted as heatmaps representing Lyapunov exponent values or spectral entropy across two parameters simultaneously.