LQRax is JAX-enabled continuous-time LQR solver. It is essentially a Riccati equation solver completely written in JAX:
- It accelerates numerical simulation through JAX's
scan
mechanism; - It allows rapid prototyping of iterative LQR (iLQR) for nonlinear control by supporting auto-differentiation on the loss function and dynamics;
- It also enables batch-based large-scale optimal control using JAX's
vmap
mechanism.
This repo is currently under active development.
Follow the instructions to install JAX before installing this package.
To install: pip install lqrax
There are two modules: LQR
and iLQR
,
The LQR
module solves the following time-varying LQR problem:
An jupyter notebook example for the LQR
module is provided here. You can open it in Google Colab here.
The iLQR
module solves a different time-varying LQR problem:
This formulation is often used as the sub-problem for iterative linear quadratic regulator (iLQR) to calculate the steepest descent direction on the control for a general nonlinear control problem:
where the
An jupyter notebook example of using the iLQR
module for a nonlinear control problem is provided here. You can open it in Google Colab here.
The implementations contained herein are copyright (C) 2024 - 2025 by Max Muchen Sun, and are distributed under the terms of the GNU General Public License (GPL) version 3 (or later). Please see the LICENSE for more information.
If you use the package in your research, please cite this repository. You can see the citation information at the right side panel under "About". The BibTeX file is attached below:
@software{sun_lqrax_2025,
author = {["Sun"], Max Muchen},
license = {GPL-3.0},
month = march,
title = {{LQRax: JAX-enabled continuous-time LQR solver}},
url = {https://github.com/MaxMSun/lqrax},
version = {0.0.1},
year = {2025}
}
Contact: [email protected]