Search arXivSearch

arXiv · 2506.14044

pynamicalsys: A Python toolkit for the analysis of dynamical systems

Abstract

Since Lorenz's seminal work on a simplified weather model, the numerical analysis of nonlinear dynamical systems has become one of the main subjects of research in physics. Despite of that, there remains a need for accessible, efficient, and easy-to-use computational tools to study such systems. In this paper, we introduce pynamicalsys, a simple yet powerful open-source Python module for the analysis of nonlinear dynamical systems. In particular, pynamicalsys implements tools for trajectory simulation, bifurcation diagrams, Lyapunov exponents and several others chaotic indicators, period orbit detection and their manifolds, as well as escape and basins analysis. It also includes many built-in models and the use of custom models is straighforward. We demonstrate the capabilities of pynamicalsys through a series of examples that reproduces well-known results in the literature while developing the mathematical analysis at the same time. We also provide the Jupyter notebook containing all the code used in this paper, including performance benchmarks. pynamicalsys is freely available via the Python Package Index (PyPI) and is indented to support both research and teaching in nonlinear dynamics.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Matheus Rolim Sales, Leonardo Costa de Souza, Daniel Borin, Michele Mugnaine, José Danilo Szezech Jr., Ricardo Luiz Viana, Iberê Luiz Caldas, Edson Denis Leonel, Chris G. Antonopoulos. 2025-06-16. pynamicalsys: A Python toolkit for the analysis of dynamical systems. https://arxiv.org/abs/2506.14044

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Final state sensitivity and fractal basin boundaries from coupled Chialvo neurons

We investigate and quantify the basin geometry and extreme final state uncertainty of two identical electrically asymmetrically coupled Chialvo neurons. The system's diverse behaviors are presented, along with the mathematical reasoning behind its chaotic and nonchaotic dynamics as determined by the structure of the coupled equations. The system is found to be multistable with two qualitatively different attractors. Although each neuron is individually nonchaotic, the chaotic basin takes up the vast majority of the coupled system's state space, but the nonchaotic basin stretches to infinity due to chance synchronization. The boundary between the basins is found to be fractal, leading to extreme final state sensitivity. This uncertainty and its potential effect on the synchronization of biological neurons may have implications for understanding neuronal biology.

nlin.CD

Jordan-Block Degeneracy and Cubic-Order Bifurcating Periodic Orbits in Minimum-Energy Optimal Control of Hamiltonian Equilibria

Equilibria of the Hamiltonian system associated with Pontryagin's minimum principle exhibit an exact doubling of the natural spectrum and, under a simple pairing condition, a Jordan block at every simple purely imaginary eigenvalue. Consequently, the classical Lyapunov Center Theorem does not apply to the augmented system, and no periodic orbit with nonzero optimal control bifurcates at linear order. We establish this mechanism in general and show that an optimal-control-induced periodic family emerges at cubic order in a Lindstedt--Poincaré expansion. The mechanism is illustrated in closed form for the pendulum and evaluated numerically for the planar $L_2$ equilibrium of Hill's restricted three-body problem, where the third-order approximation is validated against an independently computed family of periodic orbits.

nlin.CD

Hypersensitivity and Turnpikes in Optimal Control of Inverted Pendulum: A Dynamical Systems Perspective

The hypersensitivity and turnpike phenomena in the optimal control of an inverted pendulum are investigated from a dynamical-systems perspective. We show that, for a fixed terminal time and a fixed terminal state optimal control problem, (1) the hypersensitivity originates from the fractal structure of the set of initial adjoint variables in the associated Hamiltonian dynamics, (2) the turnpike arises from slow dynamics in the vicinity of a degenerate center manifold, and (3) the escape channels are formed by normally hyperbolic invariant manifolds (NHIMs). As a consequence, small perturbations in the initial adjoint variables lead to qualitatively distinct extremal trajectories, resulting in severe numerical instability in trajectory optimization. Both the fractal structure and the invariant sets are characterized numerically and analytically.

nlin.CD