• Stars
    star
    274
  • Rank 150,274 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A package for computing data-driven approximations to the Koopman operator.

PyKoopman

Build Documentation Status PyPI Codecov

PyKoopman is a Python package for computing data-driven approximations to the Koopman operator.

Data-driven approximation of Koopman operator

Given a nonlinear dynamical system,

x'(t) = f(x(t)),

the Koopman operator governs the temporal evolution of the measurement function. Unfortunately, it is an infinite-dimensional linear operator. Most of the time, one has to project the Koopman operator onto a finite-dimensional subspace that is spanned by user-defined/data-adaptive functions. If the system state is also contained in such subspace, then effectively, the nonlinear dynamical system is (approximately) linearized in a global sense.

Structure of PyKoopman

PyKoopman package is centered around the Koopman class and KoopmanContinuous class. It consists of two key components

  • observables: a set of observables functions, which spans the subspace for projection.
  • regressor: the optimization algorithm to find the best fit for the projection of Koopman operator.

After Koopman/KoopmanContinuous object has been created, it must be fit to data, similar to a scikit-learn model. We design PyKoopman such that it is compatible to scikit-learn objects and methods as much as possible.

Example

Installation

Installing with pip

If you are using Linux or macOS you can install PyKoopman with pip:

pip install pykoopman

Installing from source

First clone this repository:

git clone https://github.com/dynamicslab/pykoopman

Then, to install the package, run

pip install .

If you do not have pip you can instead use

python setup.py install

If you do not have root access, you should add the --user option to the above lines.

Documentation

The documentation for PyKoopman is hosted on Read the Docs.

Community guidelines

Contributing code

We welcome contributions to PyKoopman. To contribute a new feature please submit a pull request. To get started we recommend installing the packages in requirements-dev.txt via

pip install -r requirements-dev.txt

This will allow you to run unit tests and automatically format your code. To be accepted your code should conform to PEP8 and pass all unit tests. Code can be tested by invoking

pytest

We recommed using pre-commit to format your code. Once you have staged changes to commit

git add path/to/changed/file.py

you can run the following to automatically reformat your staged code

pre-commit -a -v

Note that you will then need to re-stage any changes pre-commit made to your code.

Reporting issues or bugs

If you find a bug in the code or want to request a new feature, please open an issue.

References

  • Williams, Matthew O., Ioannis G. Kevrekidis, and Clarence W. Rowley. A dataโ€“driven approximation of the koopman operator: Extending dynamic mode decomposition. Journal of Nonlinear Science 25, no. 6 (2015): 1307-1346. [DOI]
  • Williams, Matthew O., Clarence W. Rowley, and Ioannis G. Kevrekidis. A kernel-based approach to data-driven Koopman spectral analysis. arXiv preprint arXiv:1411.2260 (2014). [DOI]
  • Brunton, Steven L., et al. Chaos as an intermittently forced linear system. Nature communications 8.1 (2017): 1-9. [DOI]
  • Kaiser, Eurika, J. Nathan Kutz, and Steven L. Brunton. Data-driven discovery of Koopman eigenfunctions for control. Machine Learning: Science and Technology 2.3 (2021): 035023. [DOI]
  • Lusch, Bethany, J. Nathan Kutz, and Steven L. Brunton. Deep learning for universal linear embeddings of nonlinear dynamics. Nature communications 9.1 (2018): 4950. [DOI]
  • Otto, Samuel E., and Clarence W. Rowley. Linearly recurrent autoencoder networks for learning dynamics. SIAM Journal on Applied Dynamical Systems 18.1 (2019): 558-593. [DOI]
  • Pan, Shaowu, Nicholas Arnold-Medabalimi, and Karthik Duraisamy. Sparsity-promoting algorithms for the discovery of informative Koopman-invariant subspaces. Journal of Fluid Mechanics 917 (2021). [DOI]

More Repositories

1

pysindy

A package for the sparse identification of nonlinear dynamical systems from data
Python
1,424
star
2

databook_matlab

Matlab files with demo code intended as a companion to the book "Data-Driven Science and Engineering: Machine Learning, Dynamical Systems, and Control" by Steven L. Brunton and J. Nathan Kutz http://www.databookuw.com/
MATLAB
250
star
3

SINDy-PI

SINDy-PI: A Robust Algorithm for Parallel Implicit Sparse Identification of Nonlinear Dynamics
MATLAB
127
star
4

pysensors

PySensors is a Python package for sparse sensor placement
Python
76
star
5

dominant-balance

Methods and code for J. L. Callaham, J. N. Kutz, B. W. Brunton, and S. L. Brunton (2020)
Jupyter Notebook
55
star
6

hydrogym

An RL-Gym for Challenge Problems in Data-Driven Modeling and Control of Fluid Dynamics.
Jupyter Notebook
53
star
7

modified-SINDy

Example code for paper: Automatic Differentiation to Simultaneously Identify Nonlinear Dynamics and Extract Noise Probability Distributions from Data
Jupyter Notebook
50
star
8

langevin-regression

Code for "Nonlinear stochastic modeling with Langevin regression" J. L. Callaham, J.-C. Loiseau, G. Rigas, and S. L. Brunton
Jupyter Notebook
24
star
9

MultiArm-Pendulum

This repository is for our paper: "The Experimental Multi-Arm Pendulum on a Cart: A Benchmark System for Chaos, Learning, and Control." It contains all the CAD files we used to build the pendulum hardware, their corresponding user's manual, and data set we collected from our hardware, which is useful for Machine Learning and AI community.
MATLAB
19
star
10

deep-learning-fluids

A collection of codes and references for deep learning in fluid dynamics
Jupyter Notebook
16
star
11

ctf-dl-tutorial

CTF workshop deep learning tutorial and hackathon
Jupyter Notebook
12
star
12

Saddle-Mediated-Transport-of-Double-Pendulum

Julia
8
star
13

NormalFormAE

Julia
2
star
14

KoopmanRL-NeurIPS

HTML
2
star