Extended Lagrangian SINDy (xL-SINDy) is a learning based algorithm designed to obtain Lagrangian function of nonlinear dynamical systems from noisy measurement data. This method is inspired by SINDy (the Sparse identification of Nonlinear Dynamics). The Lagrangian function is modeled as a linear combination of nonlinear candidate functions, and Euler-Lagrange’s equation is used to formulate the objective cost function. The optimization of the learning process is done with proximal gradient method.
The effectiveness of xL-SINDy is demonstrated against different noise levels in physical simulation with four dynamical systems: A single pendulum, a cart-pendulum, a double pendulum, and a spherical pendulum.
- Clone this repository
git clone https://github.com/AdamPurnomo/Extended-Lagrangian-SINDy-xL-SINDy-.git - Install the environment and dependencies
conda env create -f environment.yml
Please take a look at Source/Notebook/[System Name] - Train.ipynb or Source/Python Script/[System Name]_Train.py and run the code.
- numpy 1.19.2
- scipy 1.6.1
- pytorch 1.9.0
- sympy 1.7.1


