Observed since 21 Oct, 09:49 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
AI4Science: Efficient data-driven Online Model Learning (OML) / system identification and control
AI4Science: Efficient data-driven Online Model Learning (OML) / system identification and control. The algorithm is proposed in this paper.
To get started,
pip install ai4sci.oml --upgrade
This python package is based on the online dynamic mode decomposition algorithm, which is also available as a python package pip install odmd --upgrade, see here.
Lorenz system is one of the most classical nonlinear dynamical systems. Here we show how the proposed algorithm can be used to controll that. For more details, see demo.
If there is no control, we can see the mysterious butterfly trajectory. It starts close to the bottom plane and enters into the butterfly wing region, then oscillates there.
If we apply data-driven real-time closed loop control, it can be stabilized at an unstable fixed point (near the center of the butterfly wing).
Here are some hightlights about this algorithm, and for more detail refer to this paper
This is a brief introduction to the algorithm. For full technical details, see this paper, and chapter 3 and chapter 7 of this PhD thesis.
Suppose we have a (discrete) nonlinear and/or time-varying dynamical system, and the state space representation is
where t is (discrete) time, x(t) is state vector, u(t) is control (input) vector, y(t) is observation (output) vector. f(~, ~, ) and g(, ~, ~) are unknown vector-valued nonlinear functions.
We would like to learn an adaptive linear model
that fits/explains the observation optimally. By Taylor expansion approximation, any nonlinear and/or time-varying system is linear locally. There are many powerful tools for linear control, e.g, Linear Quadratic Regulator, Kalman filter. However, to accurately approximate the original (unknown) dynamical system, we need to update this linear model efficiently in real-time whenever new measurement becomes available.
This problem can be formulated as an optimization problem, and at each time step t we need to solve a related but slightly different optimization problem. The optimal algorithm is achived through efficient reformulation of the problem.
ai4sci.oml.OnlineLinearModel class implements the optimal algorithm.If we need to fit a nonlinear model to the observed data, this algorithm also applies in this case. Keep in mind that linear adaptive model is good approximation as long as it is updated in real-time. Also, the choice of nonlinear form can be tricky. Based on Taylor expansion, if we add higher order nonlinearity (e.g., quadratic, cubic), the approximation can be more accurate. However, given the learned nonlinear model, it is still not easy to apply control.
In particular, we want to fit a nonlinear model of this form
where phi(~, ) and psi(, ~) are known vector-valued nonlinear functions (e.g, quadratic) that we specify, F and G are unknown matrices of proper size.
This can also be formulated as the same optimization problem, and the same efficient algorithm works in this case.
ai4sci.oml.OnlineModel class implements the optimal algorithm.From PyPi
pip install ai4sci.oml --upgrade
From source
git clone https://github.com/haozhg/oml.git
cd oml/
pip install -e .
cd tests/
python -m pytest .
See ./demo for python notebook to demo the algorithm for data-driven real-time closed loop control.
demo_lorenz.ipynb shows control of Lorenz attractor.demo_online_linear_model.ipynb shows control of an unstable linear time-varying system.Hao Zhang
If you you used these algorithms or this python package in your work, please consider citing
Zhang, Hao, Clarence W. Rowley, Eric A. Deem, and Louis N. Cattafesta.
"Online dynamic mode decomposition for time-varying systems."
SIAM Journal on Applied Dynamical Systems 18, no. 3 (2019): 1586-1609.
BibTeX
@article{zhang2019online,
title={Online dynamic mode decomposition for time-varying systems},
author={Zhang, Hao and Rowley, Clarence W and Deem, Eric A and Cattafesta, Louis N},
journal={SIAM Journal on Applied Dynamical Systems},
volume={18},
number={3},
pages={1586--1609},
year={2019},
publisher={SIAM}
}
April 2017
MIT
If you want to use this package, but find license permission an issue, pls contact me at haozhang at alumni dot princeton dot edu.
If there is any comment/suggestion, or if you find any bug, feel free to
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.2.2 | 20 Oct 2022 | 1 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 09:49 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:bd839c01a1eacfb76f484c0046146c761ff7acf24cc1aed08ecb73f8f120c7e4