Bifurcation diagrams
Bifurcation diagrams are produced as a post-processing workflow after you sweep a parameter: the sweep helpers in dynlib.analysis.sweep (e.g., traj_sweep, lyapunov_mle_sweep, lyapunov_spectrum_sweep) record trajectories or diagnostics for each grid value, and SweepResult.bifurcation(var) converts those trajectories into the scatter points that form the diagram.
Workflow
- Run a sweep with
dynlib.analysis.sweep.traj_sweep(or another sweep helper) over the parameter you're interested in. Record the variables you want to plot and keep any transients you want to discard via thetransient,tail, or extractor arguments. - Extract bifurcation points with
result.bifurcation("x"),result.bifurcation("z").extrema(...), etc. TheBifurcationExtractorprovides helpers such asextrema(...),tail(...),final(), andpoincare(...)so you can build steady-state envelopes, maxima/minima, or return-section crossings. - Plot the result with
dynlib.plot.bifurcation_diagram(extractor)or feed the extractor’sp/yarrays into your own figure routines. The extractor carries metadata (param_name,values,meta) that keeps axis labels and parameter grids consistent.
The dynlib.plot.bifurcation_diagram helper is demonstrated in examples/bifurcation_logistic_map.py, and bifurcation extraction is shown alongside Lyapunov sweeps in examples/analysis/lyapunov_sweep_mle_demo.py and examples/analysis/lyapunov_sweep_spectrum_demo.py.
Notes
- The extractor works with trajectories of different lengths—the helper normalizes the data so you can stack or iterate over runs safely.
- Many sweep helpers fill
metawith stepper settings, so you can see whether each point used the samedt,record_interval, etc. - When building publication figures, combine bifurcation extractors with
series.plot,phase.xy, orfig.gridfor custom layouts.