Abstract
PyKoopman is a Python package for the data-driven approximation of the Koopman operator associated with dynamical systems. The Koopman operator is a principled linear embedding of nonlinear dynamics and facilitates the prediction, estimation, and control of strongly nonlinear dynamics using linear systems theory. In particular, PyKoopman provides tools for data-driven system identification for unforced and actuated systems that build on the equation-free dynamic mode decomposition (DMD) and its variants.
Introduction
In engineering and physics, most real-world systems—such as fluid turbulence, climate patterns, or robotics—are fundamentally nonlinear. Traditionally, researchers have relied on local linearization (e.g., Taylor series expansions) to manage these systems. However, these approximations are only valid in a small neighborhood around a specific point.
Koopman operator theory offers a global alternative: instead of approximating the nonlinear dynamics, it "lifts" the system's state into a higher-dimensional space of observables where the dynamics behave linearly. PyKoopman addresses the challenge of implementing these complex "lifting" algorithms by providing a centralized, modular, and professional-grade library that automates state-of-the-art methods like Dynamic Mode Decomposition (DMD) and Extended DMD (EDMD).
Methodology and Implementation
PyKoopman follows a principled two-step pipeline to identify a system from data:
- Observables: The user selects a library of functions (e.g., polynomials, time-delay coordinates, or radial basis functions) to "lift" the state $x$ into a new vector $z$.
- Regression: The package uses regression techniques to find the optimal linear operator $A$ that describes how $z$ evolves over time.
The package is highly modular and integrates with the Scikit-learn ecosystem, allowing it to fit into standard machine learning pipelines. It also supports deep learning methods (via PyTorch) for discovering optimal observables when manual selection is difficult. A key feature is its support for both unforced and "actuated" systems, making it a practical tool for control engineers.
Key Insights and Results
The core advantage of PyKoopman is the transition from local to global linear approximations. By finding the right coordinate system, a nonlinear system can be treated as linear across its entire operating range. The library includes built-in support for generating data from standard benchmarks like the Van der Pol oscillator, Lorenz system, and the Kuramoto-Sivashinsky equation.
Results demonstrate that PyKoopman can successfully learn the Koopman operator for nonlinear systems with high accuracy. For instance, a 2D nonlinear system can be perfectly linearized in a 3D lifted space using simple polynomial observables, showing excellent agreement between ground truth and model predictions on unseen test data.
Limitations and Future Work
While PyKoopman provides a robust framework, selecting the "best" lifting functions for a brand-new physical system still requires significant domain expertise. Additionally, very high-dimensional systems, such as high-resolution fluid simulations, may require further optimizations in the regression step. The authors intend for PyKoopman to be a "living" toolkit, with planned extensions to keep pace with the rapidly evolving field of data-driven dynamics.
Summary updated