Skip to main content

JAX-enabled continuous-time LQR solver

Project description

lqrax

JAX-enabled continuous-time LQR solver.

This repo is under active development.

Install

Follow the instructions to install JAX before installing this package.

To install: pip install lqrax

Usage

There are two modules: LQR and iLQR,

The LQR module solves the following time-varying LQR problem:

$$ \int_0^T \Big[ (x(t)-\bar{x}(t))^\top Q (x(t)-\bar{x}(t)) + u(t)^\top R u(t) \Big] dt \ \text{s.t. } \dot{x}(t) = A(t) x(t) + B(t) u(t), \quad x(0) = x_0 $$

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 iLQR problem:

$$ \int_0^T \Big[ z(t)^\top Q z(t) + v(t)^\top R v(t) + z(t)^\top a(t) + v(t)^\top b(t) \Big] dt \ \text{s.t. } \dot{z}(t) = A(t) z(t) + B(t) v(t), \quad z(0) = 0 $$

This formulation is often used as the sub-problem for iterative linear quadratic regulator (iLQR) to calculate the steepest descent direction on the control, where the $z(t)$ and $v(t)$ are perturbations on the system's state and control, and $A(t)$ and $B(t)$ are the linearized system dynamics on the current system trajectory.

An jupyter notebook example for the iLQR module is provided here. You can open it in Google Colab here.

Copyright and License

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 sandbox 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: msun@u.northwestern.edu

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lqrax-0.0.1.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lqrax-0.0.1-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file lqrax-0.0.1.tar.gz.

File metadata

  • Download URL: lqrax-0.0.1.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.14

File hashes

Hashes for lqrax-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5914f3e6a69a8bf9cbbc47c01d5607606d2eda71252e536c2ea8b92666cb510f
MD5 aa59460ae06ea5e1518c2993bcdd52c9
BLAKE2b-256 283403a99c13a87364fd9e1ffb1568497f4ca14d5ceceba02a9d11ecbca2fe79

See more details on using hashes here.

File details

Details for the file lqrax-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: lqrax-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.14

File hashes

Hashes for lqrax-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 91ae1c259606a67fa15a3bcbf28d88e2855b5344c929152c5727c2f68ea8fa39
MD5 7df5c032877ecfdf2cbcf904ced96c46
BLAKE2b-256 c4163978801641bf30226b3ba8df93376fae8d7c37456553c0d5512e6bab026b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page